SlideShare ist ein Scribd-Unternehmen logo
1 von 32
WordPress with SASSLESS


© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Who am I
•     Ran Bar-Zik  @barzik
•     Software Developer at HP Software R&D
•     Working at HP Live Network project.
•     My professional site: internet-israel.com




    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Variables in SASS
$some-color: #fefecc;

p {
                    color: $some-color;
}

a {
                    border-bottom: $some-color;
}

strong {
                    background-color: $some-color;
}

.someClass {
           border: $some-color solid 1px;
}

    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Mixins in SASS
@mixin RoundBorders ($radius: 5px) {
  border-radius: $radius;
}

p {
@include RoundBorders ();
}

a {
@include RoundBorders ();
}

strong {
@include RoundBorders ();
}

.someClass {
@include RoundBorders ();
}
  © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Nesting
a {
text-deocration: none;
   &:hover {
       text-decoration:underline;
   }
}




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
CSS code
  h1 {
    font-family: "Arial Black";
    font-weight: normal;
    font-size: 30px;
    color: #fefecc;
    letter-spacing: -1px;
  }
  h1:hover {
    text-decoration: underline;
  }

  h2 {
    font-family: "Arial Black";
    font-weight: normal;
    font-size: 20px;
    color: #fefecc;
    letter-spacing: -1px;
  }
  h2:hover {
    text-decoration: underline;
  }

  h3 {
    font-family: "Arial Black";
    font-weight: normal;
    font-size: 15px;
    color: #fefecc;
    letter-spacing: -1px;
  }
  h3:hover {
    text-decoration: underline;
  }}
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS code
  @mixin headerMaker ($size: 10px) {
               $header-color: #fefecc;
      font-family: "Arial Black";
               font-weight: normal;
               font-size: $size;
               color: $header-color;
               letter-spacing: -1px;
               &:hover {
                             text-decoration: underline;
               }
  }

  h1 {
                        @include headerMaker(30px);
  }

  h2 {
                        @include headerMaker(20px);
  }

  h3 {
                        @include headerMaker(15px);
  }
                                                                                                                                   }
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Why using SASSLESS ?
• Developers that create new themes
• Developers that maintain long-term applications
  and sites.
• Developers that duplicates patterns & styles
  across the blog
• Eventually it is the future – like jQuery is the
  standard for JavaScript developing, LESSSASS will
  be the standard for CSS developing.
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
How is SASSLESS is working



                                                                                  CSS preprocessor
                     SCSS files                                                                                                    CSS file




© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS preprocessors
• On Linux everything is easy:
  SASS: sass –watch input_dir:output_dir
• On Windows:
  Scout



 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS: Variables
• Defined by $.
Example:
$some-var: #000000;
.someClass {
     color: $some-var;
}
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS: Variables
Will be compiled to:
.someClass {
      color: #000000;
}


 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Variables can be anything!
•     Colors
•     Numbers
•     Text
•     List
•     Boolean

    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Variables can be changed!
$some-size: 15px;

h1 {
                    font-size: $some-size*2;
}
h6 {
                    font-size: $some-size/2
}
    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS functions
$some-color: #fefefe;

a {
                 color: $some-color;
}
a:hover {
    color: lighten($some-color, 20%);
}
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
It will be compiled to:
a {
  color: #fefe45;
}

a:hover {
  color: #ffffaa;
}
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS nesting
.someClass a {
  color: #fefe45;
}
.someClass p {
  color: #000000;
}




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS nesting
.someClass {
    a {
        color: #fefe45;
    }
    p {
      color: #000000;
    }
}


 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS Nesting and reference
  SCSS Source
a {
                    color: #fefe45;
                    &:hover {
                          color: #fff;
                    }
}




    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS Nesting and reference
  CSS output
a {
  color: #fefe45;
}
a:hover {
  color: #fff;
}




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS mixins
• The SASS “functions”
• The main way to divide the CSS code to
  small, reusable parts.
• Clusters of mixins can be used as a base layer to
  every projects.
