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>
This commit is contained in:
@@ -0,0 +1,182 @@
|
||||
---
|
||||
id: wiki-2026-0508-styletron
|
||||
title: Styletron
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Styletron CSS-in-JS]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.85
|
||||
verification_status: applied
|
||||
tags: [css-in-js, styling, frontend, react]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: typescript
|
||||
framework: react
|
||||
---
|
||||
|
||||
# Styletron
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 atomic CSS-in-JS 의 pioneer"**. Uber 가 만든 styling library — 매 declared style 을 atomic class (`.a { color: red }`) 로 deduplicate, 매 SSR-friendly. 2026 perspective: 매 historical interest — 현재 의 mainstream 은 zero-runtime (vanilla-extract, Linaria, Panda CSS) 또는 utility (Tailwind v4).
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 idea
|
||||
- 매 styled component 의 declared CSS 를 atomic single-property class 로 split.
|
||||
- 매 동일 declaration 은 한 class 의 share → 매 small bundle.
|
||||
- Runtime 의 dedupe + SSR 의 style extract.
|
||||
|
||||
### 매 Styletron 의 modern 위치
|
||||
- 매 BaseWeb (Uber UI lib) 의 default styling engine.
|
||||
- Production 사용 의 still alive 그러나 매 new project 의 default 가 아님.
|
||||
- 매 atomic 의 idea 는 Tailwind / UnoCSS 가 inherit (compile-time).
|
||||
|
||||
### 매 modern alternatives (2026)
|
||||
- **vanilla-extract**: zero-runtime, type-safe.
|
||||
- **Panda CSS**: build-time atomic.
|
||||
- **Tailwind CSS v4**: 매 utility-first mainstream.
|
||||
- **CSS Modules + plain CSS**: 매 simplest baseline.
|
||||
|
||||
### 매 응용
|
||||
1. BaseWeb component library 사용.
|
||||
2. Legacy Uber-stack codebase 유지보수.
|
||||
3. 매 historical case study (atomic CSS 의 origin).
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Setup (React)
|
||||
```typescript
|
||||
import { Provider as StyletronProvider } from "styletron-react";
|
||||
import { Client as Styletron } from "styletron-engine-atomic";
|
||||
|
||||
const engine = new Styletron();
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<StyletronProvider value={engine}>
|
||||
<Page />
|
||||
</StyletronProvider>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
### styled component
|
||||
```typescript
|
||||
import { styled } from "styletron-react";
|
||||
|
||||
const Button = styled("button", {
|
||||
backgroundColor: "blue",
|
||||
color: "white",
|
||||
padding: "8px 16px",
|
||||
borderRadius: "4px",
|
||||
});
|
||||
|
||||
// usage: <Button>Click</Button>
|
||||
```
|
||||
|
||||
### Dynamic prop-based styling
|
||||
```typescript
|
||||
const Button = styled<"button", { $primary?: boolean }>("button", ({ $primary }) => ({
|
||||
backgroundColor: $primary ? "blue" : "gray",
|
||||
color: "white",
|
||||
}));
|
||||
```
|
||||
|
||||
### useStyletron hook
|
||||
```typescript
|
||||
import { useStyletron } from "styletron-react";
|
||||
|
||||
function Card() {
|
||||
const [css] = useStyletron();
|
||||
return <div className={css({ padding: "16px", boxShadow: "0 2px 4px rgba(0,0,0,0.1)" })}>Hello</div>;
|
||||
}
|
||||
```
|
||||
|
||||
### SSR (Next.js)
|
||||
```typescript
|
||||
// pages/_document.tsx
|
||||
import Document, { Html, Head, Main, NextScript } from "next/document";
|
||||
import { Server, Sheet } from "styletron-engine-atomic";
|
||||
import { Provider } from "styletron-react";
|
||||
|
||||
export default class MyDoc extends Document {
|
||||
static async getInitialProps(ctx) {
|
||||
const engine = new Server();
|
||||
const initialProps = await Document.getInitialProps({
|
||||
...ctx,
|
||||
renderPage: () => ctx.renderPage({
|
||||
enhanceApp: (App) => (props) => (
|
||||
<Provider value={engine}><App {...props} /></Provider>
|
||||
),
|
||||
}),
|
||||
});
|
||||
return { ...initialProps, stylesheets: engine.getStylesheets() };
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<Html>
|
||||
<Head>
|
||||
{this.props.stylesheets.map((s, i) => (
|
||||
<style className="_styletron_hydrate_" dangerouslySetInnerHTML={{ __html: s.css }} key={i} />
|
||||
))}
|
||||
</Head>
|
||||
<body><Main /><NextScript /></body>
|
||||
</Html>
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Migration to vanilla-extract (modern)
|
||||
```typescript
|
||||
// styles.css.ts
|
||||
import { style } from "@vanilla-extract/css";
|
||||
export const button = style({
|
||||
backgroundColor: "blue",
|
||||
color: "white",
|
||||
padding: "8px 16px",
|
||||
});
|
||||
// Component.tsx
|
||||
import { button } from "./styles.css";
|
||||
<button className={button}>Click</button>
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 매 BaseWeb 사용 codebase | Styletron (forced) |
|
||||
| 매 new project (2026) | Tailwind v4 또는 vanilla-extract |
|
||||
| 매 type-safe + zero-runtime | vanilla-extract |
|
||||
| 매 quick prototype | Tailwind |
|
||||
| 매 library 배포 (no runtime) | Linaria / Panda CSS |
|
||||
|
||||
**기본값**: 매 new code 는 Tailwind v4 또는 vanilla-extract. 매 Styletron 신규 채택 의 X.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[CSS_Architecture_and_Styling|CSS-in-JS]]
|
||||
- 변형: [[vanilla-extract]] · [[Panda-CSS]]
|
||||
- 응용: [[BaseWeb]] · [[React]]
|
||||
- Adjacent: [[Tailwind CSS]] · [[Atomic-CSS]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: BaseWeb codebase 의 maintenance, 매 atomic CSS history 의 understand.
|
||||
**언제 X**: 매 greenfield project — modern alternatives 가 superior (zero-runtime, type-safe).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **매 new project 의 Styletron 채택**: 매 ecosystem momentum 이 vanilla-extract / Tailwind 로 이동 — 매 future-proof X.
|
||||
- **Runtime dedupe overhead**: 매 large app 에서 visible — 매 build-time atomic (Panda) 이 우월.
|
||||
- **Styletron + Tailwind 동시**: 매 conflicting paradigm — pick one.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (styletron.org, GitHub uber/styletron, Uber engineering blog 2017).
|
||||
- 신뢰도 A (매 historically), 매 modern adoption 의 declining.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — atomic CSS-in-JS + modern alternatives positioning |
|
||||
Reference in New Issue
Block a user