@@ -8,20 +8,20 @@ We define three sets of color token types, **reference/palette tokens**,
88** system tokens** , and ** application tokens** .
99
1010[ ** Reference or palette
11- tokens** ] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/tokens.css )
11+ tokens** ] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/tokens.css )
1212(e.g. ` --ref-palette-X ` ) are a set of base colors that get updated on [ Chrome
1313color theme change] ( ### ) and should not be directly used.
1414
1515[ ** System
16- tokens** ] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css )
16+ tokens** ] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css )
1717(e.g. ` --sys-color-X ` ) are a set of semantic tokens (use is often clear from
1818name e.g. ` --sys-color-error-container ` ). They reference palette tokens and
1919incorporate light / dark mode switches and should be used in the code directly.
2020You can view all system tokens in their light and dark variant when running the
2121component server with ` npm run components-server ` under * Theme Colors* .
2222
2323[ ** Application
24- tokens** ] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/applicationColorTokens.css )
24+ tokens** ] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/applicationColorTokens.css )
2525(e.g. ` --app-color-X ` ) reference palette tokens, and add more semantic meaning
2626and handle exception cases, where system tokens are not enough. Should be
2727defined for both light and dark modes. An example CL that adds application
@@ -51,7 +51,7 @@ Chrome's theming differentiates between two *default* color schemes (a blue
5151** default** and a ** grey default** ), and a number of ** accent** color schemes
5252(blue, purple, yellow, and so on). In DevTools, the default schemes are defined
5353as ` baseline-grayscale ` and ` baseline-default ` css classes in
54- [ themeColors.css] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css ) .
54+ [ themeColors.css] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css ) .
5555The accent color schemes don't require extra color definitions and will adapt
5656with the reference colors.
5757
@@ -317,10 +317,32 @@ example CL that adds application tokens can be found
317317### Resources
318318
319319 * [ Reference color
320- tokens] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/tokens.css )
320+ tokens] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/tokens.css )
321321 * [ System color
322- tokens] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css )
322+ tokens] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/themeColors.css )
323323 * [ Application color
324- tokens] ( https://source.chromium. org/chromium/chromium/src/+/main: third_party/devtools-frontend/src/front_end/ui/legacy/applicationColorTokens.css )
324+ tokens] ( https://crsrc. org/c/ third_party/devtools-frontend/src/front_end/ui/legacy/applicationColorTokens.css )
325325 * [ Color definitions in the CDT
326326 Figma] ( https://www.figma.com/design/A5iQBBNAe5zPFpJvUzUgW8/CDT-design-kit?node-id=337-5217&m=dev )
327+
328+ ## Sizes
329+
330+ [ ** System
331+ tokens** ] ( https://crsrc.org/c/third_party/devtools-frontend/src/front_end/ui/legacy/designTokens.css )
332+ include a set of tokens to be used for sizes, ranging from ` --sys-size-1 ` (which
333+ corresponds to a single pixel) to ` --sys-size-41 ` (which corresponds to the HD
334+ resolution width).
335+
336+ ### Usage
337+
338+ #### Negative sizes
339+
340+ Sometimes you might need to negate a size, for example to make up for some
341+ padding or margins. Use the pattern
342+
343+ ``` css
344+ calc(-1 * var(--sys-size-X));
345+ ```
346+
347+ and try to avoid other patterns (like ` calc(0px - var(...)) ` ) that have a
348+ similar effect.
0 commit comments