• In HP Software HP Live network we developed HP
  Experience on SASS and LESS that contains basic
  mixins for every basic CSS elements.
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS mixin - example
@mixin my-great-mixin() {
         color: #000;
         font-size: 14px;
}
p {
         @include my-great-mixin();
}
a {
         @include my-great-mixin();
}




  © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS mixin - output
p {
  color: #000;
  font-size: 14px;
}

a {
  color: #000;
  font-size: 14px;
}




  © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASS BIDI




© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
How to use SASSLESS on
 existing WordPress project?
• Copy style.css & rtl.css to style.scss & rtl.scss.
• Run scoutother preprocessors.
• That’s it!




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SASSLESS on WordPress –
bones base theme




© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Directory tree
• Create SCSSLESS directory and CSS directory




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
SCSS directory
• Put all the SCSS files in the SCSS directory
• Make sure that there is a style.scss file.




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
The compiled CSS file will be at
 the CSS directory
• We need to make sure that WordPress will
  point the theme style to
  my_theme/css/style.css and not to
  my_theme/style.css
• We do it with add_action right after “after
  setup theme” hook.
 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Using after setup theme hook
•
    to add custom CSS file
      At functions.php:

add_action('after_setup_theme','my_theme_setup_function');

function my_theme_setup_function() {
    add_action('wp_enqueue_scripts', 'my_theme_scripts_and_styles');
}

function my_theme_scripts_and_styles() {
        // register main stylesheet
  wp_register_style( 'bones-stylesheet', get_stylesheet_directory_uri() .
'/my_theme/css/style.css', array(), '', 'all' );
}



    © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
At the style.scss
• Use import & media queries to import
  _files.scss according to device features.




 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Thank you




© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Weitere ähnliche Inhalte

Was ist angesagt?

Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme DevelopmentSantosh Kunwar
 
Prototyping interactions
Prototyping interactionsPrototyping interactions
Prototyping interactionsselwynjacob90
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 
The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSSAndy Budd
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJSMykhailo Kotsur
 
Drupal - Introduction to Drupal and Web Content Management
Drupal - Introduction to Drupal and Web Content ManagementDrupal - Introduction to Drupal and Web Content Management
Drupal - Introduction to Drupal and Web Content ManagementVibrant Technologies & Computers
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 
Css Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder
 

Was ist angesagt? (18)

Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
Prototyping interactions
Prototyping interactionsPrototyping interactions
Prototyping interactions
 
Php
PhpPhp
Php
 
新 · 交互
新 · 交互新 · 交互
新 · 交互
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSS
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJS
 
Drupal - Introduction to Drupal and Web Content Management
Drupal - Introduction to Drupal and Web Content ManagementDrupal - Introduction to Drupal and Web Content Management
Drupal - Introduction to Drupal and Web Content Management
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
File formats
File formatsFile formats
File formats
 
Css Founder.com | Cssfounder Net
Css Founder.com | Cssfounder NetCss Founder.com | Cssfounder Net
Css Founder.com | Cssfounder Net
 
wordpress
wordpresswordpress
wordpress
 
The web context
The web contextThe web context
The web context
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 

Ähnlich wie Using SASS in the WordPress environment - Ran Bar Zik

Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"bentleyhoke
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSSteve Krueger
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Introduction to CSS Preprocessors
Introduction to CSS PreprocessorsIntroduction to CSS Preprocessors
Introduction to CSS PreprocessorsBlake Newman
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 

Ähnlich wie Using SASS in the WordPress environment - Ran Bar Zik (20)

CSS3
CSS3CSS3
CSS3
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
Less css
Less cssLess css
Less css
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Why less?
Why less?Why less?
Why less?
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
LESS CSS
LESS CSSLESS CSS
LESS CSS
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Introduction to CSS Preprocessors
Introduction to CSS PreprocessorsIntroduction to CSS Preprocessors
Introduction to CSS Preprocessors
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Team styles
Team stylesTeam styles
Team styles
 
AAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptxAAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptx
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
LESS is More
LESS is MoreLESS is More
LESS is More
 

Mehr von Miriam Schwab

Making your content fly with onsite SEO
Making your content fly with onsite SEOMaking your content fly with onsite SEO
Making your content fly with onsite SEOMiriam Schwab
 
