|
| 1 | +# Municipio 6 release: Styleguide and design tokens |
| 2 | + |
| 3 | +Municipio 6 introduces a token-based Styleguide architecture. This is a foundational change that makes visual decisions more consistent, easier to maintain, and safer to customize across implementations. |
| 4 | + |
| 5 | +## Why this change was needed |
| 6 | + |
| 7 | +In previous versions, visual values were often managed through a mix of hardcoded values, Sass variables, and component-specific patterns. This made it harder to: |
| 8 | + |
| 9 | +- keep consistency between components |
| 10 | +- scale and maintain themes over time |
| 11 | +- safely customize implementations without side effects |
| 12 | +- make design decisions explicit and traceable |
| 13 | + |
| 14 | +The Municipio 6 token system solves this by making design tokens the source of truth for visual values such as color, spacing, radius, typography, and shadow. |
| 15 | + |
| 16 | +## What changed in Styleguide |
| 17 | + |
| 18 | +The Styleguide now uses a structured token flow: |
| 19 | + |
| 20 | +1. Global tokens are defined in `source/data/design-tokens.json`. |
| 21 | +2. Token Sass is generated from JSON into `source/sass/setting/_design-tokens.scss`. |
| 22 | +3. Components declare which tokens they are allowed to consume via component manifests. |
| 23 | +4. Component styles map and consume tokens through the token mixin pattern. |
| 24 | + |
| 25 | +This gives us: |
| 26 | + |
| 27 | +- centralized design decisions |
| 28 | +- predictable component-level token APIs |
| 29 | +- better runtime theming through CSS custom properties |
| 30 | +- schema validation for token usage |
| 31 | + |
| 32 | +## What developers need to do |
| 33 | + |
| 34 | +A migration is already in place in Municipio 6 for the Styleguide itself, but custom implementations and project-specific overrides may still need updates. |
| 35 | + |
| 36 | +### 1. Review custom overrides and theme code |
| 37 | + |
| 38 | +Custom CSS that targets old variables or hardcoded values may no longer behave as intended. Review and migrate to token-based overrides, for example: |
| 39 | + |
| 40 | +```css |
| 41 | +:root { |
| 42 | + --color--primary: #0052cc; |
| 43 | + --border-radius: 0.75; |
| 44 | +} |
| 45 | + |
| 46 | +.c-card--campaign { |
| 47 | + --c-card--color--surface: #111827; |
| 48 | + --c-card--border-radius: 1.5; |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +### 2. Validate custom integrations |
| 53 | + |
| 54 | +After migration updates: |
| 55 | + |
| 56 | +- verify visual output in your key templates |
| 57 | +- test custom components that previously depended on Sass internals or legacy variable names |
| 58 | + |
| 59 | +## Migration impact and compatibility |
| 60 | + |
| 61 | +- Core Styleguide components are migrated to the token architecture. |
| 62 | +- Most standard component usage should continue to work. |
| 63 | +- The highest migration risk is in project-specific customizations: |
| 64 | + - custom Sass |
| 65 | + - overrides tied to legacy naming assumptions |
| 66 | + |
| 67 | +## Recommended rollout plan |
| 68 | + |
| 69 | +1. Upgrade Styleguide and build locally. |
| 70 | +2. Audit custom components and theme overrides. |
| 71 | +3. Migrate custom styling to token APIs. |
| 72 | +4. Perform visual QA before release. |
| 73 | + |
| 74 | +## Final note |
| 75 | + |
| 76 | +Municipio 6 is not only a version upgrade. It is a move to a more durable design system contract between design and code. Teams that align custom code with token APIs will get more stable upgrades, clearer theming, and lower long-term maintenance costs. This update will serve as a foundation for the ability to add darkmode and high contrast modes on all Municipio siteas and finally complying with [EN 301 549](https://www.etsi.org/standards/get-standards#page=1&search=ETSI%20EN%20301%20549%20V3.2.1&title=1&etsiNumber=1&content=0&version=1&onApproval=1&published=1&withdrawn=1&historical=0&isCurrent=1&superseded=1&startDate=1988-01-15&endDate=2022-01-31&harmonized=0&keyword=&TB=&stdType=&frequency=&mandate=&collection=&sort=1). A simplified version is avabile in swedish here: https://www.digg.se/webbriktlinjer/alla-webbriktlinjer/respektera-anvandarens-installningar |
0 commit comments