Initial commit: 79+ design patterns, LLM prompts, and assets
This commit is contained in:
commit
2b42a76d6d
112 files changed
+13652
No files matched your search
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: system/css-architecture
|
||||
title: CSS Architecture Best Practices
|
||||
description: Methodologies, file structure, naming conventions.
|
||||
tags: [system, css, architecture, bem, oocss]
|
||||
source: stripe.com, raycast.com, design-systems.dev, css-tricks.com
|
||||
---
|
||||
|
||||
# CSS Architecture
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
css/
|
||||
├── tokens/ # Design tokens
|
||||
├── base/ # Reset, typography
|
||||
├── components/ # Buttons, cards, inputs
|
||||
├── layouts/ # Grid, containers
|
||||
├── pages/ # Page-specific styles
|
||||
└── utilities/ # Helpers
|
||||
```
|
||||
|
||||
## BEM Naming
|
||||
|
||||
```css
|
||||
/* Block */
|
||||
.card { }
|
||||
|
||||
/* Element */
|
||||
.card__title { }
|
||||
.card__image { }
|
||||
|
||||
/* Modifier */
|
||||
.card--featured { }
|
||||
.card--dark { }
|
||||
```
|
||||
|
||||
## Anti-patterns
|
||||
|
||||
| ❌ Плохо | ✅ Хорошо |
|
||||
|----------|-----------|
|
||||
| `!important` | BEM specificity |
|
||||
| Hardcoded colors | CSS variables |
|
||||
| 1000+ line file | Split into modules |
|
||||
Reference in new issue
Block a user