<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>component-tokens on Socle</title><link>https://socle.uncinq.dev/docs/component-tokens/</link><description>Recent content in component-tokens on Socle</description><generator>Hugo</generator><language>en</language><atom:link href="https://socle.uncinq.dev/docs/component-tokens/index.xml" rel="self" type="application/rss+xml"/><item><title>Naming</title><link>https://socle.uncinq.dev/docs/component-tokens/naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://socle.uncinq.dev/docs/component-tokens/naming/</guid><description>&lt;p&gt;Every component token follows one pattern:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;--{component}-{property}-{sub-property?}-{state?}
&lt;/code&gt;&lt;/pre&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Pattern&lt;/th&gt;
 &lt;th&gt;Example&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;--{component}&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;--btn&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;--{component}-{property}&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;--btn-padding-inline&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;--{component}-{property}-{sub-property}&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;--btn-color-text-decoration&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;--{component}-{property}-{state}&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;--btn-color-background-hover&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The property mirrors the CSS property name, so a token reads the same way as the declaration it controls. &lt;code&gt;--btn-padding-inline&lt;/code&gt; drives &lt;code&gt;padding-inline&lt;/code&gt;. Colors are the one exception, explained below.&lt;/p&gt;
&lt;h2 id="rules"&gt;Rules&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Lowercase kebab-case&lt;/strong&gt;, always.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Component name first&lt;/strong&gt;: &lt;code&gt;--btn-*&lt;/code&gt;, &lt;code&gt;--badge-*&lt;/code&gt;, &lt;code&gt;--hero-*&lt;/code&gt;. This is what makes the tokens greppable and what keeps them sorted together in the generated CSS.&lt;/p&gt;</description></item><item><title>Customizing</title><link>https://socle.uncinq.dev/docs/component-tokens/customizing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://socle.uncinq.dev/docs/component-tokens/customizing/</guid><description>&lt;h2 id="css-override"&gt;CSS override&lt;/h2&gt;
&lt;p&gt;Every token is declared in &lt;code&gt;@layer tokens&lt;/code&gt;, the lowest-priority layer in the recommended order. Re-declare any of them in your own &lt;code&gt;@layer tokens&lt;/code&gt; block after the import. Same layer, later source order wins, and no specificity escalation is needed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@&lt;span style="color:#66d9ef"&gt;import&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;@uncinq/design-tokens&amp;#39;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@&lt;span style="color:#66d9ef"&gt;import&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;@uncinq/component-tokens&amp;#39;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@&lt;span style="color:#66d9ef"&gt;layer&lt;/span&gt; &lt;span style="color:#f92672"&gt;tokens&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; :&lt;span style="color:#a6e22e"&gt;root&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --btn-color-background: &lt;span style="color:#a6e22e"&gt;var&lt;/span&gt;(&lt;span style="color:#f92672"&gt;--&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;color&lt;/span&gt;&lt;span style="color:#f92672"&gt;-&lt;/span&gt;light);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --btn-border-radius: &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --hero-height: &lt;span style="color:#ae81ff"&gt;80&lt;/span&gt;svh;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="choosing-the-right-layer-to-override"&gt;Choosing the right layer to override&lt;/h2&gt;
&lt;p&gt;This is the decision that matters, and it is easy to get wrong in a way that only shows up later.&lt;/p&gt;</description></item><item><title>Reference</title><link>https://socle.uncinq.dev/docs/component-tokens/reference/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://socle.uncinq.dev/docs/component-tokens/reference/</guid><description>&lt;p&gt;Every table below is generated at build time from &lt;code&gt;dist/tokens.json&lt;/code&gt;, which Style Dictionary produces from the same JSON sources as the CSS. Nothing here is written by hand, so a token cannot appear in the reference without existing in the package, or change value without the page changing with it.&lt;/p&gt;
&lt;p&gt;Values are shown as they ship. A token that references a semantic token shows &lt;code&gt;var(--the-semantic-token)&lt;/code&gt; rather than a resolved color or length, because that reference is what makes an override of the semantic layer propagate. See &lt;a href="../style-dictionary/"&gt;Style Dictionary&lt;/a&gt; for why the build keeps it that way.&lt;/p&gt;</description></item><item><title>DTCG format</title><link>https://socle.uncinq.dev/docs/component-tokens/dtcg/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://socle.uncinq.dev/docs/component-tokens/dtcg/</guid><description>&lt;p&gt;The &lt;a href="https://www.w3.org/community/design-tokens/"&gt;W3C Design Token Community Group (DTCG)&lt;/a&gt; defines a standard interchange format for design tokens, so they can travel between tools (Figma, code, documentation) without loss of meaning.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;@uncinq/design-tokens&lt;/code&gt; uses DTCG JSON as its source format. &lt;a href="https://styledictionary.com/"&gt;Style Dictionary v5&lt;/a&gt; transforms those JSON files into CSS custom properties — see &lt;a href="https://socle.uncinq.dev/docs/component-tokens/style-dictionary/"&gt;STYLE-DICTIONARY.md&lt;/a&gt; for the build pipeline. The DTCG spec informs the architecture (primitive → semantic → component, naming conventions, token types).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-dtcg-format"&gt;The DTCG format&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://tr.designtokens.org/format/"&gt;DTCG spec&lt;/a&gt; defines tokens as JSON objects with reserved &lt;code&gt;$&lt;/code&gt;-prefixed keys:&lt;/p&gt;</description></item><item><title>Style Dictionary</title><link>https://socle.uncinq.dev/docs/component-tokens/style-dictionary/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://socle.uncinq.dev/docs/component-tokens/style-dictionary/</guid><description>&lt;p&gt;&lt;a href="https://styledictionary.com/"&gt;Style Dictionary v5&lt;/a&gt; transforms the DTCG JSON token files into CSS custom properties.&lt;/p&gt;
&lt;h2 id="run-the-build"&gt;Run the build&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;npm run build
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Output is written to &lt;code&gt;dist/css/components/&lt;/code&gt;. One CSS file is generated per JSON source file.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;tokens/components/button.json → dist/css/components/button.css
tokens/components/badge.json → dist/css/components/badge.css
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;dist/css/index.css&lt;/code&gt; is auto-generated too, in a step that runs after Style Dictionary. It discovers the token files from disk, so adding a JSON source needs no manual edit anywhere. Each generated file declares its own &lt;code&gt;@layer tokens&lt;/code&gt;, which is why a plain &lt;code&gt;@import&lt;/code&gt; is enough and no &lt;code&gt;layer()&lt;/code&gt; qualifier is used.&lt;/p&gt;</description></item></channel></rss>