SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Lightning Fast Sass
Chris Eppstein
● Sass Core Team
● Numerous open source projects
● Open Source @ LinkedIn
Hashtags and Feedback
Twitter: @chriseppstein, @SassCSS
Hashtag: #fronteers15sass
Bro, Ruby is slow.
-DHH, probably
Yes, it is very slow.
-Matz, maybe?
My Stylesheet takes >1s to Compile
-Every Sass User
3GHz CPU =
3,000,000,000
clock cycles
1 second is an eternity.
Why Ruby?
Seriously, who builds a
compiler in Ruby?
Why Not Ruby?
Seriously, who builds a
compiler in Ruby?
Why Not Ruby?
Ruby is slow.
Front-end devs don’t know it.
Ruby is losing to Node.js.
libSass
Programming Languages by Popularity
libSass
Java
C++ Python
Ruby
Rust
PERL C#
JS
Sass for everyone!
LibSass is our “Big Bet”.
libSass Compatibility with Ruby Sass
https://github.com/sass/libsass/labels/Bug%20-%20Confirmed
98%
Was it worth it?
Downsides of libSass
● Binary files (os/hw dependent).
● Not a language many webdevs know.
● Slower to develop new features.
● Ecosystem fragmentation
Sass is more than a language
Sass is a community of web
developers sharing their best
practices, code, and tools for
writing CSS.
libSass
java
C++ C
Ruby
Rust
PERL C#
JS
Sass for everyone!
JavaScript is
WEBSCALE!!!!111one!
- Ryan Dahl, I think
node-sass
● C++ ⇔ node.JS bridge
● npm install node-sass
● var sass = require(“node-sass”)
sass.render(...) // => CSS
What about Compass?
● Compass is not being ported to
libSass.
● The best parts of compass are
being recreated.
● Active Development
Sass modules as rubygems
Alright. Let’s do this.
npm modules
● Distribute Sass modules via NPM
● Import Sass from modules
● Define Sass functions – in JS
● Global resolution of shared
dependencies.
● Deliver assets with the right URLs
Eyeglass
● Node-like Importing (index.scss)
● Filesystem API
● Website: http://eyeglass.rocks/
Eyeglass
https://www.npmjs.com/browse/keyword/eyeglass-module
Install:
npm install --save-dev module-name
Use:
@import "module-name"
Using an Eyeglass Module
Using an Eyeglass Module Or your build tool of
choice (grunt, gulp,
etc)
Defining an Eyeglass Module
package.json
Defining an Eyeglass Module
eyeglass-exports.js
Writing a Sass function in JS
Signature
Return Value
node-sass-utils simplifies writing Sass functions in JS
Writing a Sass function in JS
● sassUtils.castToSass(jsValue)
● sassUtils.castToJs(sassValue)
● class sassUtils.SassDimension
● class sassUtils.SassJsMap
● Much, much more
node-sass-utils
Modules with Assets (images/fonts/etc.)
Export assets from the module
Using Exported Assets
Import assets that you depend on!
Output a URL to assets according to
the app’s configuration.
Filesystem API
Eyeglass = nuts and bolts
Someone’s gotta do it.
Eyeglass Spriting
● Generate sprite maps from your
Sass files.
● Output corresponding CSS without
having to know image location or
dimensions.
Eyeglass Spriting
Eyeglass Spriting
Eyeglass Spriting
Eyeglass Spriting compared to Compass Spriting
● Works with multiple file formats
● Files can be in several
directories.
● No “Magic Import”
Take Aways:
● Use libSass. It’s ready.
● Use eyeglass to distribute Sass.
● No new features for Compass.
● node-sass-utils for writing Sass
functions in JS.
● Ruby Sass is not dead.
Q & A
Why not Bower?
Bower is a “front end packager”.
● No conventions.
● No framework.
● Every bower package is a
snowflake - requires devs
to know internal structure.
❄
❄
❄
❅
❆
❄
❆
❅
❄ ❅
❄

Weitere ähnliche Inhalte

Was ist angesagt?

Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
lokku
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS Framework
Olivier Besson
 

Was ist angesagt? (20)

Bootstrap 3 + responsive
Bootstrap 3 + responsiveBootstrap 3 + responsive
Bootstrap 3 + responsive
 
Making Your Own CSS Framework
Making Your Own CSS FrameworkMaking Your Own CSS Framework
Making Your Own CSS Framework
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and Tricks
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
 
CSS in React
CSS in ReactCSS in React
CSS in React
 
20111129 modernizr
20111129 modernizr20111129 modernizr
20111129 modernizr
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPress
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
LESS
LESSLESS
LESS
 
Test-proof CSS
Test-proof CSSTest-proof CSS
Test-proof CSS
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS Framework
 
Client responsive design
Client   responsive designClient   responsive design
Client responsive design
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...
 
Html & Css presentation
Html  & Css presentation Html  & Css presentation
Html & Css presentation
 
Make your website 2 times faster
Make your website 2 times fasterMake your website 2 times faster
Make your website 2 times faster
 

Ähnlich wie Lightning fast sass

Brad Enterprise Solution Architect
Brad Enterprise Solution ArchitectBrad Enterprise Solution Architect
Brad Enterprise Solution Architect
Brad Travis
 

Ähnlich wie Lightning fast sass (20)

Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Node.js an Exectutive View
Node.js an Exectutive ViewNode.js an Exectutive View
Node.js an Exectutive View
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right way
 
Nodejs
NodejsNodejs
Nodejs
 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application Development
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
 
Nodejs
NodejsNodejs
Nodejs
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 
Java Script recruiting
Java Script recruitingJava Script recruiting
Java Script recruiting
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Node.js on Azure
Node.js on AzureNode.js on Azure
Node.js on Azure
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
Brad Enterprise Solution Architect
Brad Enterprise Solution ArchitectBrad Enterprise Solution Architect
Brad Enterprise Solution Architect
 

Mehr von chriseppstein (8)

The Cascade is Dead
The Cascade is DeadThe Cascade is Dead
The Cascade is Dead
 
The Expanding Boundaries of CSS
The Expanding Boundaries of CSSThe Expanding Boundaries of CSS
The Expanding Boundaries of CSS
 
EmberConf 2015 closing keynote
EmberConf 2015 closing keynoteEmberConf 2015 closing keynote
EmberConf 2015 closing keynote
 
What makes Sass so Syntactically Awesome?
What makes Sass so Syntactically Awesome?What makes Sass so Syntactically Awesome?
What makes Sass so Syntactically Awesome?
 
SassConf: It takes a village to raise a stylesheet
SassConf: It takes a village to raise a stylesheetSassConf: It takes a village to raise a stylesheet
SassConf: It takes a village to raise a stylesheet
 
Sass & Compass @ SenchaConf
Sass & Compass @ SenchaConfSass & Compass @ SenchaConf
Sass & Compass @ SenchaConf
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Unobtrusive Stylesheets
Unobtrusive StylesheetsUnobtrusive Stylesheets
Unobtrusive Stylesheets
 

Kürzlich hochgeladen

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Kürzlich hochgeladen (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Lightning fast sass