
Scss Best Practices
Structure and author SCSS with the 7-1 pattern, variables, mixins, and maintainable component styles as you build the UI.
Install
npx skills add https://github.com/mindrally/skills --skill scss-best-practicesWhat is this skill?
- 7-1 SCSS architecture: abstracts, base, components, layout, pages, themes, and main entry
- DRY guidance via variables, mixins, functions, and extendable placeholders
- Separation of structure, skin, and state in component styling
- Folder-level examples for buttons, cards, forms, grid, and navigation
- Readability-first rule: avoid clever abstractions that obscure intent
Adoption & trust: 967 installs on skills.sh; 133 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Frontend Designanthropics/skills
Vercel React Best Practicesvercel-labs/agent-skills
Remotion Best Practicesremotion-dev/skills
Vercel Composition Patternsvercel-labs/agent-skills
Develop Userscriptsxixu-me/skills
Next Best Practicesvercel-labs/next-skills
Journey fit
Common Questions / FAQ
Is Scss Best Practices safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Scss Best Practices
# SCSS Best Practices You are an expert in SCSS (Sassy CSS), CSS architecture, and maintainable stylesheet development. ## Key Principles - Write modular, reusable SCSS that scales with project complexity - Follow the DRY (Don't Repeat Yourself) principle using variables, mixins, and functions - Maintain clear separation between structure, skin, and state styles - Prioritize readability and maintainability over clever abstractions ## File Organization ### Architecture Pattern (7-1 Pattern) ``` scss/ ├── abstracts/ │ ├── _variables.scss # Global variables │ ├── _functions.scss # SCSS functions │ ├── _mixins.scss # Reusable mixins │ └── _placeholders.scss # Extendable placeholders ├── base/ │ ├── _reset.scss # CSS reset/normalize │ ├── _typography.scss # Typography rules │ └── _base.scss # Base element styles ├── components/ │ ├── _buttons.scss # Button components │ ├── _cards.scss # Card components │ └── _forms.scss # Form components ├── layout/ │ ├── _header.scss # Header layout │ ├── _footer.scss # Footer layout │ ├── _grid.scss # Grid system │ └── _navigation.scss # Navigation layout ├── pages/ │ ├── _home.scss # Home page specific │ └── _contact.scss # Contact page specific ├── themes/ │ └── _default.scss # Default theme ├── vendors/ │ └── _bootstrap.scss # Third-party overrides └── main.scss # Main manifest file ``` ### Import Order ```scss // main.scss @use 'abstracts/variables'; @use 'abstracts/functions'; @use 'abstracts/mixins'; @use 'abstracts/placeholders'; @use 'vendors/normalize'; @use 'base/reset'; @use 'base/typography'; @use 'base/base'; @use 'layout/grid'; @use 'layout/header'; @use 'layout/navigation'; @use 'layout/footer'; @use 'components/buttons'; @use 'components/cards'; @use 'components/forms'; @use 'pages/home'; @use 'themes/default'; ``` ## Variables ### Naming Convention ```scss // Use semantic, descriptive names // Format: $category-property-variant // Colors $color-primary: #3498db; $color-primary-light: lighten($color-primary, 15%); $color-primary-dark: darken($color-primary, 15%); $color-secondary: #2ecc71; $color-text: #333333; $color-text-muted: #666666; $color-background: #ffffff; $color-border: #e0e0e0; $color-error: #e74c3c; $color-success: #27ae60; $color-warning: #f39c12; // Typography $font-family-base: 'Helvetica Neue', Arial, sans-serif; $font-family-heading: 'Georgia', serif; $font-size-base: 1rem; $font-size-small: 0.875rem; $font-size-large: 1.25rem; $font-weight-normal: 400; $font-weight-bold: 700; $line-height-base: 1.5; // Spacing (use consistent scale) $spacing-unit: 8px; $spacing-xs: $spacing-unit * 0.5; // 4px $spacing-sm: $spacing-unit; // 8px $spacing-md: $spacing-unit * 2; // 16px $spacing-lg: $spacing-unit * 3; // 24px $spacing-xl: $spacing-unit * 4; // 32px $spacing-xxl: $spacing-unit * 6; // 48px // Breakpoints $breakpoint-sm: 576px; $breakpoint-md: 768px; $breakpoint-lg: 992px; $breakpoint-xl: 1200px; $breakpoint-xxl: 1400px; // Z-index scale $z-index-dropdown: 1000; $z-index-sticky: 1020; $z-index-fixed: 1030; $z-index-modal-backdrop: 1040; $z-index-modal: 1050; $z-index-popover: 1060; $z-index-tooltip: 1070; // Transitions $transition-base: 0.3s ease; $transition-fast: 0.15s ease; $transition-slow: 0.5s ease; // Border radius $border-radius-sm: 2px; $border-radius-md: 4px; $border-radius-lg: 8px; $border-radius-pill: 50px; $border-radius-circle: 50%; // Shadows $shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05); $shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1); $shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1); $shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15); ``` ### Maps for Related Values ```scss // Use maps for grouped values $colors: ( 'primary': #3498db, 'secondary': #2ecc71