Multi-brand Stylesheet Generation with Sass
📖 Scenario: You are working for a company that manages multiple brands. Each brand has its own colors and fonts. You want to create a single Sass stylesheet that can generate CSS for each brand easily by changing just one variable.
🎯 Goal: Create a Sass stylesheet that defines brand colors and fonts in a map, sets a variable to select the current brand, and uses Sass features to generate CSS styles for the selected brand.
📋 What You'll Learn
Create a Sass map called
$brands with three brands: brandA, brandB, and brandC.Each brand must have a
primary-color and a font-family.Create a variable called
$current-brand and set it to brandB.Use the
map-get() function to get the current brand's colors and fonts.Write CSS rules for the
body that use the current brand's primary-color as background and font-family for text.💡 Why This Matters
🌍 Real World
Companies often manage multiple brands and need a flexible way to maintain consistent styles for each brand in one stylesheet.
💼 Career
Knowing how to use Sass maps and variables to generate multi-brand stylesheets is valuable for front-end developers working in agencies or companies with multiple product lines.
Progress0 / 4 steps