Content Security Policies: A whole new way of securing your website that no o...
Content Security Policies: A whole new way of securing your website that no o...Content Security Policies: A whole new way of securing your website that no o...
Content Security Policies: A whole new way of securing your website that no o...Miriam Schwab
 
Digitizing your business
Digitizing your businessDigitizing your business
Digitizing your businessMiriam Schwab
 
Managing multitudes of media
Managing multitudes of mediaManaging multitudes of media
Managing multitudes of mediaMiriam Schwab
 
Mobile SEO at SMX Israel 2014
Mobile SEO at SMX Israel 2014Mobile SEO at SMX Israel 2014
Mobile SEO at SMX Israel 2014Miriam Schwab
 
WordPress for Startups
WordPress for StartupsWordPress for Startups
WordPress for StartupsMiriam Schwab
 
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013Miriam Schwab
 
Getting an online marketing job in Jerusalem - is that even possible?
Getting an online marketing job in Jerusalem - is that even possible?Getting an online marketing job in Jerusalem - is that even possible?
Getting an online marketing job in Jerusalem - is that even possible?Miriam Schwab
 
Responsive Design for WordPress
Responsive Design for WordPressResponsive Design for WordPress
Responsive Design for WordPressMiriam Schwab
 
WordPress site planning, WordCamp Jerusalem 2013
WordPress site planning, WordCamp Jerusalem 2013WordPress site planning, WordCamp Jerusalem 2013
WordPress site planning, WordCamp Jerusalem 2013Miriam Schwab
 
The Power of Your Story - Kimanzi Constable
The Power of Your Story - Kimanzi ConstableThe Power of Your Story - Kimanzi Constable
The Power of Your Story - Kimanzi ConstableMiriam Schwab
 
מצגת יעל הרמן מוורדקמפ ירושלים 2013
מצגת יעל הרמן מוורדקמפ ירושלים 2013מצגת יעל הרמן מוורדקמפ ירושלים 2013
מצגת יעל הרמן מוורדקמפ ירושלים 2013Miriam Schwab
 
The Business of WordPress - WordCamp Jerusalem 2013
The Business of WordPress - WordCamp Jerusalem 2013The Business of WordPress - WordCamp Jerusalem 2013
The Business of WordPress - WordCamp Jerusalem 2013Miriam Schwab
 
היכרות עם וורדפרס ועוד חן כהן
היכרות עם וורדפרס ועוד   חן כהןהיכרות עם וורדפרס ועוד   חן כהן
היכרות עם וורדפרס ועוד חן כהןMiriam Schwab
 
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכירים
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכיריםמ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכירים
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכיריםMiriam Schwab
 
Small but mighty - Google+, Instagram, Pinterest
Small but mighty - Google+, Instagram, PinterestSmall but mighty - Google+, Instagram, Pinterest
Small but mighty - Google+, Instagram, PinterestMiriam Schwab
 
Measuring Twitter: SMX Israel 2013
Measuring Twitter: SMX Israel 2013Measuring Twitter: SMX Israel 2013
Measuring Twitter: SMX Israel 2013Miriam Schwab
 
Google Analytics for PPC: SMX Israel 2013
Google Analytics for PPC: SMX Israel 2013Google Analytics for PPC: SMX Israel 2013
Google Analytics for PPC: SMX Israel 2013Miriam Schwab
 
Introduction to the semantic web: SMX Israel 2013
Introduction to the semantic web: SMX Israel 2013Introduction to the semantic web: SMX Israel 2013
Introduction to the semantic web: SMX Israel 2013Miriam Schwab
 
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...Miriam Schwab
 

Mehr von Miriam Schwab (20)

Making your content fly with onsite SEO
Making your content fly with onsite SEOMaking your content fly with onsite SEO
Making your content fly with onsite SEO
 
Content Security Policies: A whole new way of securing your website that no o...
Content Security Policies: A whole new way of securing your website that no o...Content Security Policies: A whole new way of securing your website that no o...
Content Security Policies: A whole new way of securing your website that no o...
 
Digitizing your business
Digitizing your businessDigitizing your business
Digitizing your business
 
