1
0
Fork 0
firefox/docs/code-quality/lint/linters/stylelint-plugin-mozilla/rules/no-base-design-tokens.rst
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

41 lines
976 B
ReStructuredText

no-base-design-tokens
=====================
This rule checks that CSS declarations do not use `base color token variables
<https://firefox-source-docs.mozilla.org/toolkit/themes/shared/design-system/docs/README.design-tokens.stories.html#base>`_
directly. Instead, developers should reference higher-level, semantic tokens to
ensure color usage is consistent and maintainable.
Examples of incorrect code for this rule:
-----------------------------------------
.. code-block:: css
a {
color: var(--color-blue-60);
}
.. code-block:: css
.custom-button {
background-color: var(--color-gray-90);
}
Examples of correct code for this rule:
---------------------------------------
.. code-block:: css
a {
color: var(--text-color-link);
}
.. code-block:: css
:root {
--custom-button-background-color: var(--color-gray-90);
}
.custom-button {
background-color: var(--custom-button-background-color);
}