Dynamically Sassy
summary
Shows how to generate dynamic CSS from Sass by adding SassScript functions and using the Sass engine with a custom options hash and load_paths to inject a user seed color. Demonstrates caching with memcached to drop renders from ~2 s to ~212 ms, an alternative of offloading renders to Sidekick background jobs, and a final lesson that refactoring the Sass cuts first-render cost to ~500 ms. Provides code patterns for template rendering, cache keys, and polling.
AI-written summary · about
chapters (24)
- 0:00Start
- 0:56What are we going to talk about?
- 3:48Implementation Issues
- 4:23Rendering custom color style sheets from a controller
- 6:44So What?
- 7:38RAILSCONF Color Functions
- 7:52Reusing style sheets
- 8:30RAILSCONF Static Context
- 9:58RAILSCONF Dynamic Context
- 12:09Injecting data from a user?
- 13:12We need our own render class for dynamic content
- 16:30There's always a load path
- 20:35Can impact the whole server
- 22:32Yup, we need caching
- 23:01Memcached
- 24:07Introduce caching into our Sass rendering
- 25:00Incorporate into SassCustomPalette
- 27:06Polling client
- 27:24Waiting on an available worker
- 27:39Setting up a Sidekiq worker
- 30:57Identified areas for code improvement
- 31:15Recap
- 31:32Web server performance
- 31:52So what does this mean?
related talks
26mRapid Templating: "Designing in the Browser" with Sass, Compass, and Serve
51mKiss My Sass
47mThe Future of Sass
57mCSS preprocessor performance
39mThe Mind-blowing Power of Sass 3.3
42mKeeping Your HTML Semantic with SASS
20mSweating the Small Stuff: Recreating Subtle Design Details Using Sass
36mWhat makes Sass so Syntactically Awesome?
