--- id: css-conic-gradients title: "CSS Conic Gradients" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["conic-gradient", "CSS conic gradient", "repeating-conic-gradient", "pie chart CSS", "color wheel gradient"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "gradients", "conic-gradient", "background-image"] raw_sources: ["https://www.w3schools.com/css/css3_gradients_conic.asp"] applied_in: [] github_commit: "" --- # [[CSS Conic Gradients]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A conic gradient (`conic-gradient()`) rotates its color transitions around a center point (rather than radiating outward), making it the natural tool for pie charts and color wheels; it needs at least two colors and is applied through `background-image`. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Conic = rotated around a center** β€” a conic gradient is a gradient with color transitions rotated around a center point. [S1] - **At least two colors** β€” to create a conic gradient you must define at least two colors. [S1] - **Defaults** β€” the default starting angle is `0deg` and the default position is `center`; colors are spread equally if no degree is specified. [S1] - **Optional angle (`from`) and position (`at`)** β€” you can specify a starting angle with `from` and a center position with `at`. [S1] - **Pie charts** β€” combining a conic gradient with `border-radius: 50%` turns the box into a pie chart. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Equal-spread pattern** β€” `conic-gradient(color1, color2, ...)` spreads colors equally around the circle. [S1] - **Degree-stop pattern** β€” append degrees (`red 45deg`) to control where each color band sits. [S1] - **Pie-chart pattern** β€” conic gradient + `border-radius: 50%`. [S1] - **`from`/`at` pattern** β€” set starting angle and center: `conic-gradient(from 90deg, ...)`, `conic-gradient(at 60% 45%, ...)`. [S1] - **Repeating pattern** β€” `repeating-conic-gradient()` tiles a defined color sequence. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Syntax** [S1] ``` background-image: conic-gradient([from angle] [at position,] color [degree], color [degree], ...); ``` The default angle is `0deg`, the default position is `center`, and colors are spread equally if no degree is specified. **Three colors (equal spread)** [S1] ```css #grad { background-image: conic-gradient(red, yellow, green); } ``` **Five colors** [S1] ```css #grad { background-image: conic-gradient(red, yellow, green, blue, black); } ``` **Three colors with degrees** [S1] ```css #grad { background-image: conic-gradient(red 45deg, yellow 90deg, green 210deg); } ``` **Create a Pie Chart (basic)** [S1] Add `border-radius: 50%` to make the conic gradient look like a pie chart: ```css #grad { background-image: conic-gradient(red, yellow, green, blue, black); border-radius: 50%; } ``` **Create a Pie Chart with defined degrees** [S1] ```css #grad { background-image: conic-gradient(red 0deg, red 90deg, yellow 90deg, yellow 180deg, green 180deg, green 270deg, blue 270deg); border-radius: 50%; } ``` **Conic Gradient with specified starting angle (`from`)** [S1] ```css #grad { background-image: conic-gradient(from 90deg, red, yellow, green); } ``` **Conic Gradient with specified center position (`at`)** [S1] ```css #grad { background-image: conic-gradient(at 60% 45%, red, yellow, green); } ``` **Repeating a Conic Gradient (basic)** [S1] The `repeating-conic-gradient()` function is used to repeat conic gradients: ```css #grad { background-image: repeating-conic-gradient(red 10%, yellow 20%); border-radius: 50%; } ``` **Repeating Conic Gradient with color stops** [S1] ```css #grad { background-image: repeating-conic-gradient(red 0deg 10deg, yellow 10deg 20deg, blue 20deg 30deg); border-radius: 50%; } ``` **CSS Gradient Functions reference table** [S1] | Function | Purpose | |----------|---------| | `conic-gradient()` | Conic gradient around a center point | | `linear-gradient()` | Linear gradient top-to-bottom | | `radial-gradient()` | Radial gradient center-to-edges | | `repeating-conic-gradient()` | Repeated conic pattern | | `repeating-linear-gradient()` | Repeated linear pattern | | `repeating-radial-gradient()` | Repeated radial pattern | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own demonstrations (the `#grad` element showing equal-spread, degree stops, pie charts, `from`/`at`, and repeating conic gradients) serve as the applied examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Basic conic gradient (language: CSS): ```css #grad { background-image: conic-gradient(red, yellow, green); } ``` Pie chart: ```css #grad { background-image: conic-gradient(red, yellow, green, blue, black); border-radius: 50%; } ``` Repeating conic gradient: ```css #grad { background-image: repeating-conic-gradient(red 10%, yellow 20%); border-radius: 50%; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **Conic vs radial** β€” both are defined relative to a center, but a radial gradient radiates color *outward* from the center while a conic gradient rotates colors *around* the center; conic is the choice for pie charts and color wheels. [S1] - **Equal spread vs degree stops** β€” omit degrees to spread colors equally; supply degrees (`red 45deg`) to place exact bands, as required for a defined pie chart. [S1] - **Single vs repeating** β€” use `repeating-conic-gradient()` for tiled patterns such as checkerboards/spokes. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Linear Gradients]], [[CSS Radial Gradients]], [[CSS Box Shadow]] - **μ°Έμ‘° λ§₯락:** Referenced whenever a rotated color transition (pie chart, color wheel) is needed via `background-image`. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Conic Gradients β€” https://www.w3schools.com/css/css3_gradients_conic.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Conic Gradients" page (Astra wiki-curation, P-Reinforce v3.1 format).