Menu

Mobile-First SCSS Architecture with Dart Sass in Docker
πŸ“°

Mobile-First SCSS Architecture with Dart Sass in Docker

DEV Community: sassΒ·Anton MakasinΒ·8 days ago
#ahicWiQH
#devtosass#devto#dev#scss#docker
Reading 0:00
15s threshold

Our SCSS is split into three folders and compiled by tools inside Docker, so developers do not need Sass installed on the host. The source and generated files still live on a bind-mounted project directory. Here's the setup and why it matters.

The Directory Structure

assets/scss/site/ β”œβ”€β”€ common/ ← variables, breakpoints, shared partials β”œβ”€β”€ mobile/ ← base styles and small-screen adjustments β”‚ β”œβ”€β”€ _catalog_list.scss β”‚ β”œβ”€β”€ _catalog_item.scss β”‚ β”œβ”€β”€ _account.scss β”‚ └── _main.scss └── desktop/ ← wider-screen overrides β”œβ”€β”€ _catalog_list.scss β”œβ”€β”€ _catalog_item.scss └── _main.scss

Enter fullscreen mode

Exit fullscreen mode

The mobile folder contains the base appearance. It still has a few targeted media and accessibility queries; β€œmobile-first” does not have to mean β€œno media queries.”

The desktop folder primarily contains wider-screen overrides.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.