Community코딩 & 개발github.com

mindrally/scss-best-practices

SCSS/Sassy CSS 모범 사례 및 유지보수 가능하고 확장 가능한 스타일시트를 위한 코딩 가이드라인

scss-best-practices란 무엇인가요?

이 기술(스킬)은 SCSS/Sassy CSS를 사용하여 유지보수 가능하고 확장 가능한 스타일시트를 작성하기 위한 모범 사례와 코딩 가이드라인을 제공합니다. 개발자들이 일관된 스타일을 유지하고, 중복을 줄이며, 대규모 프로젝트에서도 스타일을 효과적으로 관리할 수 있도록 돕습니다. Cursor, Claude Code, Codex 등 AI 에이전트 기반 코딩 도구와 함께 사용할 수 있으며, 가이드라인은 네이밍 규칙, 중첩 구조, 믹스인과 변수 사용법, 성능 최적화 등을 포함합니다. 이 기술은 SCSS에 대한 모범 사례를 체계적으로 정리하여 AI가 생성하는 CSS 코드의 품질을 높이고, 팀 내 협업 시 일관된 스타일을 보장합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mindrally/skills/tree/main/skills/scss-best-practices

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

scss-best-practices은(는) 무엇을 하나요?

SCSS/Sassy CSS 모범 사례 및 유지보수 가능하고 확장 가능한 스타일시트를 위한 코딩 가이드라인

개요

이 프로젝트는 SCSS(Sassy CSS)를 사용하여 깔끔하고 유지보수 가능하며 확장 가능한 스타일시트를 작성하기 위한 모범 사례와 가이드라인을 제공합니다. 이 가이드라인은 신규 프로젝트에도 적용 가능하며 기존 스타일시트를 리팩터링하는 데도 도움이 됩니다.

주요 원칙

  • 일관성(Consistency): 모든 스타일시트에서 동일한 패턴과 규칙을 사용합니다.
  • 가독성(Readability): 다른 개발자(또는 미래의 자신)가 쉽게 이해할 수 있도록 작성합니다.
  • 재사용성(Reusability): 변수, 믹스인, 플레이스홀더 선택자를 최대한 활용합니다.
  • 모듈성(Modularity): 스타일을 논리적인 단위로 분할하고 부분 파일(partials)로 구성합니다.

네이밍 규칙

  • 파일명: 소문자와 하이픈을 사용합니다 (예: _button.scss).
  • 변수: $ 접두사와 케밥-케이스(kebab-case)를 사용합니다 (예: $primary-color).
  • 믹스인: @mixin 지시어와 함께 케밥-케이스를 사용합니다 (예: @mixin flex-center).
  • 클래스: BEM(Block Element Modifier) 규칙을 권장합니다.

구조

styles/
├── abstracts/    # 변수, 함수, 믹스인
├── base/         # 리셋, 타이포그래피, 기본 스타일
├── components/   # 재사용 가능한 UI 구성 요소
├── layout/       # 전체 레이아웃 관련 스타일
├── pages/        # 페이지별 스타일
└── themes/       # 테마 관련 스타일

변수 사용

전역 변수를 과도하게 사용하지 말고, 가능한 한 지역적인 범위에서 선언하세요. 색상, 폰트 크기, 간격 등 일관된 값을 변수로 정의하여 유지보수를 용이하게 합니다.

// 좋은 예
$primary-color: #3498db;
$font-size-base: 16px;
$spacing-unit: 8px;

// 피해야 할 예
$color1: #333;
$font1: 14px;

믹스인과 함수

복잡한 CSS 패턴이나 브라우저별 속성은 믹스인으로 추상화하세요. 함수는 계산이 필요한 경우에만 사용합니다.

@mixin respond($breakpoint) {
  @if $breakpoint == 'mobile' {
    @media (max-width: 768px) { @content; }
  }
}

성능

  • 선택자 중첩을 3단계 이하로 유지하세요.
  • @extend는 플레이스홀더 선택자와 함께 사용할 때만 활용하세요.
  • 속성 축약형(shorthand)을 적극 사용하세요.
  • 불필요한 리스트와 맵 생성은 피하세요.

문서 및 참고

이 가이드라인은 SCSS의 공식 문서와 커뮤니티에서 권장하는 모범 사례를 기반으로 합니다. 프로젝트별 요구사항에 따라 유연하게 적용하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mindrally/accessibility-a11y

Implement web accessibility (a11y) best practices following WCAG guidelines to create inclusive, accessible user interfaces.

mindrally/chrome-extension-development

Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices. Use when building browser extensions, creating popup UIs, implementing content scripts, working with Chrome APIs, managing extension permissions, or publishing to Chrome Web Store.

mindrally/computer-vision-opencv

Expert guidance for computer vision development using OpenCV, PyTorch, and modern deep learning techniques for image and video processing.

mindrally/data-analysis-jupyter

Expert guidance for data analysis, visualization, and Jupyter Notebook development with pandas, matplotlib, seaborn, and numpy.

mindrally/deep-learning-pytorch

Expert guidance for deep learning, transformers, diffusion models, and LLM development with PyTorch, Transformers, Diffusers, and Gradio.

mindrally/expo-react-native-typescript

Expert in Expo React Native TypeScript mobile development with best practices

mindrally/fastapi-python

Expert in FastAPI Python development with best practices for APIs and async operations

mindrally/framer-motion

Expert guidelines for building performant animations with Framer Motion/Motion library in React applications

mindrally/htmx

HTMX development guidelines for building dynamic web applications with minimal JavaScript using HTML attributes.

mindrally/jwt-security

Guidelines for implementing JWT authentication with security best practices for token creation, validation, and storage

mindrally/machine-learning

Machine learning development with JAX, functional programming patterns, and high-performance computing.

mindrally/mysql-best-practices

MySQL development best practices for schema design, query optimization, and database administration

mindrally/nextjs-react-typescript

Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind

mindrally/nextjs-typescript-tailwindcss-supabase

Full-stack Next.js 14 development with TypeScript, TailwindCSS, and Supabase for building production-ready web applications.

mindrally/odoo-development

Expert guidance for Odoo ERP development including Python ORM, XML views, and module architecture

mindrally/puppeteer-automation

Expert guidance for browser automation using Puppeteer with best practices for web scraping, testing, screenshot capture, and JavaScript execution in headless Chrome.

mindrally/redis-best-practices

Redis development best practices for caching, data structures, and high-performance key-value operations

mindrally/scrapy-web-scraping

Expert guidance for building web scrapers and crawlers using the Scrapy Python framework with best practices for spider development, data extraction, and pipeline management.

mindrally/typeorm

Guidelines for developing with TypeORM, a full-featured ORM for TypeScript and JavaScript supporting multiple databases

mindrally/web-scraping

Expert in web scraping and data extraction with Python tools

관련 스킬