Skip to content

35 ‐ Rules about tokens, themes, components and modules

Pierre-Yves Lapersonne edited this page Jan 9, 2025 · 2 revisions

1 - Rules for raw tokens

  1. Raw tokens are frozen and cannot be changed
  2. Raw tokens can be shared between themes
  3. Raw tokens can be exclusive to some themes
  4. Raw tokens can be generated by the tokenator
  5. Raw tokens can be defined without tokenator
  6. Raw tokens are defined with raw and primitive values

2. Rules for semantic tokens

  1. Semantic tokens can be overriden by themes
  2. Semantic tokens can not be overridable by themes, i.e. frozen values
  3. Semantic tokens can be shared between themes
  4. Semantic tokens can be generated by the tokenator
  5. Semantic tokens can be defined without tokenator
  6. Semantic tokens can not be created (but technicaly possible if context outside OUDS Swift Package)
  7. Semantic tokens can be defined with raw tokens
  8. Semantic tokens can be defined with semantic tokens

3. Rules for component tokens

  1. Component tokens can be overriden by themes
  2. Component tokens can be shared between themes
  3. Component tokens can be generated by the tokenator
  4. Component tokens can be defined without tokenator
  5. Component tokens can not be created (but technicaly possible if context outside OUDS Swift Package)
  6. Component tokens can be defined with raw tokens
  7. Component tokens can be defined with semantic tokens

4. Rules for themes

  1. A theme does not need to create its raw tokens to exist
  2. A theme can define its raw tokens and use them
  3. A theme can override some semantic tokens with shared raw tokens
  4. A theme can override some semantic tokens with exclusive / internal raw tokens
  5. A theme can override some semantic tokens with semantic tokens
  6. A theme can be overridable to make subtheme
  7. A theme can be not overridable to prevent to have subthemes
  8. A theme can be defined outside OUDS Swift Package, open source or not