SlideShare a Scribd company logo
Using Sass in Your
WordPress Projects
Kansas City WordCamp - July 12, 2014
!
Jeremy Green
WordPress Developer at Endo Creative
Organizer of the Fort Collins WordPress Meetup
!
@greenhornet79
!
endocreative.com
!
CSS Today
!
Bert Bos, CSS co-inventor:
!
“CSS stops short of even more powerful
features that programmers use in their
programming languages: macros, variables,
symbolic constants, conditionals,
expressions over variables, etc. That is
because these things give power-users a lot
of rope, but less experienced users will
unwittingly hang themselves.”
Vanilla CSS
Putting the Power into CSS
CSS Preprocessors
Sass
Syntactically Awesome Style Sheets
A CSS preprocessor that lets you write CSS:
!
• faster
• more efficient
• more maintainable
CSS with superpowers
A few of my favorite things
Nesting
CSS SCSS
Variables
!
• similar to php variables
• turn repetitive values into variables
• define it once, use it throughout your projects
Partials
!
• prepend partials with an underscore
• split CSS into maintainable blocks of code
• only one HTTP request!
! Folders!
Extends
!
• reuse a snippet of CSS
• does not accept any parameters
• same styles as another class, except for a few rules
Silent Placeholder
Mixins
!
• accepts parameters like a function
• use for tedious tasks like vendor prefixes
• reusable block of CSS, but with parameters
Inline Media Queries
!
• create a media query mix-in
• set breakpoints for your design
• use logic and return content in a mixin
!
• use @include to call the mixin
• stack media queries for different breakpoints
• any rules inside media query will be added to CSS
SCSS Compiled
Small Investment
Big Reward
Installing Sass
http://sass-lang.com/install
Command Line
gem install sass
Watch the files
sass --watch global.scss:global.css
Applications
The App Way
Open app, make changes, save file
Your First Project
Watch your files
Configure options
Compressed = Fastest
Let’s Precompile
Don’t touch that file
Live is .scss land now
One bite at a time
!
!
you don’t have to use everything at once
WordPress Integration
!
!
Update functions.php
!
! Use style.css (old way)
Use css/global.css (new way)
Stripped down style.css
!
!
!
• comments for theme details
• alert future developers about the theme using Sass
Use in a plugin
!
!
!
• good even for small projects
• use wp_enqueue_style to enqueue css file
• split front and back end styles
Gravity Forms
!
!
Tips for Integration
!
!
!
• make sure to update css and scss files on server
• give option to edit css if needed
• create a partial for overriding plugin styles
• app is nice when you work on 10 projects a day
Additional Tools
!
!
!
• CSS3 mixins
• helper functions (colors, math, and much more)
• generate sprites dynamically
Susy
!
!
!
• Sass grid system (or not)
• creates layouts using mixins
• calculate column and gutter widths
Breakpoint
!
!
!
• media queries with Sass
• includes lots of helpful tools
Final Thoughts
!
!
!
• Sass won’t make you write better CSS
• Sass won’t build an awesome WP theme
• Don’t be afraid to try something new
!
Resources
!
!
!
• sass-lang.com
• sassmeister.com
• Compass
• Susy
• Breakpoint
• Sass for Web Designers
• CSS Tricks Screencast
Thank You!
@greenhornet79

More Related Content

PPTX
Trials and Tribulations of Managed Metadata
PPTX
Being Well Architected in the Cloud (Updated)
PPTX
Writing your own WordPress themes and plugins
PPTX
BDUG Responsive Web Theming - 7/23/12
PPTX
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
PDF
Intro to Sass for WordPress Developers
PPTX
SCSS Implementation
Trials and Tribulations of Managed Metadata
Being Well Architected in the Cloud (Updated)
Writing your own WordPress themes and plugins
BDUG Responsive Web Theming - 7/23/12
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
Intro to Sass for WordPress Developers
SCSS Implementation

Similar to Using Sass in Your WordPress Projects (20)

KEY
Authoring Stylesheets with Compass & Sass
PPTX
Post css - Getting start with PostCSS
PPTX
Web technologies-course 05.pptx
PPTX
SASS - CSS with Superpower
PPTX
Sass:-Syntactically Awesome Stylesheet by Shafeeq
PDF
Going Multi-Tenant with dotCMS
PPT
UNIT 3.ppt
PDF
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
PDF
Front-End Frameworks: a quick overview
PPTX
Beautifying Sencha Touch
PPTX
Bliblidotcom - SASS Introduction
PPTX
SASS - Syntactically Awesome Stylesheet
PDF
WordPress Theme Structure
PPTX
Beautifying senc
PDF
CSS Workflow. Pre & Post
PPTX
Revamp Your Stylesheet
PDF
The Coding Designer's Survival Kit - Capital Camp
PDF
Hardboiled Front End Development — Found.ation
PDF
Create SASSY Web Parts - SPSMilan
PDF
Postcss brewbox slides
Authoring Stylesheets with Compass & Sass
Post css - Getting start with PostCSS
Web technologies-course 05.pptx
SASS - CSS with Superpower
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Going Multi-Tenant with dotCMS
UNIT 3.ppt
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
Front-End Frameworks: a quick overview
Beautifying Sencha Touch
Bliblidotcom - SASS Introduction
SASS - Syntactically Awesome Stylesheet
WordPress Theme Structure
Beautifying senc
CSS Workflow. Pre & Post
Revamp Your Stylesheet
The Coding Designer's Survival Kit - Capital Camp
Hardboiled Front End Development — Found.ation
Create SASSY Web Parts - SPSMilan
Postcss brewbox slides
Ad

More from Jeremy Green (9)

PDF
Accelerated Mobile Pages - WordCamp Kansas City
PDF
Accelerated Mobile Pages
PDF
The Final 20%: Improving Craftsmanship in Web Development - WordCamp DFW 2015
PDF
You've Been Hacked, Now What? Getting WordPress Up and Running Again
PDF
The Final 20 Percent
PDF
Build a Membership Site with WordPress
PPT
FTP Commando to Git Hero - WordCamp Denver 2013
KEY
10 Ways to Secure WordPress
KEY
WordCamp Denver 2012 - Custom Meta Boxes
Accelerated Mobile Pages - WordCamp Kansas City
Accelerated Mobile Pages
The Final 20%: Improving Craftsmanship in Web Development - WordCamp DFW 2015
You've Been Hacked, Now What? Getting WordPress Up and Running Again
The Final 20 Percent
Build a Membership Site with WordPress
FTP Commando to Git Hero - WordCamp Denver 2013
10 Ways to Secure WordPress
WordCamp Denver 2012 - Custom Meta Boxes
Ad

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
medical staffing services at VALiNTRY
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Nekopoi APK 2025 free lastest update
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
history of c programming in notes for students .pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
medical staffing services at VALiNTRY
Advanced SystemCare Ultimate Crack + Portable (2025)
Nekopoi APK 2025 free lastest update
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Design an Analysis of Algorithms I-SECS-1021-03
Odoo Companies in India – Driving Business Transformation.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
assetexplorer- product-overview - presentation
Design an Analysis of Algorithms II-SECS-1021-03
Computer Software and OS of computer science of grade 11.pptx
Oracle Fusion HCM Cloud Demo for Beginners
Navsoft: AI-Powered Business Solutions & Custom Software Development
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx

Using Sass in Your WordPress Projects