@canonical/design-system 0.2.4 → 0.43.0-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +166 -0
- package/README.md +255 -14
- package/data/apps/component/file_tree.ttl +2 -0
- package/data/apps/component/key_value_pair.ttl +2 -0
- package/data/apps/component/navigation.ttl +2 -0
- package/data/apps/component/notification.ttl +2 -0
- package/data/apps/component/side_navigation.ttl +2 -0
- package/data/apps/component/skeleton_loading.ttl +2 -0
- package/data/apps/component/status_bar.ttl +2 -0
- package/data/apps/component/toolbar.ttl +2 -0
- package/data/apps/group/key_value_pairs.ttl +2 -0
- package/data/apps/group/notifications.ttl +2 -0
- package/data/apps/layout/application_layout.ttl +2 -0
- package/data/apps/layout/content_layout.ttl +2 -0
- package/data/apps/layout/empty_layout.ttl +2 -0
- package/data/apps/layout/empty_state.ttl +13 -0
- package/data/apps/layout/list_page_layout.ttl +2 -0
- package/data/apps/layout/settings_page_layout.ttl +2 -0
- package/data/apps/layout/view_layout.ttl +2 -0
- package/data/apps/pattern/action_bar.ttl +4 -2
- package/data/apps/pattern/code_diff.ttl +2 -0
- package/data/apps/pattern/{data_table.ttl → datatable.ttl} +27 -25
- package/data/apps/pattern/destructive_modal.ttl +2 -0
- package/data/apps/pattern/drawer.ttl +2 -0
- package/data/apps/pattern/keyboard_shortcuts.ttl +2 -0
- package/data/apps/pattern/notification_center.ttl +4 -2
- package/data/apps/pattern/side_panel.ttl +39 -4
- package/data/apps/pattern/sidepanel_stacked.ttl +2 -0
- package/data/apps/subcomponent/data_table-action_bar.ttl +7 -5
- package/data/apps/subcomponent/data_table-body_cell.ttl +27 -25
- package/data/apps/subcomponent/data_table-group_header_row.ttl +10 -8
- package/data/apps/subcomponent/data_table-header_cell.ttl +13 -11
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +11 -9
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +12 -10
- package/data/apps/subcomponent/data_table-settings_menu.ttl +17 -15
- package/data/apps/subcomponent/drawer-content.ttl +2 -0
- package/data/apps/subcomponent/drawer-footer.ttl +2 -0
- package/data/apps/subcomponent/drawer-header.ttl +2 -0
- package/data/apps/subcomponent/file_tree-node.ttl +2 -0
- package/data/apps/subcomponent/log.ttl +2 -0
- package/data/apps/subcomponent/side_panel-content.ttl +3 -1
- package/data/apps/subcomponent/side_panel-footer.ttl +3 -1
- package/data/apps/subcomponent/side_panel-header.ttl +3 -1
- package/data/apps.ttl +2 -0
- package/data/apps_anbox/component/theme_switcher.ttl +2 -0
- package/data/apps_anbox/pattern/side_menu.ttl +2 -0
- package/data/apps_anbox.ttl +2 -0
- package/data/apps_debcrafters/component/deb_package_card.ttl +12 -0
- package/data/apps_debcrafters/component/example.ttl +2 -0
- package/data/apps_debcrafters/component/my_fancy_component.ttl +2 -0
- package/data/apps_debcrafters.ttl +2 -0
- package/data/apps_juju/pattern/single_select_multi_layered.ttl +2 -0
- package/data/apps_juju.ttl +2 -0
- package/data/apps_landscape/component/checkbox_group.ttl +110 -0
- package/data/apps_landscape/component/code_editor.ttl +134 -0
- package/data/apps_landscape/component/cron_schedule.ttl +40 -0
- package/data/apps_landscape/component/expandable_radio_group.ttl +106 -0
- package/data/apps_landscape/component/expandable_truncation.ttl +50 -0
- package/data/apps_landscape/component/form_section.ttl +33 -0
- package/data/apps_landscape/component/gpg_key_field.ttl +86 -0
- package/data/apps_landscape/component/grouped_select.ttl +137 -0
- package/data/apps_landscape/component/loading_state.ttl +30 -0
- package/data/apps_landscape/component/managed_file_input.ttl +75 -0
- package/data/apps_landscape/component/multi_select_field.ttl +323 -0
- package/data/apps_landscape/component/pass_rate_filter.ttl +13 -0
- package/data/apps_landscape/component/password_constraints.ttl +3 -0
- package/data/apps_landscape/component/progress_bar.ttl +100 -0
- package/data/apps_landscape/component/read_only_field.ttl +46 -0
- package/data/apps_landscape/component/search_help_popup.ttl +51 -0
- package/data/apps_landscape/component/search_query_editor.ttl +149 -0
- package/data/apps_landscape/component/tag_multi_select.ttl +52 -0
- package/data/apps_landscape/pattern/content_blocks.ttl +70 -0
- package/data/apps_landscape/pattern/dashboard_page_composition.ttl +110 -0
- package/data/apps_landscape/pattern/delivery_scheduling.ttl +24 -0
- package/data/apps_landscape/pattern/form_field_help.ttl +67 -0
- package/data/apps_landscape/pattern/header_search_controls.ttl +106 -0
- package/data/apps_landscape/pattern/ignorable_notification.ttl +60 -0
- package/data/apps_landscape/pattern/information_grid.ttl +93 -0
- package/data/apps_landscape/pattern/instance_association.ttl +29 -0
- package/data/apps_landscape/pattern/process_flow.ttl +52 -0
- package/data/apps_landscape/pattern/progressively_expandable_table.ttl +158 -0
- package/data/apps_landscape/pattern/recurring_schedule.ttl +21 -0
- package/data/apps_landscape/pattern/responsive_action_group.ttl +77 -0
- package/data/apps_landscape/pattern/responsive_header_actions.ttl +83 -0
- package/data/apps_landscape/pattern/responsive_table_filters.ttl +61 -0
- package/data/apps_landscape/pattern/side_panel_form_actions.ttl +126 -0
- package/data/apps_landscape/pattern/sortable_list.ttl +50 -0
- package/data/apps_landscape/pattern/table_filter.ttl +201 -0
- package/data/apps_landscape/pattern/table_filter_chips.ttl +174 -0
- package/data/apps_landscape/pattern/table_pagination.ttl +220 -0
- package/data/apps_landscape/pattern/typed_confirmation_modal.ttl +88 -0
- package/data/apps_landscape/subcomponent/bold_substring.ttl +30 -0
- package/data/apps_landscape/subcomponent/inline_cell_input.ttl +36 -0
- package/data/apps_landscape/subcomponent/label_with_description.ttl +46 -0
- package/data/apps_landscape/subcomponent/nested_dropdown_item.ttl +61 -0
- package/data/apps_landscape/subcomponent/pluralized_bold_count.ttl +36 -0
- package/data/apps_landscape/subcomponent/select_all_results_prompt.ttl +56 -0
- package/data/apps_landscape.ttl +2 -0
- package/data/apps_launchpad/component/accordion.ttl +12 -0
- package/data/apps_launchpad/component/avatar.ttl +4 -2
- package/data/apps_launchpad/component/badge.ttl +4 -2
- package/data/apps_launchpad/component/breadcrumbs.ttl +2 -0
- package/data/apps_launchpad/component/button.ttl +4 -2
- package/data/apps_launchpad/component/checkbox_input.ttl +6 -4
- package/data/apps_launchpad/component/chip.ttl +2 -0
- package/data/apps_launchpad/component/combobox.ttl +4 -2
- package/data/apps_launchpad/component/description_list.ttl +2 -0
- package/data/apps_launchpad/component/drawer.ttl +6 -4
- package/data/apps_launchpad/component/link.ttl +12 -0
- package/data/apps_launchpad/component/log.ttl +2 -0
- package/data/apps_launchpad/component/markdown_editor.ttl +12 -0
- package/data/apps_launchpad/component/modal.ttl +7 -5
- package/data/apps_launchpad/component/pagination.ttl +12 -0
- package/data/apps_launchpad/component/popover.ttl +12 -0
- package/data/apps_launchpad/component/radio_input.ttl +6 -4
- package/data/apps_launchpad/component/relative_timestamp.ttl +12 -0
- package/data/apps_launchpad/component/select_input.ttl +2 -0
- package/data/apps_launchpad/component/spinner.ttl +12 -0
- package/data/apps_launchpad/component/switch.ttl +6 -4
- package/data/apps_launchpad/component/table.ttl +12 -0
- package/data/apps_launchpad/component/text_input.ttl +9 -7
- package/data/apps_launchpad/component/textarea_input.ttl +10 -8
- package/data/apps_launchpad/component/timestamp.ttl +12 -0
- package/data/apps_launchpad/component/tooltip.ttl +4 -2
- package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-group.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-helper.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-loading.ttl +4 -2
- package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-search.ttl +6 -4
- package/data/apps_launchpad/subcomponent/description_list-item.ttl +2 -0
- package/data/apps_launchpad/subcomponent/log-line.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-body.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-header.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content.ttl +4 -2
- package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content.ttl +2 -0
- package/data/apps_launchpad.ttl +2 -0
- package/data/apps_lxd/component/back_link.ttl +2 -0
- package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +2 -0
- package/data/apps_lxd/component/confirmation_checkbox.ttl +2 -0
- package/data/apps_lxd/component/doc_link.ttl +4 -2
- package/data/apps_lxd/component/meter.ttl +6 -4
- package/data/apps_lxd/component/output_field.ttl +2 -0
- package/data/apps_lxd/component/rename_header.ttl +17 -15
- package/data/apps_lxd/component/tab_links.ttl +6 -4
- package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +2 -0
- package/data/apps_lxd/view/network_topology.ttl +2 -0
- package/data/apps_lxd.ttl +2 -0
- package/data/apps_notary.ttl +2 -0
- package/data/apps_portal/component/badge.ttl +2 -0
- package/data/apps_portal/component/credit_card_input.ttl +2 -0
- package/data/apps_portal/component/key_value_pair.ttl +2 -0
- package/data/apps_portal/layout/details_view.ttl +18 -0
- package/data/apps_portal/pattern/purchase_summary.ttl +2 -0
- package/data/apps_portal/subcomponent/read_only_modal.ttl +2 -0
- package/data/apps_portal.ttl +2 -0
- package/data/apps_support/component/data_spotlight.ttl +12 -0
- package/data/apps_support/subcomponent/ai_prompt_input.ttl +12 -0
- package/data/apps_support.ttl +6 -0
- package/data/apps_workplaceengineering/component/complex_multi_select.ttl +13 -0
- package/data/apps_workplaceengineering/component/label-highlight.ttl +3 -1
- package/data/apps_workplaceengineering/component/rule.ttl +2 -0
- package/data/apps_workplaceengineering/component/skip_link.ttl +2 -0
- package/data/apps_workplaceengineering/component/theme_switcher.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/confirmation_modal.ttl +12 -0
- package/data/apps_workplaceengineering/pattern/event_timeline.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/group_card.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +2 -0
- package/data/apps_workplaceengineering/subcomponent/multi_select_input.ttl +12 -0
- package/data/apps_workplaceengineering.ttl +2 -0
- package/data/concept/Foundations-Baseline.ttl +11 -0
- package/data/concept/Foundations-Density--the-form-channel.ttl +11 -0
- package/data/concept/Foundations-Grid--Layout.ttl +11 -0
- package/data/concept/Foundations-Spacing/-Element-vs-container-owned.ttl +11 -0
- package/data/concept/Foundations-Spacing.ttl +11 -0
- package/data/concept/Foundations-Surfaces.ttl +11 -0
- package/data/concept/Foundations-Typography.ttl +11 -0
- package/data/concept/{How-to-differentiate-components-variantsinheritance.ttl → How-to-differentiate-types-of-UI-blocks-.ttl} +5 -3
- package/data/concept/How-to-indicate-required-fields-in-forms.ttl +11 -0
- package/data/concept/How-to-support-modifiers-in-a-component.ttl +11 -0
- package/data/concept/Intentional-friction.ttl +11 -0
- package/data/concept/Question-mark-vs-information-icon.ttl +3 -1
- package/data/concept/Understanding-the-modifier-contract.ttl +11 -0
- package/data/concepttype/Explanation.ttl +2 -0
- package/data/concepttype/How-to-guide.ttl +2 -0
- package/data/concepttype/Reference.ttl +2 -0
- package/data/concepttype/Tutorial.ttl +2 -0
- package/data/documentation/layout/documentation_layout.ttl +2 -0
- package/data/documentation/pattern/library_side_navigation.ttl +3 -1
- package/data/documentation.ttl +2 -0
- package/data/global/component/accordion.ttl +180 -1
- package/data/global/component/announcement.ttl +13 -2
- package/data/global/component/avatar.ttl +2 -0
- package/data/global/component/badge.ttl +4 -2
- package/data/global/component/breadcrumbs.ttl +77 -2
- package/data/global/component/button.ttl +197 -2
- package/data/global/component/button_link.ttl +2 -0
- package/data/global/component/card.ttl +150 -3
- package/data/global/component/checkbox_field.ttl +269 -2
- package/data/global/component/chip.ttl +3 -1
- package/data/global/component/choices_field.ttl +373 -2
- package/data/global/component/code_snippet-content.ttl +3 -1
- package/data/global/component/code_snippet-header.ttl +21 -2
- package/data/global/component/code_snippet.ttl +28 -1
- package/data/global/component/color_field.ttl +2 -0
- package/data/global/component/combobox_field.ttl +470 -3
- package/data/global/component/contextual_menu.ttl +2 -0
- package/data/global/component/data_tooltip.ttl +149 -2
- package/data/global/component/date_field.ttl +158 -3
- package/data/global/component/date_time_field.ttl +157 -2
- package/data/global/component/drag_and_drop_list.ttl +13 -0
- package/data/global/component/dropdown_button.ttl +2 -0
- package/data/global/component/file_upload_field.ttl +230 -3
- package/data/global/component/heading.ttl +62 -3
- package/data/global/component/hidden_field.ttl +3 -1
- package/data/global/component/icon.ttl +3 -1
- package/data/global/component/icon_in_container.ttl +2 -0
- package/data/global/component/inline_code.ttl +2 -0
- package/data/global/component/keyboard_key.ttl +77 -2
- package/data/global/component/markdown_field.ttl +2 -0
- package/data/global/component/mode_switcher.ttl +2 -0
- package/data/global/component/month_field.ttl +2 -0
- package/data/global/component/notification_inline.ttl +2 -0
- package/data/global/component/notification_toast.ttl +2 -0
- package/data/global/component/number_field.ttl +2 -0
- package/data/global/component/pagination.ttl +2 -0
- package/data/global/component/password_field.ttl +189 -2
- package/data/global/component/phone_field.ttl +173 -2
- package/data/global/component/popover.ttl +2 -0
- package/data/global/component/range_field.ttl +165 -2
- package/data/global/component/rating_field.ttl +2 -0
- package/data/global/component/relative_timestamp.ttl +2 -0
- package/data/global/component/rich_choices_field.ttl +205 -2
- package/data/global/component/rich_text_field.ttl +2 -0
- package/data/global/component/search_field.ttl +2 -0
- package/data/global/component/segmented_control_field.ttl +2 -0
- package/data/global/component/select_field.ttl +158 -3
- package/data/global/component/switch_field.ttl +190 -3
- package/data/global/component/table.ttl +4 -2
- package/data/global/component/tabs.ttl +13 -2
- package/data/global/component/tag.ttl +13 -2
- package/data/global/component/text_field.ttl +173 -2
- package/data/global/component/textarea_field.ttl +157 -2
- package/data/global/component/tile.ttl +108 -1
- package/data/global/component/time_field.ttl +157 -2
- package/data/global/component/timestamp.ttl +2 -0
- package/data/global/component/tooltip.ttl +166 -43
- package/data/global/component/tooltip_wrapper.ttl +61 -2
- package/data/global/group/buttons.ttl +2 -0
- package/data/global/group/cards.ttl +2 -0
- package/data/global/group/code_snippets.ttl +2 -0
- package/data/global/group/keyboard_keys.ttl +101 -2
- package/data/global/group/tiles.ttl +2 -0
- package/data/global/layout/error_layout.ttl +2 -0
- package/data/global/layout/form_layout.ttl +2 -0
- package/data/global/layout/identity_page_form.ttl +2 -0
- package/data/global/modifier/alpha.ttl +2 -0
- package/data/global/modifier/beta.ttl +2 -0
- package/data/global/modifier/caution.ttl +2 -0
- package/data/global/modifier/comfortable.ttl +2 -0
- package/data/global/modifier/completed.ttl +2 -0
- package/data/global/modifier/constructive.ttl +2 -0
- package/data/global/modifier/dark.ttl +2 -0
- package/data/global/modifier/dense.ttl +2 -0
- package/data/global/modifier/destructive.ttl +2 -0
- package/data/global/modifier/editable.ttl +2 -0
- package/data/global/modifier/elevated.ttl +2 -0
- package/data/global/modifier/error.ttl +2 -0
- package/data/global/modifier/experimental.ttl +2 -0
- package/data/global/modifier/failed.ttl +2 -0
- package/data/global/modifier/focused.ttl +2 -0
- package/data/global/modifier/highlighted.ttl +2 -0
- package/data/global/modifier/in_progress.ttl +2 -0
- package/data/global/modifier/information.ttl +2 -0
- package/data/global/modifier/light.ttl +2 -0
- package/data/global/modifier/loading.ttl +2 -0
- package/data/global/modifier/modal.ttl +2 -0
- package/data/global/modifier/muted.ttl +2 -0
- package/data/global/modifier/planned.ttl +2 -0
- package/data/global/modifier/primary.ttl +2 -0
- package/data/global/modifier/secondary.ttl +2 -0
- package/data/global/modifier/stable.ttl +2 -0
- package/data/global/modifier/success.ttl +2 -0
- package/data/global/modifier/surface1.ttl +2 -0
- package/data/global/modifier/surface2.ttl +2 -0
- package/data/global/modifier/surface3.ttl +2 -0
- package/data/global/modifier/tertiary.ttl +2 -0
- package/data/global/modifier/warning.ttl +2 -0
- package/data/global/modifier/wireframe.ttl +2 -0
- package/data/global/modifier_family/_color_luminosity.ttl +2 -0
- package/data/global/modifier_family/_emphasis.ttl +2 -0
- package/data/global/modifier_family/_other.ttl +2 -0
- package/data/global/modifier_family/anticipation.ttl +2 -0
- package/data/global/modifier_family/criticality.ttl +2 -0
- package/data/global/modifier_family/density.ttl +2 -0
- package/data/global/modifier_family/importance.ttl +2 -0
- package/data/global/modifier_family/lifecycle.ttl +2 -0
- package/data/global/modifier_family/mode.ttl +2 -0
- package/data/global/modifier_family/release.ttl +2 -0
- package/data/global/modifier_family/surface.ttl +2 -0
- package/data/global/pattern/description_list.ttl +2 -0
- package/data/global/pattern/field.ttl +2 -0
- package/data/global/pattern/form.ttl +2 -0
- package/data/global/pattern/form_login.ttl +2 -0
- package/data/global/pattern/info_table.ttl +2 -0
- package/data/global/pattern/modal.ttl +431 -4
- package/data/global/pattern/navigation.ttl +2 -0
- package/data/global/pattern/stepper.ttl +2 -0
- package/data/global/pattern/table_of_contents.ttl +85 -2
- package/data/global/pattern/timeline.ttl +48 -13
- package/data/global/subcomponent/accordion-item.ttl +157 -2
- package/data/global/subcomponent/breadcrumbs-item.ttl +69 -2
- package/data/global/subcomponent/card-content.ttl +53 -2
- package/data/global/subcomponent/card-footer.ttl +2 -0
- package/data/global/subcomponent/card-header.ttl +45 -2
- package/data/global/subcomponent/card-image.ttl +13 -2
- package/data/global/subcomponent/card-thumbnail.ttl +37 -2
- package/data/global/subcomponent/chart_legend.ttl +93 -2
- package/data/global/subcomponent/chart_legend_item.ttl +77 -2
- package/data/global/subcomponent/checkbox_input.ttl +165 -2
- package/data/global/subcomponent/color_input.ttl +2 -0
- package/data/global/subcomponent/combobox_input.ttl +398 -3
- package/data/global/subcomponent/date_input.ttl +85 -2
- package/data/global/subcomponent/date_time_input.ttl +85 -2
- package/data/global/subcomponent/field-description.ttl +13 -2
- package/data/global/subcomponent/field-error.ttl +29 -0
- package/data/global/subcomponent/field-label.ttl +37 -2
- package/data/global/subcomponent/file_upload_input.ttl +158 -3
- package/data/global/subcomponent/hidden_input.ttl +3 -1
- package/data/global/subcomponent/kvp_container.ttl +77 -2
- package/data/global/subcomponent/kvpitem_base.ttl +69 -2
- package/data/global/subcomponent/markdown_input.ttl +2 -0
- package/data/global/subcomponent/modal-content.ttl +38 -2
- package/data/global/subcomponent/modal-footer.ttl +262 -2
- package/data/global/subcomponent/modal-header.ttl +294 -2
- package/data/global/subcomponent/month_input.ttl +2 -0
- package/data/global/subcomponent/number_input.ttl +2 -0
- package/data/global/subcomponent/password_input.ttl +117 -2
- package/data/global/subcomponent/phone_input.ttl +101 -2
- package/data/global/subcomponent/radio_input.ttl +94 -3
- package/data/global/subcomponent/range_input.ttl +85 -2
- package/data/global/subcomponent/rating_input.ttl +2 -0
- package/data/global/subcomponent/rich_text_input.ttl +2 -0
- package/data/global/subcomponent/search_input.ttl +5 -3
- package/data/global/subcomponent/segmented_control_input.ttl +2 -0
- package/data/global/subcomponent/select_input.ttl +86 -3
- package/data/global/subcomponent/spin_button.ttl +2 -0
- package/data/global/subcomponent/spinner.ttl +3 -1
- package/data/global/subcomponent/switch_input.ttl +86 -3
- package/data/global/subcomponent/table-cell.ttl +2 -0
- package/data/global/subcomponent/table-row.ttl +2 -0
- package/data/global/subcomponent/text_input.ttl +101 -2
- package/data/global/subcomponent/textarea_input.ttl +85 -2
- package/data/global/subcomponent/tile-content.ttl +45 -2
- package/data/global/subcomponent/tile-header.ttl +45 -2
- package/data/global/subcomponent/time_input.ttl +85 -2
- package/data/global/subcomponent/timeline-content.ttl +37 -2
- package/data/global/subcomponent/timeline-event.ttl +42 -7
- package/data/global/subcomponent/timeline-expansion_indicator.ttl +3 -1
- package/data/global/subcomponent/timeline-header.ttl +3 -1
- package/data/global/variant/tooltip_dense.ttl +2 -0
- package/data/global/view/settings_view.ttl +2 -0
- package/data/global.ttl +2 -0
- package/data/sites/component/blog_card.ttl +2 -0
- package/data/sites/component/quote.ttl +2 -0
- package/data/sites/component/rule.ttl +2 -0
- package/data/sites/component/section.ttl +2 -0
- package/data/sites/group/blog_cards.ttl +2 -0
- package/data/sites/group/xblog_elements.ttl +2 -0
- package/data/sites/layout/blog_page_layout.ttl +2 -0
- package/data/sites/layout/case_study_layout.ttl +2 -0
- package/data/sites/layout/site_layout.ttl +2 -0
- package/data/sites/pattern/hero-github.ttl +2 -0
- package/data/sites/pattern/hero.ttl +2 -0
- package/data/sites/pattern/info_table.ttl +2 -0
- package/data/sites/pattern/pricing_section.ttl +2 -0
- package/data/sites/pattern/pricing_table.ttl +2 -0
- package/data/sites/pattern/read_more_section.ttl +2 -0
- package/data/sites/pattern/skip_link.ttl +2 -0
- package/data/sites.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/blog_cards.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/ctablock.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/list.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/tabs.ttl +2 -0
- package/data/sites_webcomponentsprototype/layout/site_layout.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/hero.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +2 -0
- package/data/sites_webcomponentsprototype.ttl +2 -0
- package/data/stores.ttl +2 -0
- package/data/tag/allgood.ttl +2 -0
- package/data/tag/beta.ttl +2 -0
- package/data/tag/candidate.ttl +2 -0
- package/data/tag/devbatch1.ttl +2 -0
- package/data/tag/devbatch2.ttl +2 -0
- package/data/tag/devbatch3.ttl +9 -0
- package/data/tag/devexternal.ttl +2 -0
- package/data/tag/devreactapproved.ttl +2 -0
- package/data/tag/devreactbase.ttl +2 -0
- package/data/tag/devreactpreapproved.ttl +2 -0
- package/data/tag/devspecial.ttl +2 -0
- package/data/tag/devsveltedone.ttl +2 -0
- package/data/tag/devsveltein-progress.ttl +2 -0
- package/data/tag/divergent.ttl +2 -0
- package/data/tag/docscomplete.ttl +2 -0
- package/data/tag/draft.ttl +2 -0
- package/data/tag/edge.ttl +2 -0
- package/data/tag/global-docs-missing.ttl +2 -0
- package/data/tag/has-no-global-entry.ttl +2 -0
- package/data/tag/lpto-be-upstreamed.ttl +2 -0
- package/data/tag/lptriageblocked-reqs-design.ttl +2 -0
- package/data/tag/lptriageno-upstream.ttl +2 -0
- package/data/tag/lptriagereimplement-and-deprecate.ttl +2 -0
- package/data/tag/lptriagereimplement-and-keep.ttl +2 -0
- package/data/tag/lptriageupstream-and-deprecate.ttl +2 -0
- package/data/tag/minimal.ttl +2 -0
- package/data/tag/needsdefinition.ttl +2 -0
- package/data/tag/needsdiscussion.ttl +2 -0
- package/data/tag/needsdocumentation.ttl +2 -0
- package/data/tag/needsreview.ttl +2 -0
- package/data/tag/needstriage.ttl +2 -0
- package/data/tag/needsupdate.ttl +2 -0
- package/data/tag/notstarted.ttl +2 -0
- package/data/tag/specialadoption-docs.ttl +2 -0
- package/data/tag/stable.ttl +2 -0
- package/data/tag/stylesready.ttl +2 -0
- package/data/tag/triagedbacklog.ttl +2 -0
- package/data/tag/triagedrejected.ttl +2 -0
- package/data/tag/upstream-candidate.ttl +2 -0
- package/data/tag/upstream-compliant.ttl +2 -0
- package/data/tag/upstreamcandidate.ttl +2 -0
- package/data/tag/waiting-for-delta-review.ttl +2 -0
- package/data/tag/wpeinital-implementation.ttl +2 -0
- package/data/tag/wpetriageupstream-and-deprecate.ttl +2 -0
- package/data/tagcategory/channel.ttl +2 -0
- package/data/tagcategory/concept-status.ttl +2 -0
- package/data/tagcategory/concept-type.ttl +2 -0
- package/data/tagcategory/documentation-stage.ttl +2 -0
- package/data/tagcategory/implementation-status.ttl +2 -0
- package/data/tagcategory/lpupstream.ttl +2 -0
- package/data/tagcategory/review-status.ttl +2 -0
- package/data/tagcategory/tmp.ttl +2 -0
- package/definitions/ontology.ttl +78 -1
- package/package.json +34 -8
- package/skills/adoption-a1-styles/SKILL.md +24 -0
- package/skills/adoption-a2-components/SKILL.md +22 -6
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +1397 -327
- package/skills/anatomy-author/SKILL.md +840 -137
- package/skills/design-auditor/SKILL.md +133 -9
- package/skills/implement-component/SKILL.md +192 -23
- package/skills/specify-component/SKILL.md +124 -12
- package/skills/specify-pattern/SKILL.md +47 -8
- package/src/collect/generateTurtle.tests.ts +94 -1
- package/src/collect/generateTurtle.ts +65 -3
- package/src/collect/resolvePublicExports.tests.ts +159 -0
- package/src/collect/resolvePublicExports.ts +244 -0
- package/src/collect/types.ts +11 -0
- package/src/collect-implementations.ts +0 -0
- package/src/serializers/TTLSerializer.tests.ts +101 -0
- package/src/serializers/TTLSerializer.ts +17 -2
- package/.github/ISSUE_TEMPLATE/propose-changes-to-existing-ui-block.md +0 -14
- package/.github/ISSUE_TEMPLATE/propose-new-ui-block.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -22
- package/.github/workflows/ci.yml +0 -49
- package/.github/workflows/sync-coda-manual.yml +0 -25
- package/.github/workflows/sync-coda-scheduled.yml +0 -22
- package/.github/workflows/sync-coda.yml +0 -102
- package/.mcp.json +0 -12
- package/GEMINI.md +0 -2
- package/biome.json +0 -6
- package/bun.lock +0 -392
- package/data/apps_landscape/component/truncated_cell.ttl +0 -38
- package/data/concept/Foundations-Grid.ttl +0 -9
- package/data/concept/Indicating-required-fields-in-forms.ttl +0 -9
- package/data/concepttype/Decision-guide.ttl +0 -5
- package/data/concepttype/Mental-model.ttl +0 -5
- package/examples/form-roster.target.json +0 -550
- package/source.json +0 -205
- package/specs/README.md +0 -17
- package/src/cli.ts +0 -58
- package/src/commands/extract.tests.ts +0 -40
- package/src/commands/extract.ts +0 -50
- package/src/commands/index.ts +0 -4
- package/src/commands/list.tests.ts +0 -25
- package/src/commands/list.ts +0 -26
- package/src/commands/sync.tests.ts +0 -430
- package/src/commands/sync.ts +0 -418
- package/src/commands/transform.tests.ts +0 -213
- package/src/commands/transform.ts +0 -257
- package/src/config/index.ts +0 -2
- package/src/config/source.schema.json +0 -146
- package/src/config/types.ts +0 -129
- package/src/config/validateConfig.tests.ts +0 -46
- package/src/config/validateConfig.ts +0 -21
- package/src/constants.ts +0 -19
- package/src/providers/CodaProvider.tests.ts +0 -335
- package/src/providers/CodaProvider.ts +0 -384
- package/src/providers/CodaProvider.types.generated.ts +0 -12597
- package/src/providers/detectSmartChips.tests.ts +0 -42
- package/src/providers/detectSmartChips.ts +0 -60
- package/src/providers/index.ts +0 -18
- package/src/scripts/checkDataDeletion.ts +0 -68
- package/src/scripts/evaluateDataDeletion.tests.ts +0 -100
- package/src/scripts/evaluateDataDeletion.ts +0 -100
- package/src/sync/constants.ts +0 -52
- package/src/sync/diffRoster.tests.ts +0 -455
- package/src/sync/diffRoster.ts +0 -241
- package/src/sync/loadTargetSpec.tests.ts +0 -208
- package/src/sync/loadTargetSpec.ts +0 -139
- package/src/sync/renderPlan.tests.ts +0 -144
- package/src/sync/renderPlan.ts +0 -88
- package/src/sync/snapshotTable.tests.ts +0 -31
- package/src/sync/snapshotTable.ts +0 -20
- package/src/sync/toLiveEntries.tests.ts +0 -76
- package/src/sync/toLiveEntries.ts +0 -55
- package/src/sync/types.ts +0 -101
- package/src/transform/collectDataMetrics.tests.ts +0 -108
- package/src/transform/collectDataMetrics.ts +0 -114
- package/src/transform/deltaGuards.tests.ts +0 -136
- package/src/transform/deltaGuards.ts +0 -118
- package/src/transform/expectedTables.tests.ts +0 -99
- package/src/transform/expectedTables.ts +0 -34
- package/src/transform/isValidReferenceUri.tests.ts +0 -45
- package/src/transform/isValidReferenceUri.ts +0 -55
- package/src/transform/materializeInverses.tests.ts +0 -81
- package/src/transform/materializeInverses.ts +0 -78
- package/src/transform/resolveReferences.tests.ts +0 -67
- package/src/transform/resolveReferences.ts +0 -36
- package/src/transform/resolveValue.tests.ts +0 -82
- package/src/transform/resolveValue.ts +0 -87
- package/src/transform/rowFilter.tests.ts +0 -100
- package/src/transform/rowFilter.ts +0 -55
- package/src/transform/transform.tests.ts +0 -132
- package/src/transform/transform.ts +0 -145
- package/src/transform/transformRow.malformedRefs.tests.ts +0 -127
- package/src/transform/transformRow.tests.ts +0 -466
- package/src/transform/transformRow.ts +0 -358
- package/src/transform/types.ts +0 -37
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -11
- package/vitest.config.ts +0 -50
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Spacing a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Spacing";
|
|
7
|
+
ds:summary "This document covers both inter-element spacing (gaps between components and patterns) and intra-component spacing (internal padding and border compensation):\n\n- Vertical and horizontal spacing architecture\n- How containers own inter-child spacing across tiers\n- Baseline grid and nudge token architecture\n- Invariants the system must preserve";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "\n\nStatus: Final \nVersion: 1.1 \nLast updated: 2026-06-29\n\n\n\n## Table of contents\n\n1. [Glossary](#glossary)\n2. [Problem statement and scope](#1-problem-statement-and-scope)\n3. [The vertical spacing architecture](#2-the-vertical-spacing-architecture)\n4. [Horizontal spacing](#3-horizontal-spacing)\n5. [Invariants](#4-invariants)\n\n\n\n## Glossary\n\nCopy of Table 10\n\n\n\n## 1. Problem statement and scope\n\n### 1.1 The problem\n\nOur Design System serves three fundamentally different tiers:\n\n- Application UIs – dashboards, forms, settings pages, admin panels (MAAS, Landscape, Launchpad, Snapcraft, support portal, and ~50 other products)\n- Editorial / marketing sites – [ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), canonical.design, blog content\n- Documentation\n\nEarlier drafts also explored element-owned spacing for some editorial / prose contexts.\n\nFor the current specification, semantic spacing is container-owned throughout the system. Editorial, marketing, documentation, and application UI all follow the same semantic spacing model. Where baseline alignment is enabled, text elements may also carry nudge and baseline-compensation values; those do not replace container-owned semantic spacing.\n\n### 1.2 Scope\n\nThis specification covers both inter-element spacing (gaps between components and patterns) and intra-component spacing (internal padding and border compensation):\n\n- Vertical and horizontal spacing architecture\n- How containers own inter-child spacing across tiers\n- Baseline grid and nudge token architecture\n- Invariants the system must preserve\n\nOut of scope:\n\n- Typography specification (referenced where relevant)\n- Grid system specification (referenced where relevant)\n- Implementation details (CSS architecture, component APIs, tooling)\n\n### 1.3 Goals\n\n1. **Predictability:** Spacing behaviour is deterministic and learnable\n2. Composability: Components and patterns compose correctly without child-specific margin overrides\n3. Single implementation path: The system uses one semantic spacing model across tiers\n4. Tier coverage: Different products can express their needs without changing the semantic spacing model\n\n\n\n## 2. Vertical spacing\n\n### 2.1 Decision\n\nVertical semantic spacing is container-owned everywhere.\n\nThe implementation guidance below applies across application UI, editorial, marketing, and documentation.\n\nCopy of Table 11\n\n### 2.2 Core principle\n\nTable 73\n\nChildren are spacing-neutral externally. Containers define the space between them.\n\n### 2.3 Implementation model\n\nInter-child semantic spacing is owned by containers and patterns, not by child elements.\n\n- Use `gap` or an equivalent container-defined rule for authored semantic spacing.\n- Do not rely on child `margin-top` or semantic `margin-bottom` for authored layout spacing.\n- Reset browser default margins inside design-system scope so native elements stay semantically spacing-neutral.\n\n2.3.1 Ownership rules\n\nContainers and patterns own semantic spacing between direct children.\n\nWhere baseline alignment is enabled, text elements may still carry nudge and baseline compensation.\n\nImplementation guidance\n\n- Use structured containers when prose needs non-uniform semantic transitions.\n- Use nested containers when local density changes, and keep semantic spacing decisions at container boundaries.\n\n2.3.2 Current ownership\n\nInter-child semantic spacing is owned by containers and patterns, not by child elements.\n\n```\nStack → gap based on container density\nField group → gap based on local context\nSection → padding / gap owned by container\nButton → no external spacing\n```\n\nSpacing decisions stay at container boundaries.\n\nMixed editorial content may still need different semantic transitions between headings, paragraphs, figures, and lists. Where baseline alignment is enabled, the text elements may also carry their own nudge and baseline-compensation values.\n\n\n\nExample: prose wrapper with structured transitions\n\n2.3.3 Structured containers\n\nWhen prose needs non-uniform semantic spacing, that logic belongs to a prose wrapper or pattern rather than to the individual elements.\n\n```\nh2 → larger gap (owned by prose wrapper)\np → standard gap (owned by prose wrapper)\np → standard gap (owned by prose wrapper)\nfigure → larger gap (owned by prose wrapper)\nh2 → larger gap (owned by prose wrapper)\n```\n\nThis is how editorial and documentation content are handled in the current specification.\n\nThe ownership model stays the same even when the transitions differ.\n\nCurrent coverage:\n\n- App UI - forms, dashboards, card grids, settings pages\n- Editorial / marketing and documentation content rendered inside prose wrappers\n\n2.3.4 Tier coverage\n\nThe semantic spacing model does not change by product or tier.\n\n- Application UI uses container-owned semantic spacing.\n- Editorial / marketing uses container-owned semantic spacing. Where baseline alignment is enabled, text elements also carry nudge and baseline compensation.\n- Documentation uses container-owned semantic spacing. Where baseline alignment is enabled, text elements also carry nudge and baseline compensation.\n- Rich text / markdown output should be wrapped in a container that owns semantic spacing for its rendered children.\n\nThis keeps one implementation path throughout the system.\n\n2.3.5 Section boundaries\n\nSeparation between sections is owned by the section container, surrounding layout container, or pattern padding.\n\n```css\n.ds-scope :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote) {\nmargin-block: 0;\n}\n.stack { gap: var(–space-y, 1rem); }\n```\n\nBrowser default margins should be reset in design-system scope so native elements do not reintroduce external child spacing.\n\n2.3.6 Component implementations\n\nComponents are spacing-neutral externally; the container owns inter-child spacing.\n\n**Example: Hero pattern**\n\n```\nHero (padding-bottom: 64px, gap: 24px)\n├── h1 “Sign up today”\n├── p “Get started free”\n└── [Button: Sign up]\n└── (hero padding-bottom provides the 64px separation to next section)\n\n```\n\nThe section container, not the child elements, owns the spacing boundary to what follows.\n\n### 2.4 Container-owned spacing\n\n2.4.1 Core principle\n\nContainers define spacing between their children. Children stay spacing-neutral externally, and authored layout spacing is expressed through container gaps or equivalent rules.\n\n2.4.2 How it works\n\nA container applies uniform or structured gaps:\n\n```\nContainer with gap (16px)\n├── TextField\n├── TextField\n└── Button\n```\n\nRecommended safeguard: apply a design-system scope margin reset so browser default element margins do not reintroduce external child spacing.\n\n2.4.3 Applying the model across tiers\n\nApplication UI, editorial / marketing, and documentation all use container-owned spacing.\n\nUse the appropriate container type for the content being composed:\n\n- Stack, group, and grid containers for repeated UI\n- Prose wrappers and section containers for mixed editorial content\n- Markdown / rich-text wrappers for rendered documentation content\n- Nested containers where different local densities are needed\n\n**Nested containers for varying density:**\n\nWhen different parts of an interface need different density, nest containers with different gap values. Each container owns the spacing for its direct children.\n\n```\nForm (padding: 16px, gap: 16px)\n├── Field group (gap: 4px) ← dense: label, input, helper text\n│ ├── Label: \"Upstream DNS\"\n│ ├── Input: \"8.8.8.8\"\n│ └── Helper: \"Comma-separated list of upstream DNS servers.\"\n└── Field group (gap: 4px) ← same dense group, separated by larger gap\n ├── Label: \"Default TTL\"\n ├── Input: \"30\"\n └── Helper: \"...\"\n```\n\nIn this example, the form’s `gap` separates the two field groups with comfortable spacing. Inside each field group, a small gap keeps the label, input, and helper text tightly bound as a single unit. The form container owns the inter-group spacing; each field group owns its internal density.\n\nThe same ownership rule applies regardless of tier:\n\n- App forms, dashboards, and settings pages\n- Editorial sections, figures, and calls to action\n- Documentation articles, callouts, and examples\n- Markdown or rich-text renderers wrapped by the design system\n\n### 2.4.4 Application-specific container provisions\n\nOne container pattern is unique to application layouts:\n\nFixed-height status bar. A status bar is simply a container with a fixed height. Its width can span both the main area and side drawers, or be scoped to the main area only, depending on use case. Like all application containers, it resets default child margins and owns the spacing between its children.\n\n### 2.5 Intra-component vertical padding\n\nIntra-component vertical padding is component-owned: each component sets its internal top/bottom padding regardless of context.\n\nFor example, buttons, inputs, and cards keep the same internal top/bottom padding whether they appear alone or inside grouped layouts.\n\nWhen borders change the box model, adjust top/bottom padding so outer component height remains aligned to whole-`bU` steps.\n\n### 2.6 Baseline grid and nudges\n\n2.6.1 The baseline grid\n\nIn our design system, the default baseline unit is 4px (previously 8px). \nWe use the acronym `bU` throughout this specification.\n\n> Box model consideration: When elements have borders, the entire box model must be accounted for in height calculations. For example, an element with padding: 16px and border: 1px should reduce padding to 14px to maintain the same total height. This principle applies across the system.\n\n2.6.2 The nudge technique\n\nThe underlying issue is browser line-height centering: CSS centres text vertically within the line-height box rather than anchoring it to a baseline. This means text baselines can land at inconsistent positions unless they are compensated deliberately.\n\nNudge tokens address that by adding a small `padding-top` to text-bearing elements or components.\n\nIn baseline-aligned contexts, baseline correction is an explicit exception to the semantic spacing rule.\n\nImplementation notes:\n\n- `padding-top = nudge`\n- `margin-bottom = baseline-compensation`\n- Container `gap` or structured transition rule = semantic spacing\n\nSome implementations approximate measured nudges with a cap-height alignment shortcut.\n\n```css\nThat avoids reading and maintaining calculated nudges, but it is less accurate because cap height is only a proxy for the ascender/descender metrics that determine line-box centering.\nThe ownership model does not change: if text is shifted with `padding-top`, the resulting offset still needs compensation.\n.stack {\ngap: var(–space-y, 1rem);\n}\n.baseline-text {\npadding-top: var(–nudge, 0px);\nmargin-bottom: var(–baseline-comp, 0px);\n}\n```\n\nThis preserves the architecture: containers still own semantic spacing, while text elements own the correction needed to land their baselines on the grid.\n\n2.6.3 Scope\n\nBaseline alignment is currently enabled for editorial / marketing and documentation. In those contexts, text elements own nudge and baseline compensation while containers still own semantic spacing. Application UI continues to use the same container-owned semantic spacing model without non-zero nudge compensation.\n\nCopy of Table 13\n\n\n\n## 3. Horizontal spacing\n\nHorizontal spacing uses a container-owned model throughout the system.\n\nUnlike vertical spacing, horizontal spacing rarely encodes typographic hierarchy between adjacent elements. Large separations are typically set by the grid (gutters, margins, keylines). What remains is spacing between grouped elements inside components and patterns, where container-defined gaps are simpler and more consistent.\n\n### 3.1 Layout-level spacing\n\nHorizontal spacing at the layout level is handled by the grid system:\n\nCopy of Table 14\n\nThe grid provides consistent horizontal rhythm across breakpoints and establishes keylines: shared horizontal offsets that align text and controls across components and patterns, improving scannability. Components placed within grid columns inherit this spacing automatically.\n\n> Two-dimensional grids: When layout produces a two-dimensional grid of items (card grids, dashboards, image galleries), the vertical gap between rows must equal the horizontal gutter (24px). This keeps items on a uniform spatial grid in both axes.\n\n### 3.2 Horizontal sibling spacing\n\nHorizontal spacing between sibling elements is container-owned: the parent context sets the gap.\n\nFor example, in a row of buttons or chips, the container defines the horizontal gap between items.\n\n\n\n### 3.3 Intra-component horizontal padding\n\nIntra-component horizontal padding is component-owned: each component sets its internal left and right padding regardless of context.\n\nFor example, buttons, inputs, and chips keep the same internal left and right padding whether they appear alone or inside grouped layouts.\n\nWhen borders change the box model, adjust left and right padding to preserve content box width. For bottom-only borders, left and right padding stays unchanged.\n\nCopy of Table 15\n\n\n\n## 4. Invariants\n\nInvariants are the non-negotiable rules this spacing model must preserve. They serve as evaluation criteria for architectural decisions and acceptance criteria for contributions.\n\n### 4.1 The invariant list\n\nCopy of Table 16\n\n### 4.2 How the invariants apply\n\nSubstitutability: containers own semantic spacing contracts, so children can be exchanged without inherited semantic-spacing side effects.\n\n- Locality: components own internal padding and any baseline correction; containers own inter-child semantic spacing.\n- No double spacing: semantic spacing does not stack with parent spacing. Where baseline compensation uses `margin-bottom`, it must remain distinct from the semantic spacing term.\n- Composition isolation: semantic spacing rules stay at container boundaries.\n\nPredictable removal: removing a child leaves the remaining container spacing intact.\n\n- Grid alignment: components and patterns should resolve to whole-bU outer heights.\n- Where baseline correction is required, the text element owns nudge and baseline compensation.\n\n### 4.3 Invariant priority\n\nWhen invariants conflict, resolve in this order:\n\n1. **Substitutability** – composition must remain predictable\n2. **Locality** – knowledge shouldn’t leak across boundaries\n3. **No double spacing** – additive bugs break layouts\n4. **Composition isolation** – parent-child contracts must be stable\n5. **Grid alignment** – vertical rhythm should be maintained\n6. **Predictable removal** – overrides must be safe\n\n> Grid alignment refers to outer component height in whole-bU steps; baseline correction is handled by nudges where needed.\n\n\n\n\n\n## 5. Authoring guidance\n\nThis section translates the architectural model into concrete decisions for the audiences who apply it daily.\n\n### 5.1 Component designers\n\nComponents are spacing-neutral externally, except for baseline compensation where baseline alignment is enabled.\n\nIf tiers use different nudge values, that is a token decision rather than a different semantic spacing architecture.\n\nCore rules\n\nComponents do not own inter-child semantic spacing.\n\n- Internal vertical padding is component-owned; use values from the spacing scale.\n- If the component contains text and uses nudge tokens, preserve outer height through the defined baseline-compensation term or equivalent internal box-model compensation.\n- If the component has a border that changes the box model, reduce padding to keep total height on whole-`bU` steps.\n\nAdditional rules\n\nInternal horizontal padding is always component-owned.\n\n- Do not ship authored layout dependence on semantic `margin-top` or `margin-bottom`.\n- Keep internal padding consistent regardless of layout context.\n- Text-bearing components apply nudge tokens where required.\n\nPre-review checklist\n\n- Spacing values use tokens, not arbitrary px\n- No authored layout dependence on child `margin-top` or semantic `margin-bottom`\n- Component height is whole-bU multiples (account for borders)\n\nVerification\n\n- Text-bearing components apply nudge tokens where required\n- Tested in composition inside a stack, a grid cell, and a prose wrapper where relevant\n- Container-owned spacing is used consistently across apps, editorial, and documentation\n- Where prose needs varied transitions, use a structured container rather than child-owned external spacing\n- Use tokenized gaps and padding values rather than ad hoc spacing fixes\n\n### 5.2 Pattern designers\n\nPatterns compose components. The principle: patterns own spacing between their children.\n\nUse uniform stack containers for repeated UI.\n\nUse structured prose wrappers for mixed editorial content when different transitions need different values.\n\n- Use nested containers where different local densities are needed.\n- Do not add one-off spacing overrides to individual children when the spacing decision belongs to the container.\n- For two-dimensional grids, set the vertical row gap equal to the horizontal gutter (24px).\n- Wrap markdown or rich-text output in a container that owns spacing for rendered children.\n\nPattern variants\n\nIf a pattern needs tighter or looser spacing, change the container recipe or use a component variant that keeps external spacing neutral.\n\n- Keep spacing decisions at the container or pattern boundary.\n- Do not depend on child `margin-bottom` to solve composition problems.\n\nSlot-based patterns\n\nWhen a pattern passes arbitrary children through a slot, wrap the slot in a container that owns spacing for that child list.\n\n- Do not depend on slotted children to provide their own external margins.\n- Document expected child types where the slot is constrained.\n- Use the same ownership model in apps, editorial, and documentation.\n\n\n\n\n\n## Appendices\n\n### A. References\n\n- Material Design 3: [Layout spacing](https://m3.material.io/foundations/layout/understanding-layout/spacing#9ebf5386-23ca-400a-b68d-e8c679a4a19d)\n- Shopify Polaris: [Stack](https://shopify.dev/docs/api/checkout-ui-extensions/latest/polaris-web-components/layout-and-structure/stack)\n - Atlassian Design System: [Stack](https://atlassian.design/components/primitives/stack/)\n\n";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Surfaces a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Surfaces";
|
|
7
|
+
ds:summary "This document covers surface levels: how nesting a surface steps its tone, what each control looks like at every level, and which tokens the control CSS reads to follow the surface it sits on.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-09-11 \n**Source:** `@canonical/react-ds-global-form` Storybook guide — _Surfaces_\n\n\nForm controls are **surface-aware**. Rather than painting one fixed colour on\nevery background, the checkbox, radio and switch read their colours from the\ndesign system's `--surface-color-foreground-*` channels, so a control recolours\nto suit the surface it sits on.\n\nSurfaces step by **nesting**, not by a prop: a `.surface` element is level 1, a\n`.surface` inside another `.surface` is level 2, and a third level of nesting is\nlevel 3. Each level resolves the surface channels to its own tone, and any\ncontrol inside inherits it automatically.\n\n| Level | Selector | Tone |\n| --- | --- | --- |\n| 1 | `.surface` | base foreground |\n| 2 | `.surface .surface` | stepped |\n| 3 | `.surface .surface .surface` | stepped again |\n\n## Every control at each level\n\nSelected fills, radio dots and switch tracks step with the band; the switch knob\nand the masked checkmark read their own surface channels too, so they stay\nlegible against the stepping fill.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## Checkbox\n\nThe box fill and the masked checkmark both resolve per surface, including the\nindeterminate state.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## Switch\n\nThe track (selected and unselected) steps with the surface, while the knob reads\nits own channel so it keeps contrast against the track at every level.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## What the control CSS reads\n\nEach control names the surface channel with a flat fallback, so it works whether\nor not a surface context is present:\n\n\\`\\`\\`css\n.ds.form-checkbox:checked {\n background: var(\n --surface-color-foreground-checkbox-selected,\n var(--color-foreground-checkbox-selected)\n );\n}\n\\`\\`\\`\n\nHover on a selected control shifts **only** the fill/track — via the\n`--hover--color-foreground-*-selected` channels — never the checkmark glyph or\nthe switch knob. This replaced an earlier whole-element `filter: brightness()`\nthat dimmed the glyph along with the fill.\n\n### Upstream note\n\nThe design tokens currently provide surface channels for the controls' unselected\nand checkmark/knob colours. The `-selected` surface channels (and the switch's\nunselected track) are supplied by a temporary shim in `@canonical/styles`\n(`controls.hover.shim.css`) until they are generated upstream; the components\nalready read them, so no component change is needed when they land.";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Typography a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Typography";
|
|
7
|
+
ds:summary "This document covers the foundations of the type scale decisions foundational to the Canonical design language, including: \n\n- The mathematical foundation of the type scale (formula, parameters, full sequence)\n- Per-tier heading hierarchies – which sizes, weights, and line heights apply to h1–h6 and body text in applications, documentation, and editorial\n- Weight pairing rules and emphasis conventions\n- Line height selection and baseline grid alignment\n- Responsive scaling behaviour\n- Accessibility constraints on minimum sizes";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Draft \n**Version:** 1.0 \n**Last updated:** 2026-04-25\n\n\n\n## Table of contents\n\n1. [Problem statement and scope](#1-problem-statement-and-scope)\n2. [The modular scale](#2-the-modular-scale)\n3. [Domain type scales](#3-domain-type-scales)\n4. [Weights](#4-weights)\n5. [Line height and the baseline grid](#5-line-height-and-the-baseline-grid)\n6. [Cross-domain principles](#6-cross-domain-principles)\n7. [Accessibility](#7-accessibility)\n8. [Responsive behaviour](#8-responsive-behaviour)\n9. [Invariants](#9-invariants)\n10. [Tooling](#10-tooling)\n\n\n\n## Glossary\n\nTable 54\n\n\n\n## 1. Problem statement and scope\n\n### 1.1 The problem\n\nCanonical’s product ecosystem spans three broad tiers:\n\n- **Applications** (MAAS, Landscape, Launchpad) – dense, tool-oriented interfaces where users work in extended sessions, often in small windows alongside other software.\n- **Documentation** (discourse sites, installation guides, API references) – deep, structured content where authors need semantic emphasis at every heading level.\n- **Editorial** ([ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), blog posts, campaign pages) – short-session content where scannability, visual hierarchy, and impact drive comprehension.\n\nEach tier demands a different balance between information density and visual contrast. Applications need the most compact scale possible. Documentation needs moderate contrast with strong emphasis support. Editorial needs generous contrast to guide rapid scanning. No single heading hierarchy optimally serves all three.\n\nWithout a shared mathematical foundation, these three hierarchies risk diverging into ad-hoc size choices. The result is inconsistency across products, difficulty maintaining design tokens, and no principled way to resolve conflicts when content moves between tiers.\n\n### 1.2 Scope\n\nThis spec covers:\n\n- The mathematical foundation of the type scale (formula, parameters, full sequence)\n- Per-tier heading hierarchies – which sizes, weights, and line heights apply to h1–h6 and body text in applications, documentation, and editorial\n- Weight pairing rules and emphasis conventions\n- Line height selection and baseline grid alignment\n- Responsive scaling behaviour\n- Accessibility constraints on minimum sizes\n\nThis spec does not cover:\n\n- Typeface selection (see the typeface spec)\n- Vertical and horizontal spacing between elements (see the spacing spec)\n- Grid column structure and layout zones (see the grid spec)\n- CSS implementation details or token naming conventions (see the `docs-typescale` reference implementation)\n- OpenType feature usage, letter-spacing, or text decoration\n\n### 1.3 Goals\n\n- **Harmonic consistency:** all type sizes across all three tiers derive from a single modular scale, ensuring visual coherence even when content crosses tier boundaries.\n- **Density fit:** each tier selects the portion of the scale that matches its density requirements – compact for applications, moderate for documentation, generous for editorial.\n- **Emphasis without proliferation:** heading hierarchies rely on weight pairing to distinguish levels, minimising the number of distinct sizes needed.\n- **Baseline grid integration:** every type size maps to a line height that is a multiple of the 4px baseline unit (`bU`), producing consistent vertical rhythm.\n\n\n\n## 2. The modular scale\n\n### 2.1 Foundation\n\nOur type scale is based on Spencer Mortensen’s refinement of the classical modular scale described by Robert Bringhurst in *The Elements of Typographic Style*¹ – a system with centuries of proven application in both print and digital typography.\n\nMortensen replaces the classical scale’s finite sequence with a continuous formula that identifies and corrects several outliers in the traditional progression. Because his improvements deliver greater mathematical precision – a quality central to our brand – we adopt his sequence as the basis for all three domain scales.\n\n### 2.2 The formula\n\nThe scale is expressed as a fractional-step geometric progression:\n\n```\nf(i) = f(0) × pow(ratio, i / n)\n```\n\nWhere:\n\n- `f(0)` is the base type size – 1rem (16px) for editorial, 0.875rem (14px) for documentation and applications\n- `ratio` defines the harmonic relationship – 2 for octave-based scales\n- `n` represents the number of steps per octave – 5 in Mortensen’s classic scale\n- `i` is the position in the sequence\n\nThe result is an infinite sequence of harmonically related sizes. Each domain selects a contiguous subset of this sequence for its heading hierarchy.\n\n### 2.3 The full sequence\n\nThe following table lists every size in the scale that our system uses, from 6px up to 96px. Sizes are rounded to whole pixels for implementation; rem values assume a 16px root.\n\nTable 55\n\n> **Note:** The sub-10px sizes (steps –5 through –2) exist in the mathematical sequence but are rarely used in UI. They appear in captions, legal text, and subscripts where applicable.\n\n\n\n## 3. Domain type scales\n\nWe work with content broadly categorised into three tiers – applications, documentation, and editorial. Each has distinct constraints and established practices that merit a separate heading hierarchy. The three tiers share the modular scale as a common foundation but optimise for different points on the density–contrast spectrum.\n\n### 3.1 Applications\n\nContext: maximum information density\n\nApplications support users through extended interaction sessions. Unlike websites – where interactions are often brief and familiarity is limited – applications assume expertise and must be optimised for sustained focus. User testing shows that applications are frequently run in small windows alongside other software, reinforcing the need for the highest possible information density.\n\nOn Ubuntu, default type sizes for UI and terminals fall between 11px and 13px. Aligning our application type sizes as closely as web accessibility standards allow reduces the cognitive effort required when users switch between tools.\n\nThe application type scale\n\nTo achieve maximum density, body text, h6, and h5 all share the root type size of 14px. H5 and h6 are distinguished from body text by bold and bold small caps rather than by size. The remaining heading levels (h4/h3, then h2/h1) use the minimum size increments needed for clear distinction. The result is the most compact scale of all three tiers, using only three distinct sizes:\n\nTable 56\n\n**Size discipline:** 3 distinct sizes (14, 18, 24px).\n\n### 3.2 Documentation\n\nContext: information density with semantic clarity\n\nDocumentation typography prioritises information density while maintaining the ability to create semantic emphasis. Technical authors need to distinguish between regular text, *emphasis*, and **strong emphasis** at every heading level. This requirement drives the weight pairing strategy and a slightly broader size range than applications.\n\nThe documentation type scale\n\nBody text is set at 14px. Bold at 14px is reserved for strong emphasis in body copy. Headings are set in pairs of lighter and bolder weights, skipping one step in the modular scale between pairs for clear distinction and consistent rhythm:\n\nTable 57\n\n**Size discipline:** 4 distinct sizes (14, 18, 24, 32px).\n\n### 3.3 Editorial\n\nContext: scannability, clarity, impact\n\nEditorial content – including marketing sites, blog posts, and promotional materials – serves users who are scanning, evaluating, and consuming information in short, focused sessions. Higher contrast and more generous spacing facilitate quick comprehension and help users rapidly locate the information they need. Editorial typography therefore applies the strongest contrasts in type size to establish a clear visual hierarchy.\n\nThe editorial type scale\n\nBody text is set at 16px – the browser default, providing optimal accessibility compliance. Headings use the widest range of sizes, with the largest (h1 at 42px) providing strong visual impact:\n\nTable 58\n\n**Size discipline:** 3 distinct sizes (16, 24, 42px), though up to 5 are available in the scale for display use cases (e.g. 84px at weight 200 for hero headlines).\n\n### 3.4 Comparison\n\nTable 59\n\n\n\n## 4. Weights\n\nOur system uses font weight as a primary hierarchy signal, reducing dependence on type size alone. This requires sufficient contrast between weight values to prevent visual confusion.\n\n### 4.1 Weight contrast minimum\n\nAdjacent weights in any pairing must differ by at least 200 units. This rule applies to:\n\n- Weight pairs within a heading level (e.g. h1 at 500, h2 at 300 – a difference of 200)\n- Emphasis within a heading (e.g. h1 at 500, emphasised word at 700 – a difference of 200)\n- Body text and strong emphasis (regular 400, bold 600 – a difference of 200)\n\nSkipping the intermediate value (e.g. going from 400 to 600, not 400 to 500) ensures clear visual distinction at every size.\n\n### 4.2 Body text\n\nBody text is set in regular weight (400). The next available weight at the same size is 600 (semi-bold), used for strong emphasis. Weight 500 is skipped at body size to maintain the 200-unit minimum contrast.\n\n### 4.3 Heading weight pairing\n\nHeadings follow three rules:\n\n1. **Weight decreases as size increases.** Larger headings use lighter weights. For example, 18px documentation h3 uses weight 600, while 24px editorial h3 uses weight 500.\n2. **Pairs of headings share a type size and are distinguished by weight.** H1 and h2 share a size; h3 and h4 share a size. This halves the number of distinct sizes needed.\n3. **Weight pairs differ by at least 200 units.** Within a pair, the bolder heading uses weight 500 or 600; the lighter uses 300 or 400.\n\n### 4.4 Emphasis in headings\n\nEmphasis within headings uses a weight increment of 200 from the heading’s own weight:\n\n- h1 (weight 500) → emphasised words: 700\n- h2 (weight 300) → emphasised words: 500\n\n> **Note:** emphasis should be used sparingly if at all. When used, it should highlight only key words, never the entire heading.\n\n### 4.5 Available weights\n\nTable 60\n\n\n\n## 5. Line height and the baseline grid\n\n### 5.1 Line height ratios\n\nLine height ratios follow a traditional pattern: most generous at body text size, then progressively tighter as heading sizes increase. We start at **1.5** for body text – a ratio that provides optimal readability for sustained reading while maintaining reasonable space efficiency.\n\nAt display sizes, ratios compress toward **1.1**, reflecting the typographic convention that large text needs proportionally less leading to maintain visual cohesion.\n\n### 5.2 Snapping to the baseline grid\n\nAll line heights must be a multiple of the 4px baseline unit (`bU`). We select the multiple of the baseline unit that yields a ratio appropriate to the heading’s position in the hierarchy. The following table lists the recommended line height at every size in the scale:\n\nTable 61\n\n> **Note:** all line heights in our system are multiples of the 4px baseline unit.\n\n### 5.3 Baseline alignment with nudge tokens\n\nCSS line-height alone does not guarantee that text baselines land on the grid. The vertical position of a glyph’s baseline within its line box depends on the font’s ascender/descender metrics, which vary by typeface, size, and rendering engine.\n\nNudge tokens solve this by adding a measured `padding-top` to each text element, shifting the first baseline onto the nearest grid line. Nudge values are:\n\n- **Font-specific** – calculated for Ubuntu Sans\n- **Size-specific** – each size/line-height pair has its own nudge\n- **Platform-measured** – extracted from Chromium at 1× device pixel ratio, snapped to the nearest 0.0625rem (1px)\n\nThe baseline compensation model (defined in the spacing spec §2.6.2) preserves the element’s total block contribution:\n\n- `padding-top = nudge`\n- `baseline-compensation = bU − nudge`\n- `margin-bottom = semantic-spacing + baseline-compensation`\n\nThis means nudge tokens shift the baseline without consuming any of the element’s semantic spacing.\n\n> **Scope:** the nudge technique applies only to the editorial and documentation tiers. The application tier is exempt – all nudge tokens are intentionally set to `0`. See the spacing spec §2.6.3 for rationale.\n\n```css\n/* Example: documentation h1 at 32px / 40px line height, bU = 4px */\nh1 {\n font-size: 2rem;\n line-height: 2.5rem;\n font-weight: 500;\n padding-top: 0.039rem; /* nudge */\n margin-bottom: calc(\n var(--space-after-semantic-h1) /* e.g. 1rem */\n + var(--space-after-comp-h1) /* bU − nudge */\n );\n margin-top: 0;\n}\n```\n\n\n\n## 6. Cross-domain principles\n\n### 6.1 Restraint in type size usage\n\nThe modular scale offers an infinite sequence of sizes. Applied without restraint, it can introduce inconsistency and visual clutter. We take inspiration from Massimo Vignelli², who often limited his typography to just two type sizes.\n\nOur type scales make full use of a typeface’s range of styles rather than depending on size alone. By alternating lighter and bolder weights at body and heading levels, we eliminate the need for at least three extra type sizes. We also incorporate the newly available small caps in Ubuntu Sans, reinforcing a disciplined and economical approach to font sizing.\n\n### 6.2 Navigating a type family\n\nThe way we navigate a font family to craft our type scales is inspired by Robert Bringhurst’s \"grammatical roadmap\"¹ – a systematic method for traversing the styles available in a type family (roman, italic, bold, small caps, etc.) to build a clear typographic hierarchy.\n\nWe make a small departure: we use bold small caps instead of bold full caps (as in Bringhurst’s original roadmap), since full caps can be perceived as typographic shouting. The tall x-height of Ubuntu Sans makes our small caps slightly larger than those in classical typefaces, helping establish a clear hierarchy without resorting to capitalisation.\n\n### 6.3 The baseline grid\n\nThe baseline grid is the backbone of our typography. It provides accountability and rigour rarely seen on the web, especially at the enterprise level. Every typographic element, spacing decision, border, and UI component in our design system aligns to it.\n\nThis is not merely an aesthetic choice – it is a systematic approach that ensures:\n\n- **Visual consistency:** all elements adhere to an invisible vertical rhythm, rather than floating arbitrarily.\n- **Scalable precision:** everything in our design system – from a simple button to complex components and patterns – aligns to the baseline grid. This alignment is especially visible across columns, reinforcing a sense of precision and rigour.\n- **Quality assurance:** any visual inconsistency becomes immediately apparent. We provide a baseline grid visualisation utility (in both Figma and CSS) to highlight drift from the grid.\n\n### 6.4 Font stacks\n\nAll tiers use Ubuntu Sans as the primary typeface, with a system font fallback chain for environments where Ubuntu Sans is unavailable:\n\nTable 62\n\n\n\n## 7. Accessibility\n\n### 7.1 Minimum size requirements\n\nAll base type sizes meet or exceed WCAG 2.1 guidelines for minimum readable size:\n\n- **Editorial:** 16px (1rem) base provides optimal accessibility compliance and matches the browser default.\n- **Documentation and applications:** 14px (0.875rem) base meets minimum readable size requirements while optimising for information density.\n\nNo heading or body text in any tier falls below 14px. Smaller sizes in the scale (10–12px) are reserved for captions, labels, and legal text where reduced size is contextually appropriate.\n\n### 7.2 Contrast standards\n\nType size affects the minimum contrast ratio required by WCAG 2.1:\n\n- Text below 18px (or below 14px bold) requires a **4.5:1** contrast ratio against its background (AA level).\n- Text at or above 18px (or at/above 14px bold) qualifies as “large text” and requires a **3:1** ratio (AA level).\n\nAll heading and body combinations in our system meet at least AA contrast requirements when rendered in the default palette.\n\n\n\n## 8. Responsive behaviour\n\n### 8.1 Root em scaling\n\nAll tiers include an optional root em scaling feature that proportionally scales all `rem`-based measurements by increasing the root font size on larger screens. The current default factor is **1.125** (18px root instead of 16px), applied above the large breakpoint (currently 1680px).\n\nBecause our type sizes, line heights, and spacing are all expressed in `rem`, this single change effectively “zooms” the entire UI without breaking any proportional relationships.\n\n### 8.2 Documentation and applications\n\nDocumentation and application tiers use consistent sizing across breakpoints. No size increases occur on larger screens beyond the optional root em scaling.\n\n### 8.3 Editorial\n\nIn the editorial domain, we scale larger headings (h1/h2 and h3/h4) on smaller screens to preserve presentation quality. Body text remains at 16px across all breakpoints for accessibility.\n\nEditorial domains implement root em scaling by default for larger screens.\n\n\n\n## 9. Invariants\n\nThe following rules are non-negotiable. Any implementation that violates them is considered a bug.\n\nTable 63\n\n### 9.1 Invariant priority\n\nWhen invariants conflict – for example, if an unusual size would satisfy baseline alignment but violate the single-scale rule – resolve in the order listed above. The single-scale rule takes precedence over all others.\n\n\n\n## 10. Tooling\n\nImplementing baseline grid alignment traditionally required manual measurement and adjustment – a tedious, error-prone process that limited adoption of baseline grids on the web. We contribute open-source tooling that automates this process.\n\n### 10.1 npm package\n\nThe [@lyubomir-popov/baseline-nudge-generator](https://www.npmjs.com/package/@lyubomir-popov/baseline-nudge-generator) package automates baseline alignment by:\n\n- Extracting font metrics from TTF/WOFF files programmatically\n- Calculating precise CSS nudge values required for baseline alignment\n- Generating design tokens that maintain mathematical relationships\n- Providing interactive demos with baseline grid overlays for verification\n\n### 10.2 Shell script\n\nThe [unified-type-scale.sh](https://github.com/lyubomir-popov/docs-typescale) script generates modular scale sequences:\n\n```bash\n# Continuous formula mode (Mortensen)\n./unified-type-scale.sh continuous <f0> <ratio> <n> [rounding]\n\n# Classic typographic scale mode (harmonic ratios)\n./unified-type-scale.sh classic <f0> <n> [rounding]\n```\n\nRounding options: `none` (4 decimal places), `floor`, `round`, `0.5` (default – snaps to nearest half-pixel).\n\n### 10.3 Figma plugin\n\nA Figma plugin reads the typography configuration and automatically generates text components with correct sizes, weights, line heights, and nudge values. This ensures design files stay synchronised with the token definitions.\n\n### 10.4 Spreadsheet reference\n\nA [spreadsheet](https://docs.google.com/spreadsheets/d/1_zfQX8JtJ6c7SAIChu0t08CFya2szX3PFD-_rVLDqq4/edit?gid=0#gid=0) provides a quick designer reference, implementing the full modular scale with recommended line heights and per-domain mappings.\n\n\n\n## References\n\n1. Robert Bringhurst, *The Elements of Typographic Style*. The grammatical roadmap for navigating a type family appears on p. 55; the classical modular scale is discussed in chapters 8.3–8.4.\n2. Massimo Vignelli, *The Vignelli Canon*, p. 61 – on limiting typography to two type sizes. Available from the [Vignelli Center](https://www.rit.edu/vignellicenter/sites/rit.edu.vignellicenter/files/documents/The%20Vignelli%20Canon.pdf).\n3. Spencer Mortensen, [“Typographic Scale”](https://spencermortensen.com/articles/typographic-scale/) – the mathematical refinement of the classical scale adopted as our foundation.\n4. W3C, [WCAG 2.1 Success Criterion 1.4.3: Contrast (Minimum)](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n\n\n\n## Spec history\n\nTable 64";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
2
4
|
|
|
3
|
-
ds:concept.How-to-differentiate-
|
|
4
|
-
ds:name "How to differentiate
|
|
5
|
+
ds:concept.How-to-differentiate-types-of-UI-blocks- a ds:Concept;
|
|
6
|
+
ds:name "How to differentiate types of UI blocks ";
|
|
5
7
|
ds:summary "This decision tree is helps us categorize UI blocks that share certain attributes: deciding whether we are talking about the same or separate UI blocks, if it’s a matter of inheritance, variants of the same UI block, or simply properties of a block. ";
|
|
6
8
|
ds:tier ds:global;
|
|
7
|
-
ds:content "Given two things (X, Y) that share visual kinship: \n\nTEST 1 — AFFORDANCE \n│ Does X enable a fundamentally different user action than Y? \n│ (Different primary affordance: navigate vs act, input vs display, \n│ dismiss vs inform, filter vs label) \n│ \n│ Diagnostic signals: \n│ • Would X and Y require different HTML elements for semantic correctness? \n│ • Does one respond to user interaction where the other does not? \n│ • Would a screen reader announce them with different roles? \n│ • Could you describe X's purpose with a verb and Y's with a different verb? \n│ \n├─ YES → SPLIT into separate components \n│ (Chip / Label, Button / Link, Checkboxes / Radios*) \n│ \n│ *Note: Radios/Checkboxes remain an open discussion. \n│ The group has explored whether \"Choices\" as a unified \n│ component better captures semantic function. \n│ \n└─ NO → continue to Test 2\n\nTEST 2 — INHERITANCE \n│ Does Y specialise X by narrowing its possibility space and increasing its specificity while \n│ preserving X's affordance and anatomy? \n│ \n│ Diagnostic signals: \n│ • Y preconfigures properties that X leaves open \n│ • Y restricts the API surface (fewer valid inputs) \n│ • Y carries domain-specific opinions (branding, context) \n│ • Y would NOT alter structural properties (spacing, layout) [BrandedLabel an edge case bc of historical reasons] \n│ • Y's name naturally takes the form [Qualifier][Parent] \n│ (BrandedLabel > Label, GithubHero > Hero, NumericalBadge > Badge) \n│ \n├─ YES → Model as INHERITANCE (Y inherits from X) \n│ Y receives all of X's characteristics. \n│ Y is named with parent as suffix. \n│ Y's documentation is separate and references parent's core docs. \n│ \n│ Ontological note: This is a conceptual relationship. \n│ Implementation uses composition (hooks, render composition), \n│ not class inheritance. \n│ \n└─ NO → continue to Test 3\n\nTEST 3 — VARIANT \n│ Does the difference represent a design-time choice between \n│ information delivery strategies under the same affordance? \n│ \n│ Diagnostic signals: \n│ • The choice is made AFTER the component/pattern has been selected \n│ • The choice optimises information flow under constraints (not taste) \n│ • The difference can be articulated as \"when you are in X situation, \n│ use this form\" — i.e., the guidance is constraint-driven \n│ • The semantic meaning and primary affordance are unchanged \n│ \n│ Variant subcategories (provisional, not fully resolved): \n│ \n│ a) COMPLEXITY VARIANT — Same affordance, different information density \n│ (ProfileTag: short / medium / long) \n│ (Timeline: simple / detailed) \n│ (Pagination: basic / complex) \n│ (Tooltip: dense / actions / data visualisation) \n│ \n│ b) PLACEMENT VARIANT — Same affordance, different spatial arrangement \n│ (Hero: image left / image right) \n│ \n├─ YES → Model as VARIANT \n│ Single component page with variant-specific guidance. \n│ Guidance documents the constraints informing recommended choice. \n│ Variants do not exist for aesthetic preference alone. \n│ \n└─ NO → It's a property\n\nTEST 4 — MODIFIER FAMILY \n│ Does the difference represent a cross-cutting communicative axis \n│ that multiple components share? \n│ \n│ Diagnostic signals: \n│ • The variation is about status, emphasis, or hierarchy — not structure \n│ • Other components in the system exhibit the same axis of variation \n│ • Members of the family are mutually exclusive within one instance \n│ • A component consuming the family must support ALL its members \n│ • The variation is expressed through visual tokens (colour, weight), \n│ not structural changes \n│ \n│ Existing families: severity, emphasis, importance, criticality, \n│ density, anticipation, lifecycle \n│ \n├─ YES → Model as MODIFIER FAMILY membership \n│ Component opts into existing family. \n│ Modifier docs live at global level; component references them. \n│ \n└─ NO → Variant \n
|
|
9
|
+
ds:content "Given two things (X, Y) that share visual kinship: \n\nTEST 1 — AFFORDANCE \n│ Does X enable a fundamentally different user action than Y? \n│ (Different primary affordance: navigate vs act, input vs display, \n│ dismiss vs inform, filter vs label) \n│ \n│ Diagnostic signals: \n│ • Would X and Y require different HTML elements for semantic correctness? \n│ • Does one respond to user interaction where the other does not? \n│ • Would a screen reader announce them with different roles? \n│ • Could you describe X's purpose with a verb and Y's with a different verb? \n│ \n├─ YES → SPLIT into separate components \n│ (Chip / Label, Button / Link, Checkboxes / Radios*) \n│ \n│ *Note: Radios/Checkboxes remain an open discussion. \n│ The group has explored whether \"Choices\" as a unified \n│ component better captures semantic function. \n│ \n└─ NO → continue to Test 2\n\nTEST 2 — INHERITANCE \n│ Does Y specialise X by narrowing its possibility space and increasing its specificity while \n│ preserving X's affordance and anatomy? \n│ \n│ Diagnostic signals: \n│ • Y preconfigures properties that X leaves open \n│ • Y restricts the API surface (fewer valid inputs) \n│ • Y carries domain-specific opinions (branding, context) \n│ • Y would NOT alter structural properties (spacing, layout) [BrandedLabel an edge case bc of historical reasons] \n│ • Y's name naturally takes the form [Qualifier][Parent] \n│ (BrandedLabel > Label, GithubHero > Hero, NumericalBadge > Badge) \n│ \n├─ YES → Model as INHERITANCE (Y inherits from X) \n│ Y receives all of X's characteristics. \n│ Y is named with parent as suffix. \n│ Y's documentation is separate and references parent's core docs. \n│ \n│ Ontological note: This is a conceptual relationship. \n│ Implementation uses composition (hooks, render composition), \n│ not class inheritance. \n│ \n└─ NO → continue to Test 3\n\nTEST 3 — VARIANT \n│ Does the difference represent a design-time choice between \n│ information delivery strategies under the same affordance? \n│ \n│ Diagnostic signals: \n│ • The choice is made AFTER the component/pattern has been selected \n│ • The choice optimises information flow under constraints (not taste) \n│ • The difference can be articulated as \"when you are in X situation, \n│ use this form\" — i.e., the guidance is constraint-driven \n│ • The semantic meaning and primary affordance are unchanged \n│ \n│ Variant subcategories (provisional, not fully resolved): \n│ \n│ a) COMPLEXITY VARIANT — Same affordance, different information density \n│ (ProfileTag: short / medium / long) \n│ (Timeline: simple / detailed) \n│ (Pagination: basic / complex) \n│ (Tooltip: dense / actions / data visualisation) \n│ \n│ b) PLACEMENT VARIANT — Same affordance, different spatial arrangement \n│ (Hero: image left / image right) \n│ \n├─ YES → Model as VARIANT \n│ Single component page with variant-specific guidance. \n│ Guidance documents the constraints informing recommended choice. \n│ Variants do not exist for aesthetic preference alone. \n│ \n└─ NO → It's a property\n\nTEST 4 — MODIFIER FAMILY \n│ Does the difference represent a cross-cutting communicative axis \n│ that multiple components share? \n│ \n│ Diagnostic signals: \n│ • The variation is about status, emphasis, or hierarchy — not structure \n│ • Other components in the system exhibit the same axis of variation \n│ • Members of the family are mutually exclusive within one instance \n│ • A component consuming the family must support ALL its members \n│ • The variation is expressed through visual tokens (colour, weight), \n│ not structural changes \n│ \n│ Existing families: severity, emphasis, importance, criticality, \n│ density, anticipation, lifecycle \n│ \n├─ YES → Model as MODIFIER FAMILY membership \n│ Component opts into existing family. \n│ Modifier docs live at global level; component references them. \n│ \n└─ NO → Variant \n\n\n### Further references \n\n- Internal Canonical ontology [meeting notes](https://docs.google.com/document/d/1HHhTD80-nya5CkrWOzWitDsehDdILz0mkPPHzIySahs/edit?usp=sharing)";
|
|
8
10
|
ds:knownEdgeCases "";
|
|
9
11
|
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.How-to-indicate-required-fields-in-forms a ds:Concept;
|
|
6
|
+
ds:name "How to indicate required fields in forms";
|
|
7
|
+
ds:summary "This guideline documents and explains the decision for marking required fields in forms, while taking into account WCAG accessibility requirements and examining various methods for indicating required fields in forms. ";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "# **Rationale**\n\nThere are various different methods to indicate required fields within forms. Some products denote the required fields with a “*”, some do it with text in the label, some denote the optional ones with text in the label, while others denote both. This creates inconsistency between products and even within the same product sometimes. Follwing this guide on when to use what method will provide a more consistent and predictable product experience for users.\n\n# Considerations\n\n## **Accessibility**\n\nAccording to WCAG 2.2 [Success Criterion 3.3.2](https://www.w3.org/TR/WCAG22/#labels-or-instructions) and [Technique H90](https://www.w3.org/WAI/WCAG22/Techniques/html/H90):\n\n1. *For each required form control, check that the required status is indicated in the form control's label or legend.*\n2. *For each indicator of required status that is not provided in text, check that the meaning of the indicator is explained before the form control that uses it.*\n\n\n\nIt can easily be interpreted as “marking all required fields” is necessary. However, many people requested clarification on the Success Criterion (SC), and an [official w3c Working Group response](https://github.com/w3c/wcag/issues/3553#issuecomment-2022967832:~:text=which%20are%20optional).-,If%20some%20or%20all%20fields%20are%20required%20for%20submission%2C%20there%20can,above)%20are%20feasible%20and%20not%20ruled%20out%20by%20this%20success%20criterion.,-Other%20criteria%2C%20such) was provided. It is clear that distinguishing the required and the optional fields is necessary. However, some nuances are heavily debated.\n\n- Is it a failure of the SC to indicate required fields with an asterisk (*) *without* a legend to explain the meaning?\n\nSome Working Group (WG) members believe the answer is *no*, with supporting arguments like [this](https://github.com/w3c/wcag/issues/4791#:~:text=But%20I%20would%20be%20concerned%20with%20creating%20a%20failure%20technique%20stating%20unconditionally%20that%20use%20of%20an%20asterisk%20without%20some%20kind%20of%20legend%20is%20a%20failure.).\n\n- Is it necessary to indicate required fields on *well-understood small forms where all fields are required* like a two-field login form and one-field newsletter subscription form?\n\nMost WG members believe the answer is *no*, with supporting arguments like [this](https://github.com/w3c/wcag/issues/4791#issuecomment-3664703933).\n\n\n\nTo summarize, here are the safe methods that should pass SC 3.3.2.\n\n- Indicating optional fields with “optional” in the label (by implication the other fields would be required).\n- Indicating required fields explicitly by adding “(required)” after the label.\n- Use a convention like the asterisk and legend to indicate required fields.\n- State “all fields are required” at the beginning of the form (if they are).\n- Do not indicate required fields on small, well-understood forms where all fields are required.\n\n## **Common form scenarios**\n\nThe word “scenario”, instead of “type” or “category” is used here because these are not mutually exclusive classifications. They are characterized mostly by intent or context of the form.\n\n### **Conventional small forms**\n\nThese are forms with very few fields (1-3), where all fields are typically required and the purpose is *immediately* clear. Examples: Login, Sign-up, Newsletter Subscription, Search.\n\nMarking required fields in these forms adds more cognitive load than value.\n\n### **Low-motivation forms**\n\nFor these forms, the user's motivation to complete the submission is often low. We are asking for more information than the user originally intended to provide, and because form submission is usually non-essential to their immediate needs, they are likely to abandon the process. This is common for things like customer survey forms and the majority of sites forms.\n\n\n\nMarking optional fields may result in most fields being marked in some forms, making them more wordy than it should be. On the other hand, marking the required fields makes it clear the minimum information needed to proceed, which can arguably improve conversion rate.\n\n### **High-motivation forms**\n\nFor these forms, the user's motivation to complete the submission is often high. We are asking for essential information that directly facilitates the user's immediate needs, and because form submission is crucial to their goal, they are highly likely to complete the process. This is common for things like forms to complete a task or operation in apps.\n\n\n\nUsers are eager to complete the form, so clearly indicating the required fields meets their expectation, gives them more confidence and promotes a smoother flow.\n\n### **Fully required forms**\n\nForms where every single field must be completed to proceed.\n\nMarking every required field may feel a little redundant, especially when the form is long.\n\n## **Consistency**\n\nUsing one method for all forms is dogmatic and unnecessary. Picking a method for each usage scenario seems to be more reasonable. We should also leave room for unknown exceptions as well.\n\n## **Position of the asterisk**\n\nWhen used to mark the required fields, the asterisk can be placed at the start of the label or at the end. \n\nThe industry convention is to place it at the end. Most users should be familiar with this position. On the other hand, placing it at the start makes it a lot easier to scan and find required fields without having to read the labels. It can be very helpful for users who value efficiency and transparency, which is true for most Canonical personas.\n\n\n\nTable 10\n\n\n\nOne thing to note is that wherever it is placed, the asterisk needs to be hidden with aria-hidden=\"true\" so that it is not announced by screen readers.\n\n## How to\n\nTable 11\n\n\n\n# **Further information**\n\n[WCAG 2.2 SC 3.3.2 Labels and instructions](https://www.w3.org/TR/WCAG22/#labels-or-instructions)\n\n[WCAG 2.2 Technique H90: Indicating required form controls using label or legend](https://www.w3.org/WAI/WCAG22/Techniques/html/H90)\n\n\n\nWG discussions:\n\n[https://github.com/w3c/wcag/issues/1698](https://github.com/w3c/wcag/issues/1698)\n\n[https://github.com/w3c/wcag/issues/2357](https://github.com/w3c/wcag/issues/2357)\n\n[https://github.com/w3c/wcag/issues/3553](https://github.com/w3c/wcag/issues/3553)\n\n[https://github.com/w3c/wcag/issues/4791](https://github.com/w3c/wcag/issues/4791)\n\n \nReference: [Spec DE077](https://docs.google.com/document/d/1FGtZ1ZOQ3QcYQ4-3nCh4jnycw7aeEN2l_XgmpFlFHq0/edit?tab=t.0)";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.How-to-support-modifiers-in-a-component a ds:Concept;
|
|
6
|
+
ds:name "How to support modifiers in a component";
|
|
7
|
+
ds:summary "This guide covers the steps to make a component follow modifiers: identifying its colour properties, adding the modifier channel and surface fallbacks, adding interaction state tokens, and testing across modifier classes and themes.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-09-11 \n**Source:** `@canonical/react-tokens` Storybook guide — _How to support modifiers in a component_\n\n\nThis guide shows you how to make a component respond to modifier classes (`.error`, `.success`, `.warning`, etc.) through the token channel variable system. No JavaScript is involved.\n\n## Prerequisites\n\n- A working React component with CSS\n- `@canonical/styles` imported in your project\n- Familiarity with CSS custom properties\n\n## Steps\n\n### 1. Identify the color properties in your component\n\nList every CSS property that sets a color. These are the properties that need modifier support:\n\n\\`\\`\\`css\n/* Before: direct semantic references */\n.ds.my-component {\n color: var(--color-text);\n border-color: var(--color-border);\n background: var(--color-foreground-ghost);\n}\n\\`\\`\\`\n\n### 2. Add the modifier channel fallback\n\nFor each color property, prepend the matching `--modifier-*` channel variable:\n\n\\`\\`\\`css\n/* After: modifier-aware */\n.ds.my-component {\n color: var(--modifier-color-text, var(--color-text));\n border-color: var(--modifier-color-border, var(--color-border));\n background: var(--modifier-color-foreground-ghost, var(--color-foreground-ghost));\n}\n\\`\\`\\`\n\nThe channel variable names follow a consistent pattern: `--modifier-color-{rest}` where `{rest}` matches the base semantic token name after `--color-`.\n\n| Base semantic token | Modifier channel |\n|--------------------|-----------------|\n| `--color-text` | `--modifier-color-text` |\n| `--color-border` | `--modifier-color-border` |\n| `--color-icon-default` | `--modifier-color-icon` |\n| `--color-foreground-primary` | `--modifier-color-foreground-primary` |\n| `--color-foreground-ghost` | `--modifier-color-foreground-ghost` |\n| `--color-foreground-input` | `--modifier-color-foreground-input` |\n| `--color-focus-ring` | `--modifier-color-focus-ring` |\n\n### 3. Add surface fallbacks (if applicable)\n\nIf the component renders a background or sits inside layered containers, add the surface channel between modifier and base:\n\n\\`\\`\\`css\n.ds.my-component {\n background: var(\n --modifier-color-foreground-ghost,\n var(--surface-color-foreground-ghost,\n var(--color-foreground-ghost))\n );\n}\n\\`\\`\\`\n\nFor the component's own background when it acts as a surface:\n\n\\`\\`\\`css\n.ds.my-component {\n background: var(--surface-color-background, var(--color-background));\n}\n\\`\\`\\`\n\n### 4. Add interaction state tokens (if interactive)\n\nFor hover, active, and disabled states on interactive elements:\n\n\\`\\`\\`css\n.ds.my-component:hover {\n background: var(\n --hover--color-foreground-primary,\n var(--modifier-color-foreground-primary,\n var(--color-foreground-primary))\n );\n}\n\n.ds.my-component:active {\n background: var(\n --active--color-foreground-primary,\n var(--modifier-color-foreground-primary,\n var(--color-foreground-primary))\n );\n}\n\n.ds.my-component:disabled {\n background: var(\n --disabled--color-foreground-primary,\n var(--modifier-color-foreground-primary,\n var(--color-foreground-primary))\n );\n}\n\\`\\`\\`\n\n### 5. Test with modifier classes\n\nWrap your component in modifier containers to verify:\n\n\\`\\`\\`html\n<!-- Default (no modifier) -->\n<MyComponent />\n\n<!-- Error context -->\n<div class=\"error\">\n <MyComponent />\n</div>\n\n<!-- Success context -->\n<div class=\"success\">\n <MyComponent />\n</div>\n\n<!-- Warning context -->\n<div class=\"warning\">\n <MyComponent />\n</div>\n\\`\\`\\`\n\nIn Storybook, the **Modifiers story** demonstrates this pattern with live token tables.\n\n### 6. Test across themes\n\nSwitch the Storybook theme between light and dark. All modifier colors should remain legible because the modifier-specific semantic tokens (like `--color-text-error`) carry paired light/dark values.\n\n## Variations\n\n### Components that only need text/icon color\n\nSimple components like labels or badges may only need the text channel:\n\n\\`\\`\\`css\n.ds.label {\n color: var(--modifier-color-text, var(--color-text));\n}\n\\`\\`\\`\n\n### Components with multiple color zones\n\nComplex components like cards may have a header with a background and a body with text. Apply the appropriate channel to each zone:\n\n\\`\\`\\`css\n.ds.card {\n & > .header {\n background: var(--modifier-color-foreground-primary, var(--color-foreground-primary));\n color: var(--color-text-on-foreground);\n }\n\n & > .body {\n color: var(--modifier-color-text, var(--color-text));\n border-top-color: var(--modifier-color-border, var(--color-border-subtle));\n }\n}\n\\`\\`\\`\n\n> **Note**: `--color-text-on-foreground` does not have a modifier channel because it is always read on top of a foreground surface. Its value adapts via theme pairing, not modifier rebinding.\n\n## Troubleshooting\n\n### Colors don't change inside `.error`\n\nVerify you are using the modifier channel `var(--modifier-color-text, ...)` and not a direct `var(--color-text)` reference. The modifier class only sets `--modifier-*` variables — it cannot intercept a direct semantic reference.\n\n### Colors look wrong in nested modifiers\n\nIf a component is inside both `.error` and an inner `.success`, the inner modifier wins because CSS custom properties inherit to the closest ancestor. This is expected behavior. If you need to prevent nesting, that is a layout concern, not a token concern.\n\n### Focus ring doesn't change\n\nUse `--modifier-color-focus-ring` for the focus ring color:\n\n\\`\\`\\`css\n.ds.input:focus-visible {\n outline-color: var(--modifier-color-focus-ring, var(--color-focus-ring));\n}\n\\`\\`\\`\n\n## Related\n\n- **How to find the right token** — token selection guide\n- **The Modifier Contract** — understanding why channels exist\n- **How to handle token changes** — managing pre-1.0 token changes";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Intentional-friction a ds:Concept;
|
|
6
|
+
ds:name "Intentional friction";
|
|
7
|
+
ds:summary "Design friction is the intentional use of obstacles in a user interface to prevent accidental or destructive mistakes. It should be used when a user is about to perform an action that is irreversible, such as deleting data or changing permanent system settings.\n\nFor high-risk tasks, use blocking friction like requiring the user to type a confirmation word or check a box acknowledging specific risks. For medium-risk or advanced settings, use non-blocking friction like warning dialogs or technical language to ensure the user is acting deliberately rather than clicking through mindlessly.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "It is sometimes desirable to introduce some friction in flows so users are fully aware of risks and take any irreversible or destructive actions knowingly. This friction is not supposed to be a substantial nuisance that keeps the user from acting deliberately, but instead a guardrail to prevent accidental interactions.\n\nFor instance, a user using a wizard may be tempted to click repeatedly on the “Next” button. This may be OK in many cases. For instance, the defaults for the Ubuntu installer may work well enough when setting up a virtual machine. However, you may decide to disable that “Next” button in critical steps to prevent the user from taking destructive actions (like wiping a drive or not saving their recovery key) without explicitly acknowledging the risks (losing their data).\n\n### Blocking friction\n\nAdding friction that blocks the user from continuing the flow unless taking a very deliberate action is ideal for **destructive** actions.\n\nFor destructive actions, you may:\n\n- **Ask the user to type a word:** you may ask the user to type either the name of the action (e.g. “delete”) or the name of the object that will be destroyed (e.g. a VM or repository name).\n\n \n\n\n\n\n\n\nFor *potentially* destructive actions, you may:\n\n- **Ask the user to acknowledge risk**: similar to the way we collect legal consent, it should be voiced in first tense, e.g. “I understand the risk”, ideally explaining the risk (e.g. “I understand all my data may get lost”. This is a well established pattern in registration forms, so we can expect users to understand what it conveys.\n- **Ask the user to confirm they have taken precautions**: if there is any action that the user can take to avoid the actions becoming destructive (e.g. “I have recovery keys for all my encrypted disks”)\n\n \n\n\n\n\n### Non-blocking friction\n\nNon-blocking callouts are ideal for **mildly problematic or irreversible, non-destructive** actions. Example: FIPS is an advanced option in Ubuntu Pro that facilitates compliance with government standards, so it’s only useful for a minority of users. Once enabled, it cannot be disabled and Livepatch is permanently disabled.\n\n\n\nIn these cases, you may:\n\n- **Add a dialog to confirm the action**: It will add one extra step to the process, and the distinctive design will help grab the user's attention, but it will only add one extra click.\n\n \n\n\n\n\n\n\n- **Show a warning message**: May be good enough for irreversible, non-destructive actions\n - Use in Vanilla or warning info panel in Yaru.\n\n \n\n\n\n\nYou may also rely on **obscurity**. If an action is only supposed to be used by advanced users that know what they are doing, or in very specific circumstances, you may choose to make the option less visible, or to use technical language that will discourage users from playing with it. This will force users to be more deliberate, perhaps by relying on fully-fledged documentation that can provide full context.";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
2
4
|
|
|
3
5
|
ds:concept.Question-mark-vs-information-icon a ds:Concept;
|
|
4
6
|
ds:name "Question mark vs information icon";
|
|
5
7
|
ds:summary "*This concept is a stub.*\n\nThis article will help you decide between using the information icon or the question mark icon in your application when you want to signal to users that there is more information available on a specific topic. ";
|
|
6
8
|
ds:tier ds:global;
|
|
7
|
-
ds:content "The information icon signals 'Here is additional context you might find useful,' making it a bit more proactive in offering supplementary details. The question mark icon signals 'Need help understanding this?', making it a bit more reactive and assuming that the user might be confused or unfamiliar with the concept.\n\nThere is a soft convention is that “the question mark icon indicates extensive help is available, provides an interface for someone having a problem to click, and implies that a more sophisticated means of resolving the problem is being offered. The information icon indicates only that some additional explanatory information is available, but not an extensive help system.”1 \n \nWith the `i` the system offers the additional information to the user, that may be useful even when he does not have a question.\n\nSo `i` is the right icon to use if you have information that:\n\n- the user would not ask for, because he's not missing it\n- is useful for a user who is interested in the details.\n\n\n\nWith the `**?**`, the system offers the information to the user, that he needs when he has a question.\n\nSo `?` is the right icon to use if you have information that:\n\n- would unblock the user\n- would offer extensive supplimentary help\n\nIcons depend heavily on the visual conventions a user has been exposed to, so how they interpret an icon will often come down to their cultural background and prior experience. Ultimately, the accompanying text or tooltip is what communicates our intention to the user. However some additional internal research has proven the above assumptions.\n\n\n\n### Source\n\n1. [https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark](https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark)\n\n\n\n### References\n\n[https://www.nngroup.com/articles/info-tips-bad/](https://www.nngroup.com/articles/info-tips-bad/)\n\n[https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN](https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN)\n\n[https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help](https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help)\n\n[https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui](https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui)\n\n";
|
|
9
|
+
ds:content "The information icon signals 'Here is additional context you might find useful,' making it a bit more proactive in offering supplementary details. The question mark icon signals 'Need help understanding this?', making it a bit more reactive and assuming that the user might be confused or unfamiliar with the concept.\n\nThere is a soft convention is that “the question mark icon indicates extensive help is available, provides an interface for someone having a problem to click, and implies that a more sophisticated means of resolving the problem is being offered. The information icon indicates only that some additional explanatory information is available, but not an extensive help system.”1 \n \nWith the `i` the system offers the additional information to the user, that may be useful even when he does not have a question.\n\nSo `i` is the right icon to use if you have information that:\n\n- the user would not ask for, because he's not missing it\n- is useful for a user who is interested in the details.\n\nInformation exposed only through a tooltip must never be essential to completing the task.\n\n\n\nWith the `**?**`, the system offers the information to the user, that he needs when he has a question.\n\nSo `?` is the right icon to use if you have information that:\n\n- would unblock the user\n- would offer extensive supplimentary help\n\nIcons depend heavily on the visual conventions a user has been exposed to, so how they interpret an icon will often come down to their cultural background and prior experience. Ultimately, the accompanying text or tooltip is what communicates our intention to the user. However some additional internal research has proven the above assumptions.\n\n \nThe interaction and triggered component also varies depending on the provided information. This is how to decide what to do:\n\nIs the information necessary to complete the task? \n│ \n├── YES \n│ └── Don't hide it in a tooltip. \n│ Use visible helper text / inline guidance. \n│ \n└── NO \n │ \n Is it brief and contextual? \n │ \n ├── YES \n │ └── i + tooltip \n │ \n └── NO \n │ \n Is it contextual and can be understood \n without leaving the current task? \n │ \n ├── YES \n │ └── i + toggletip/popover \n │ \n └── NO \n └── ? icon button + link to help/documentation\n\n### Source\n\n1. [https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark](https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark)\n\n\n\n### References\n\n[https://www.nngroup.com/articles/info-tips-bad/](https://www.nngroup.com/articles/info-tips-bad/)\n\n[https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN](https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN)\n\n[https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help](https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help)\n\n[https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui](https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui)\n\n[https://uxmovement.com/forms/question-mark-vs-info-icon-when-to-use-which/](https://uxmovement.com/forms/question-mark-vs-info-icon-when-to-use-which/)\n\n";
|
|
8
10
|
ds:knownEdgeCases "";
|
|
9
11
|
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Understanding-the-modifier-contract a ds:Concept;
|
|
6
|
+
ds:name "Understanding the modifier contract";
|
|
7
|
+
ds:summary "This document covers what modifiers are and the contract between the modifier side and the component side: the problem modifiers solve, the modifier families, how nesting and overrides behave, where modifiers sit in the cascade, and what modifiers deliberately do not do.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-09-11 \n**Source:** `@canonical/react-tokens` Storybook guide — _Understanding the Modifier Contract_\n\n\nModifiers are the mechanism through which a parent container changes the visual output of every descendant component — without those components knowing about the modifier, and without any prop drilling or runtime logic.\n\nThis page explains the contract between modifier classes and component styles.\n\n## The problem modifiers solve\n\nA form has an error. The form's border should turn red, but so should the label text, the input border, the icon color, and the helper text — every piece of the form's visual output should shift to communicate the error state.\n\nWithout modifiers, you would need to thread an `intent=\"error\"` prop into every child component. This couples components to specific contexts, requires runtime coordination, and makes composition fragile. If you add a new child to the form, you must remember to pass the prop.\n\nModifiers solve this by letting a single ancestor class change every descendant's output simultaneously through the CSS cascade. No prop drilling, no React context, no JavaScript at all.\n\n## How the contract works\n\nThe modifier contract has two sides: the **modifier class** sets channel variables, and **component styles** read them through fallback chains.\n\n### The modifier side\n\nWhen an ancestor element applies a modifier class like `.error`, it sets a group of **channel variables**:\n\n\\`\\`\\`css\n.error {\n --modifier-color-text: var(--color-text-error);\n --modifier-color-border: var(--color-border-error);\n --modifier-color-icon: var(--color-icon-error);\n --modifier-color-foreground-input: var(--color-foreground-input-error);\n --modifier-color-focus-ring: var(--color-focus-ring-error);\n}\n\\`\\`\\`\n\nThese channel variables are prefixed with `--modifier-` to make their role explicit. They are intermediate — set by modifiers, read by components — and they point to intent-specific semantic tokens (`--color-text-error`, `--color-border-error`).\n\n### The component side\n\nComponents read the channel variable first, with a fallback to the base semantic token:\n\n\\`\\`\\`css\n.button {\n color: var(--modifier-color-text, var(--color-text));\n border-color: var(--modifier-color-border, var(--color-border));\n}\n\\`\\`\\`\n\nOutside any modifier context, `--modifier-color-text` is unset, and the component falls through to `--color-text`. Inside `.error`, the channel variable resolves to the error text color. Inside `.success`, it resolves to the success text color. The component code is identical in every case.\n\n## Modifier families\n\nThe system defines several modifier families, each setting the same channel variables to different intent-specific values:\n\n| Family | Classes | Purpose |\n|--------|---------|---------|\n| **Criticality** | `.error`, `.warning`, `.success`, `.information` | Feedback states for forms and alerts |\n| **Emphasis** | `.muted`, `.branded` | Visual prominence adjustment |\n| **Anticipation** | `.constructive`, `.destructive`, `.caution` | Expected outcome of an action |\n\nAll families set the same channel variables. This uniformity means a component that supports `.error` automatically supports `.constructive`, `.branded`, and every other modifier — the component does not distinguish between them.\n\n## Why this matters for composition\n\nThe channel variable indirection is what makes modifiers compositional. Consider a form:\n\n\\`\\`\\`html\n<form class=\"error\">\n <label>Email</label>\n <input type=\"email\" />\n <span class=\"helper-text\">Please enter a valid email</span>\n</form>\n\\`\\`\\`\n\nThe label, input, and helper text all read `--modifier-color-text`. None of them know about `.error`. If you replace `.error` with `.warning`, every descendant's color shifts. If you add a new component inside the form, it automatically participates in the modifier context as long as it reads the channel variable.\n\nThis compositionality breaks if a component references `--color-text-error` directly. That hard-codes the intent and prevents the component from working inside `.warning` or `.success` contexts. The contract is: **components reference channels, not intents**.\n\n## Nesting and override behavior\n\nModifiers can nest. An `.error` form might contain a `.success` badge:\n\n\\`\\`\\`html\n<form class=\"error\">\n <div class=\"success\">\n <span>Verified</span>\n </div>\n</form>\n\\`\\`\\`\n\nThe inner `.success` sets `--modifier-color-text` to the success text color, overriding the `.error` value for its descendants. CSS custom property inheritance handles this automatically — the closest ancestor setting a channel variable wins.\n\nThis means modifiers compose without special logic: the last modifier in the DOM tree determines the visual output.\n\n## What modifiers do not do\n\nModifiers **do not** change layout, spacing, or typography. They only affect color-related channel variables. This is a deliberate constraint — color is the visual property most affected by context (error, success, brand emphasis), while layout is determined by the component's own specifications.\n\nModifiers also do not affect primitive tokens. A palette color like `--color-palette-red-600` is the same everywhere. Only semantic tokens participate in the modifier system, because only semantic tokens carry intent.\n\n## The cascade position\n\nModifier channel variables live in `@layer ds.modifiers`, which overrides `@layer ds.tokens` (base semantic values). This means a modifier can override a semantic token's value regardless of selector specificity, and a surface channel (in `@layer ds.surfaces`) can in turn override a modifier channel when appropriate.\n\nThe layered cascade ensures a predictable resolution order: tokens → modifiers → surfaces → states.\n\n## Common misconceptions\n\n### \"Modifiers change the theme\"\n\nModifiers do not change the theme. Theme switching (light/dark) changes _which values_ semantic tokens resolve to. Modifiers change _which semantic tokens_ a component reads. An `.error` modifier works identically in light mode and dark mode — the error text color is defined for both themes in the semantic token layer.\n\n### \"Components should detect the modifier\"\n\nComponents should not detect or respond to modifiers through JavaScript. The entire mechanism is CSS-only. A component that checks `classList.contains('error')` has broken the contract — it now depends on a specific modifier instead of reading the channel.\n\n### \"I need a new modifier for my use case\"\n\nNew modifiers are rarely needed. The existing families cover the standard intent space. If you need a novel color context, first check whether a combination of existing modifiers and surfaces achieves the result. If a new modifier family is genuinely needed, it should be added to `@canonical/styles` so that all components benefit from it.\n\n## Further reading\n\n- **Token Architecture**: why the system has three tiers\n- **Surface Depth Model**: how surfaces interact with modifiers\n- **How to support modifiers in a component**: practical steps for modifier integration\n- **Modifiers story**: live demonstration of modifier rebinding";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|