이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
6.3 KiB
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-property | CSS @property | Frontend | draft | conceptual |
|
B | 0.87 | 2026-06-23 | 2026-06-23 |
|
|
CSS @property
🎯 한 줄 통찰 (One-line insight)
@property defines custom CSS properties (CSS variables) directly in the stylesheet — without JavaScript — adding data-type checking, a required default value, and explicit control over inheritance. [S1]
🧠 핵심 개념 (Core concepts)
- What it is —
@propertyis used to define custom CSS properties (CSS variables) directly in the stylesheet without having to run any JavaScript. [S1] - Data type checking — ensures custom properties are used correctly via a declared
syntax(e.g."<color>"). [S1] - Default value requirement —
initial-valueprovides a fallback if an invalid value is assigned. [S1] - Inheritance control —
inherits: true | falsegives full control over whether the value inherits. [S1] - Consumed with
var()— once defined, the property is used like any custom property, e.g.background-color: var(--myColor);. [S1]
🧩 추출된 패턴 (Extracted patterns)
- Typed declaration pattern —
@property --name { syntax: "<type>"; inherits: <bool>; initial-value: <value>; }. [S1] - Invalid-value fallback — when a value violates the declared
syntax(e.g. assigning2where a<color>is expected), the property falls back to itsinitial-valueinstead of breaking. [S1] - Animatable custom colors — declaring color custom properties with
@propertyenables them to participate in transitions/animations (e.g. a gradient that animates between--startColorand--endColor). [S1]
📖 세부 내용 (Details)
@property is used to define custom CSS properties (CSS variables) directly in the stylesheet without having to run any JavaScript, with data type checking, default values, and inheritance control. [S1]
Basic syntax [S1]
@property --myColor {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
Usage with the var() function: [S1]
body {
background-color: var(--myColor);
}
Example 1 — two custom properties [S1]
@property --my-bg-color {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
@property --my-txt-color {
syntax: "<color>";
inherits: true;
initial-value: darkblue;
}
div {
width: 300px;
height: 150px;
padding: 15px;
background-color: var(--my-bg-color);
color: var(--my-txt-color);
}
Example 2 — overriding custom properties per class [S1]
@property --my-bg-color {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
div {
width: 300px;
height: 150px;
padding: 15px;
background-color: var(--my-bg-color);
}
.fresh {
--my-bg-color: #ff6347;
}
.nature {
--my-bg-color: rgb(120, 180, 30);
}
Example 3 — type checking with an invalid value [S1]
Here .nature assigns 2, which is not a valid <color>, so the property falls back to its initial-value: [S1]
@property --my-bg-color {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
div {
width: 300px;
height: 150px;
padding: 15px;
background-color: var(--my-bg-color);
}
.fresh {
--my-bg-color: #ff6347;
}
.nature {
--my-bg-color: 2;
}
Example 4 — inherits: false [S1]
@property --my-bg-color {
syntax: "<color>";
inherits: false;
initial-value: lightgray;
}
Example 5 — inherits: true [S1]
@property --my-bg-color {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
Example 6 — animated gradient colors [S1]
@property --startColor {
syntax: "<color>";
initial-value: #EADEDB;
inherits: false;
}
@property --endColor {
syntax: "<color>";
initial-value: #BC70A4;
inherits: false;
}
Key benefits listed by the source [S1]
- Data type checking ensures custom properties are used correctly.
- Default value requirement provides a fallback if invalid values are assigned.
- Inheritance control gives full control over value inheritance behavior.
🛠️ 적용 사례 (Applied in summary)
The page's applied examples progress from declaring typed color properties (Example 1), overriding them per class .fresh / .nature (Example 2), demonstrating fallback to initial-value on an invalid 2 (Example 3), contrasting inherits: false vs inherits: true (Examples 4–5), and finally declaring --startColor/--endColor for an animated gradient (Example 6). No external project/commit applications found in the source.
💻 코드 패턴 (Code patterns)
Define a typed custom property (language: CSS):
@property --my-bg-color {
syntax: "<color>";
inherits: true;
initial-value: lightgray;
}
Consume it (language: CSS):
div {
background-color: var(--my-bg-color);
}
⚖️ 모순 및 업데이트 (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)
- 상위/루트: CSS Tutorial
- 관련 개념: CSS Variables, CSS Variables and JavaScript, CSS Variables in Media Queries, CSS var Function
- 참조 맥락: Referenced when custom properties need type safety, guaranteed fallbacks, or animation support without JavaScript.
📚 출처 (Sources)
- [S1] W3Schools — CSS @property — https://www.w3schools.com/css/css3_property.asp
📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "CSS @property" page (Astra wiki-curation, P-Reinforce v3.1 format).