Managing multitudes of media
Managing multitudes of mediaManaging multitudes of media
Managing multitudes of media
 
Mobile SEO at SMX Israel 2014
Mobile SEO at SMX Israel 2014Mobile SEO at SMX Israel 2014
Mobile SEO at SMX Israel 2014
 
WordPress for Startups
WordPress for StartupsWordPress for Startups
WordPress for Startups
 
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013
How to add semantic data to your WP site in 20 minutes or less! WordSesh 2013
 
Getting an online marketing job in Jerusalem - is that even possible?
Getting an online marketing job in Jerusalem - is that even possible?Getting an online marketing job in Jerusalem - is that even possible?
Getting an online marketing job in Jerusalem - is that even possible?
 
Responsive Design for WordPress
Responsive Design for WordPressResponsive Design for WordPress
Responsive Design for WordPress
 
WordPress site planning, WordCamp Jerusalem 2013
WordPress site planning, WordCamp Jerusalem 2013WordPress site planning, WordCamp Jerusalem 2013
WordPress site planning, WordCamp Jerusalem 2013
 
The Power of Your Story - Kimanzi Constable
The Power of Your Story - Kimanzi ConstableThe Power of Your Story - Kimanzi Constable
The Power of Your Story - Kimanzi Constable
 
מצגת יעל הרמן מוורדקמפ ירושלים 2013
מצגת יעל הרמן מוורדקמפ ירושלים 2013מצגת יעל הרמן מוורדקמפ ירושלים 2013
מצגת יעל הרמן מוורדקמפ ירושלים 2013
 
The Business of WordPress - WordCamp Jerusalem 2013
The Business of WordPress - WordCamp Jerusalem 2013The Business of WordPress - WordCamp Jerusalem 2013
The Business of WordPress - WordCamp Jerusalem 2013
 
היכרות עם וורדפרס ועוד חן כהן
היכרות עם וורדפרס ועוד   חן כהןהיכרות עם וורדפרס ועוד   חן כהן
היכרות עם וורדפרס ועוד חן כהן
 
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכירים
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכיריםמ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכירים
מ-antispambot ועד zeroise – עשר פונקציות וורדפרס שאתם כנראה לא מכירים
 
Small but mighty - Google+, Instagram, Pinterest
Small but mighty - Google+, Instagram, PinterestSmall but mighty - Google+, Instagram, Pinterest
Small but mighty - Google+, Instagram, Pinterest
 
Measuring Twitter: SMX Israel 2013
Measuring Twitter: SMX Israel 2013Measuring Twitter: SMX Israel 2013
Measuring Twitter: SMX Israel 2013
 
Google Analytics for PPC: SMX Israel 2013
Google Analytics for PPC: SMX Israel 2013Google Analytics for PPC: SMX Israel 2013
Google Analytics for PPC: SMX Israel 2013
 
Introduction to the semantic web: SMX Israel 2013
Introduction to the semantic web: SMX Israel 2013Introduction to the semantic web: SMX Israel 2013
Introduction to the semantic web: SMX Israel 2013
 
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...
Blogging with WordPress.com for beginners, part 1/3, by Deena Levenstein IN H...
 

