9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.1 KiB
5.1 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-모듈식-css-modular-css | 모듈식 CSS (Modular CSS) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
모듈식 CSS (Modular CSS)
매 한 줄
"매 modular CSS = scope by component, not by selector convention". 매 BEM/SMACSS — 매 naming convention — 매 human discipline. 매 modern (2026) = 매 build-time scoping (CSS Modules, Vue/Svelte SFC, CSS-in-JS, Tailwind utility,
@scopenative).
매 핵심
매 진화
- Global (no scope) — 매 conflict 지옥.
- BEM/SMACSS — naming convention — 매 human-enforced.
- CSS Modules — build-time hash — 매 automated.
- CSS-in-JS (Emotion, styled-components) — 매 runtime + scope.
- Tailwind utility — 매 inline atomic.
- Native
@scope(Chrome 118+) — 매 browser scope. - Shadow DOM — 매 web component native scope.
매 트레이드오프
- 매 scope 강도 vs runtime cost vs DX.
- CSS Modules — 매 zero runtime, 매 build only.
- CSS-in-JS — 매 dynamic, 매 runtime cost.
- Tailwind — 매 zero CSS bundle (used 만), 매 HTML 매 noisy.
매 응용
- Design system component library.
- Multi-team monorepo (style 충돌 방지).
- SSR/streaming (critical CSS extraction).
💻 패턴
CSS Modules
/* Button.module.css */
.button { padding: 0.5rem 1rem; border-radius: 4px; }
.primary { background: #3b82f6; color: white; }
import styles from './Button.module.css';
export const Button = () =>
<button className={`${styles.button} ${styles.primary}`}>Click</button>;
// 매 빌드 후: class="Button_button__a1b2c Button_primary__d3e4f"
Native @scope (modern)
<style>
@scope (.card) {
h2 { color: #111; font-size: 1.25rem; }
/* 매 .card 내부 h2 만 — 매 outer h2 의 X */
}
</style>
<article class="card">
<h2>Title</h2> <!-- 매 styled -->
</article>
<h2>Outside</h2> <!-- 매 unstyled -->
Vue SFC scoped
<template>
<button class="btn">Click</button>
</template>
<style scoped>
.btn { padding: 0.5rem 1rem; }
/* 매 빌드: .btn[data-v-abc123] — 매 component 만 */
</style>
Svelte (auto-scoped)
<button>Click</button>
<style>
button { padding: 0.5rem 1rem; }
/* 매 빌드: button.svelte-abc123 — 매 자동 */
</style>
Tailwind utility (atomic)
<button className="px-4 py-2 rounded bg-blue-500 text-white hover:bg-blue-600">
Click
</button>
/* 매 component CSS file 의 X — 매 utility 만 */
CSS-in-JS (Emotion)
import { css } from '@emotion/react';
const buttonStyle = css`
padding: 0.5rem 1rem;
background: ${props => props.primary ? '#3b82f6' : '#fff'};
`;
<button css={buttonStyle} />
CUBE CSS (modern hybrid)
/* Composition + Utility + Block + Exception */
.card {
/* Block */
display: grid;
gap: 1rem;
}
/* Utility */
.[--flow-space\:1rem] > * + * { margin-top: 1rem; }
/* Exception (data attr) */
.card[data-variant="dense"] { gap: 0.5rem; }
Layered cascade (@layer)
@layer reset, base, components, utilities;
@layer reset { /* normalize */ }
@layer base { body { font: 16px/1.5 system-ui; } }
@layer components { .button { ... } }
@layer utilities { .text-center { text-align: center; } }
/* 매 specificity 매 layer order — 매 명확 */
매 결정 기준
| 상황 | 접근 |
|---|---|
| React/Next + zero runtime | CSS Modules |
| Vue/Svelte | SFC scoped |
| Rapid prototyping + utility | Tailwind |
| Design tokens + dynamic | CSS-in-JS (Emotion) OR vanilla-extract |
| Modern stack 매 native | @scope + @layer |
| Web Components | Shadow DOM |
| Legacy global stylesheet | BEM convention |
기본값: React = CSS Modules + Tailwind hybrid, Vue/Svelte = SFC scoped, multi-team = @layer + @scope.
🔗 Graph
- 부모: Large_Frontend_Projects
- 변형: CSS Modules · CSS_Architecture_and_Styling · CSS_Architecture_and_Styling
- 응용: Design System · Component Library
- Adjacent: BEM · Shadow DOM
🤖 LLM 활용
언제: stack 결정, BEM → CSS Modules migration, @scope 사용 가능 여부.
언제 X: 매 design taste — 매 utility 매 readable 의 결정 — 매 team preference.
❌ 안티패턴
!important매 conflict 우회: 매 scope 누락의 sign.- Global selector + tag (
div p): 매 cascade 충돌. - CSS-in-JS runtime cost 무시: 매 LCP 영향.
- BEM 끝없는 nesting (
block__el--mod__sub): 매 component 분리의 신호. - Tailwind class 50개 한 줄: 매 component 매 추출.
🧪 검증 / 중복
- Verified (MDN @scope/@layer, CSS Modules spec, web.dev, Vue/Svelte docs).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — scope strategies + @scope native |