Files
2nd/10_Wiki/Topics/Domain_Programming/Topic_CSS/CSS_Optimization.md
T
Antigravity Agent c24165b8bc refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 11:05:56 +09:00

5.5 KiB
Raw Blame History

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
css-optimization CSS Optimization Frontend draft conceptual
CSS performance
CSS optimization
faster CSS
CSS minification
render performance
B 0.87 2026-06-23 2026-06-23
css
web
frontend
w3schools
performance
optimization
rendering
https://www.w3schools.com/css/css_performance.asp

CSS Optimization

🎯 한 줄 통찰 (One-line insight)

Optimizing CSS makes a website load faster and run more smoothly — keep selectors simple, avoid layout-thrashing work, animate cheap properties, and serve external, minified, cached stylesheets. [S1]

🧠 핵심 개념 (Core concepts)

  • Why optimize — optimizing CSS makes your website load faster and run more smoothly, which results in a better user experience. [S1]
  • Parsing cost — complex selectors increase parsing time, so simpler selectors are faster. [S1]
  • Rendering cost — broad selectors (like the universal selector) and certain animated properties force more work during rendering. [S1]
  • Delivery cost — how CSS is loaded, combined, minified, and cached affects load time. [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Simplest-selector pattern — prefer a short selector such as .button:hover over a deeply nested one. [S1]
  • Cheap-animation pattern — animate properties that don't cause repaint/reflow (transforms, opacity, filter) instead of layout-triggering properties. [S1]
  • One-file delivery pattern — combine into a single external CSS file, minify it, and cache it with a long expiration time. [S1]

📖 세부 내용 (Details)

Optimizing CSS makes your website load faster and run more smoothly, which also results in a better user experience. The page presents nine optimization strategies. [S1]

1. Use Simple Selectors. Use simple selectors when possible; complex selectors increase the parsing time. The "bad" approach uses a deeply nested selector, while the better approach uses just .button:hover. [S1]

2. Avoid the Universal Selector. Avoid the universal selector (*) when not strictly necessary — it affects every element and can slow down page rendering. [S1]

3. Avoid Inline Styles. Avoid inline styles when not necessary; inline styles make your HTML heavier and are harder to manage. [S1]

4. Avoid @import. Avoid using @import for loading external CSS, as it delays stylesheet loading. Use the <link> tag in the <head> section instead. [S1]

5. Use Shorthand Properties. Use shorthand properties when possible — it saves space and is faster to parse. For example, use margin: 10px 20px; instead of writing each margin property individually. [S1]

margin: 10px 20px;

6. Cut Down Unnecessary Animations. A high number of animations and large animations require more processing power to handle, which degrades performance. [S1]

7. Use Properties That Don't Cause Repaint. Animation performance relies also on what properties you are animating. Properties like transforms, opacity, and filter are recommended over layout-triggering properties. [S1]

8. Combine and Minify CSS. Use one CSS file when possible, and remove spaces and comments to reduce file size. [S1]

9. Cache Your CSS. Make sure your CSS file is cached by the browser by giving it a long expiration time in your server settings. [S1]

Summary. Keep selectors short and simple; avoid layout-thrashing operations; use efficient animation techniques; and use external, minified, and cached stylesheets. [S1]

(Note: the exact "bad" vs "good" verbatim code boxes for tips 14 and 69 were not captured verbatim from the source beyond the shorthand margin example and the .button:hover reference. — Not found in source.)

🛠️ 적용 사례 (Applied in summary)

The page's applied guidance contrasts a deeply nested selector against the simpler .button:hover, and replaces individual margin declarations with the shorthand margin: 10px 20px;. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Shorthand over longhand (language: CSS):

/* Preferred — shorthand */
margin: 10px 20px;

Simple selector over a nested chain (language: CSS):

/* Preferred — short and simple */
.button:hover { /* ... */ }

⚖️ 모순 및 업데이트 (Contradictions & updates)

No contradictions found in the source.

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.87
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "CSS Optimization" page (Astra wiki-curation, P-Reinforce v3.1 format).