Kürzlich hochgeladen

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Kürzlich hochgeladen (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Using SASS in the WordPress environment - Ran Bar Zik

  • 1. WordPress with SASSLESS © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 2. Who am I • Ran Bar-Zik @barzik • Software Developer at HP Software R&D • Working at HP Live Network project. • My professional site: internet-israel.com © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 3. Variables in SASS $some-color: #fefecc; p { color: $some-color; } a { border-bottom: $some-color; } strong { background-color: $some-color; } .someClass { border: $some-color solid 1px; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 4. Mixins in SASS @mixin RoundBorders ($radius: 5px) { border-radius: $radius; } p { @include RoundBorders (); } a { @include RoundBorders (); } strong { @include RoundBorders (); } .someClass { @include RoundBorders (); } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 5. Nesting a { text-deocration: none; &:hover { text-decoration:underline; } } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 6. CSS code h1 { font-family: "Arial Black"; font-weight: normal; font-size: 30px; color: #fefecc; letter-spacing: -1px; } h1:hover { text-decoration: underline; } h2 { font-family: "Arial Black"; font-weight: normal; font-size: 20px; color: #fefecc; letter-spacing: -1px; } h2:hover { text-decoration: underline; } h3 { font-family: "Arial Black"; font-weight: normal; font-size: 15px; color: #fefecc; letter-spacing: -1px; } h3:hover { text-decoration: underline; }} © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 7. SASS code @mixin headerMaker ($size: 10px) { $header-color: #fefecc; font-family: "Arial Black"; font-weight: normal; font-size: $size; color: $header-color; letter-spacing: -1px; &:hover { text-decoration: underline; } } h1 { @include headerMaker(30px); } h2 { @include headerMaker(20px); } h3 { @include headerMaker(15px); } } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 8. Why using SASSLESS ? • Developers that create new themes • Developers that maintain long-term applications and sites. • Developers that duplicates patterns & styles across the blog • Eventually it is the future – like jQuery is the standard for JavaScript developing, LESSSASS will be the standard for CSS developing. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 9. How is SASSLESS is working CSS preprocessor SCSS files CSS file © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 10. SASS preprocessors • On Linux everything is easy: SASS: sass –watch input_dir:output_dir • On Windows: Scout © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 11. SASS: Variables • Defined by $. Example: $some-var: #000000; .someClass { color: $some-var; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 12. SASS: Variables Will be compiled to: .someClass { color: #000000; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 13. Variables can be anything! • Colors • Numbers • Text • List • Boolean © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 14. Variables can be changed! $some-size: 15px; h1 { font-size: $some-size*2; } h6 { font-size: $some-size/2 } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 15. SASS functions $some-color: #fefefe; a { color: $some-color; } a:hover { color: lighten($some-color, 20%); } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 16. It will be compiled to: a { color: #fefe45; } a:hover { color: #ffffaa; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 17. SASS nesting .someClass a { color: #fefe45; } .someClass p { color: #000000; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 18. SASS nesting .someClass { a { color: #fefe45; } p { color: #000000; } } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 19. SASS Nesting and reference SCSS Source a { color: #fefe45; &:hover { color: #fff; } } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 20. SASS Nesting and reference CSS output a { color: #fefe45; } a:hover { color: #fff; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 21. SASS mixins • The SASS “functions” • The main way to divide the CSS code to small, reusable parts. • Clusters of mixins can be used as a base layer to every projects. • In HP Software HP Live network we developed HP Experience on SASS and LESS that contains basic mixins for every basic CSS elements. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 22. SASS mixin - example @mixin my-great-mixin() { color: #000; font-size: 14px; } p { @include my-great-mixin(); } a { @include my-great-mixin(); } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 23. SASS mixin - output p { color: #000; font-size: 14px; } a { color: #000; font-size: 14px; } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 24. SASS BIDI © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 25. How to use SASSLESS on existing WordPress project? • Copy style.css & rtl.css to style.scss & rtl.scss. • Run scoutother preprocessors. • That’s it! © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 26. SASSLESS on WordPress – bones base theme © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 27. Directory tree • Create SCSSLESS directory and CSS directory © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 28. SCSS directory • Put all the SCSS files in the SCSS directory • Make sure that there is a style.scss file. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 29. The compiled CSS file will be at the CSS directory • We need to make sure that WordPress will point the theme style to my_theme/css/style.css and not to my_theme/style.css • We do it with add_action right after “after setup theme” hook. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 30. Using after setup theme hook • to add custom CSS file At functions.php: add_action('after_setup_theme','my_theme_setup_function'); function my_theme_setup_function() { add_action('wp_enqueue_scripts', 'my_theme_scripts_and_styles'); } function my_theme_scripts_and_styles() { // register main stylesheet wp_register_style( 'bones-stylesheet', get_stylesheet_directory_uri() . '/my_theme/css/style.css', array(), '', 'all' ); } © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 31. At the style.scss • Use import & media queries to import _files.scss according to device features. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
  • 32. Thank you © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.