@maz-ui/mcp 5.0.1-beta.0 → 5.1.0-beta.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/README.md +61 -228
- package/bin/maz-ui-mcp.mjs +2 -5
- package/dist/cli.d.mts +7 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.mjs +16 -0
- package/dist/index.d.mts +345 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.mjs +16 -0
- package/dist/shared/mcp.DseFuKdl.mjs +2968 -0
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +78 -0
- package/docs/{src/components → components}/maz-alert.md +31 -164
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/{src/components → components}/maz-badge.md +26 -67
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/{src/components → components}/maz-btn-group.md +27 -189
- package/docs/{src/components → components}/maz-btn.md +62 -245
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/{src/components → components}/maz-card.md +67 -192
- package/docs/components/maz-carousel.md +153 -0
- package/docs/{src/components → components}/maz-chart.md +17 -161
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/{src/components → components}/maz-code-highlight.md +15 -93
- package/docs/components/maz-container.md +241 -0
- package/docs/{src/components → components}/maz-date-picker.md +85 -454
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +107 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/{src/components → components}/maz-dropzone.md +80 -221
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/{src/components → components}/maz-icon.md +32 -83
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/{src/components → components}/maz-input.md +74 -221
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/{src/components → components}/maz-markdown-editor.md +72 -125
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/{src/components → components}/maz-read-more.md +31 -122
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/{src/components → components}/maz-select-country.md +80 -340
- package/docs/{src/components → components}/maz-select.md +76 -206
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/{src/components → components}/maz-sidebar.md +117 -329
- package/docs/{src/components → components}/maz-skeleton.md +27 -156
- package/docs/{src/components → components}/maz-slider.md +33 -66
- package/docs/components/maz-spinner.md +84 -0
- package/docs/{src/components → components}/maz-stepper.md +48 -185
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/{src/components → components}/maz-tabs.md +89 -126
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/{src/components → components}/maz-window-mockup.md +38 -105
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/{src/composables → composables}/use-display-names.md +12 -59
- package/docs/{src/composables → composables}/use-drag.md +14 -68
- package/docs/{src/composables → composables}/use-form-validator.md +22 -696
- package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
- package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
- package/docs/{src/composables → composables}/use-reading-time.md +20 -56
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/{src/composables → composables}/use-swipe.md +14 -81
- package/docs/{src/composables → composables}/use-timer.md +12 -38
- package/docs/composables/use-toast.md +50 -0
- package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/{src/directives → directives}/click-outside.md +13 -99
- package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
- package/docs/{src/directives → directives}/lazy-img.md +14 -49
- package/docs/{src/directives → directives}/tooltip.md +12 -217
- package/docs/{src/directives → directives}/zoom-img.md +11 -38
- package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/{src/ecosystem → ecosystem}/icons/index.md +21 -15
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/{src/ecosystem → ecosystem}/nuxt.md +50 -19
- package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
- package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
- package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
- package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
- package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
- package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
- package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
- package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
- package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
- package/docs/guide/ai-agents.md +239 -0
- package/docs/{src/guide → guide}/browser-support.md +22 -15
- package/docs/{src/guide → guide}/getting-started.md +34 -139
- package/docs/{src/guide → guide}/global-defaults.md +12 -11
- package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
- package/docs/{src/guide → guide}/migration-v5.md +95 -88
- package/docs/{src/guide → guide}/resolvers.md +33 -100
- package/docs/guide/tailwind.md +507 -0
- package/docs/{src/guide → guide}/vue.md +33 -39
- package/docs/manifest.json +1 -0
- package/docs/{src/plugins → plugins}/aos.md +20 -55
- package/docs/{src/plugins → plugins}/dialog.md +14 -161
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +59 -0
- package/package.json +86 -22
- package/dist/mcp.d.mts +0 -153
- package/dist/mcp.d.ts +0 -153
- package/dist/mcp.mjs +0 -1511
- package/docs/generated-docs/maz-accordion.doc.md +0 -21
- package/docs/generated-docs/maz-alert.doc.md +0 -20
- package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
- package/docs/generated-docs/maz-animated-element.doc.md +0 -14
- package/docs/generated-docs/maz-animated-text.doc.md +0 -17
- package/docs/generated-docs/maz-avatar.doc.md +0 -45
- package/docs/generated-docs/maz-backdrop.doc.md +0 -55
- package/docs/generated-docs/maz-badge.doc.md +0 -16
- package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
- package/docs/generated-docs/maz-btn-group.doc.md +0 -20
- package/docs/generated-docs/maz-btn.doc.md +0 -33
- package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
- package/docs/generated-docs/maz-card.doc.md +0 -39
- package/docs/generated-docs/maz-carousel.doc.md +0 -17
- package/docs/generated-docs/maz-chart.doc.md +0 -10
- package/docs/generated-docs/maz-checkbox.doc.md +0 -33
- package/docs/generated-docs/maz-checklist.doc.md +0 -30
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
- package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
- package/docs/generated-docs/maz-container.doc.md +0 -26
- package/docs/generated-docs/maz-date-picker.doc.md +0 -56
- package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
- package/docs/generated-docs/maz-dialog.doc.md +0 -22
- package/docs/generated-docs/maz-drawer.doc.md +0 -25
- package/docs/generated-docs/maz-dropdown.doc.md +0 -45
- package/docs/generated-docs/maz-dropzone.doc.md +0 -82
- package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
- package/docs/generated-docs/maz-gallery.doc.md +0 -17
- package/docs/generated-docs/maz-icon.doc.md +0 -16
- package/docs/generated-docs/maz-input-code.doc.md +0 -25
- package/docs/generated-docs/maz-input-number.doc.md +0 -33
- package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
- package/docs/generated-docs/maz-input-price.doc.md +0 -26
- package/docs/generated-docs/maz-input-tags.doc.md +0 -24
- package/docs/generated-docs/maz-input.doc.md +0 -54
- package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
- package/docs/generated-docs/maz-link.doc.md +0 -31
- package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
- package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
- package/docs/generated-docs/maz-pagination.doc.md +0 -21
- package/docs/generated-docs/maz-popover.doc.md +0 -79
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
- package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
- package/docs/generated-docs/maz-radio.doc.md +0 -33
- package/docs/generated-docs/maz-read-more.doc.md +0 -18
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
- package/docs/generated-docs/maz-select-country.doc.md +0 -45
- package/docs/generated-docs/maz-select.doc.md +0 -32
- package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
- package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
- package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar.doc.md +0 -36
- package/docs/generated-docs/maz-skeleton.doc.md +0 -12
- package/docs/generated-docs/maz-slider.doc.md +0 -20
- package/docs/generated-docs/maz-spinner.doc.md +0 -6
- package/docs/generated-docs/maz-stepper.doc.md +0 -30
- package/docs/generated-docs/maz-switch.doc.md +0 -31
- package/docs/generated-docs/maz-table-cell.doc.md +0 -5
- package/docs/generated-docs/maz-table-row.doc.md +0 -12
- package/docs/generated-docs/maz-table-title.doc.md +0 -5
- package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
- package/docs/generated-docs/maz-table.doc.md +0 -72
- package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
- package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
- package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
- package/docs/generated-docs/maz-tabs.doc.md +0 -20
- package/docs/generated-docs/maz-textarea.doc.md +0 -46
- package/docs/generated-docs/maz-ticker.doc.md +0 -25
- package/docs/generated-docs/maz-timeline.doc.md +0 -32
- package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
- package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
- package/docs/src/blog/v4.md +0 -276
- package/docs/src/blog/v5.md +0 -184
- package/docs/src/changelog.md +0 -7
- package/docs/src/components/index.md +0 -8
- package/docs/src/components/maz-accordion.md +0 -80
- package/docs/src/components/maz-animated-counter.md +0 -124
- package/docs/src/components/maz-animated-element.md +0 -36
- package/docs/src/components/maz-animated-text.md +0 -36
- package/docs/src/components/maz-avatar.md +0 -227
- package/docs/src/components/maz-backdrop.md +0 -250
- package/docs/src/components/maz-bottom-sheet.md +0 -533
- package/docs/src/components/maz-card-spotlight.md +0 -163
- package/docs/src/components/maz-carousel.md +0 -231
- package/docs/src/components/maz-checkbox.md +0 -168
- package/docs/src/components/maz-checklist.md +0 -414
- package/docs/src/components/maz-circular-progress-bar.md +0 -145
- package/docs/src/components/maz-container.md +0 -363
- package/docs/src/components/maz-dialog-confirm.md +0 -240
- package/docs/src/components/maz-dialog.md +0 -164
- package/docs/src/components/maz-drawer.md +0 -181
- package/docs/src/components/maz-dropdown.md +0 -691
- package/docs/src/components/maz-expand-animation.md +0 -99
- package/docs/src/components/maz-fullscreen-loader.md +0 -58
- package/docs/src/components/maz-gallery.md +0 -85
- package/docs/src/components/maz-input-code.md +0 -61
- package/docs/src/components/maz-input-number.md +0 -81
- package/docs/src/components/maz-input-phone-number.md +0 -942
- package/docs/src/components/maz-input-price.md +0 -67
- package/docs/src/components/maz-input-tags.md +0 -114
- package/docs/src/components/maz-lazy-img.md +0 -88
- package/docs/src/components/maz-link.md +0 -178
- package/docs/src/components/maz-loading-bar.md +0 -26
- package/docs/src/components/maz-pagination.md +0 -79
- package/docs/src/components/maz-popover.md +0 -1416
- package/docs/src/components/maz-radio-buttons.md +0 -462
- package/docs/src/components/maz-radio.md +0 -142
- package/docs/src/components/maz-reading-progress-bar.md +0 -74
- package/docs/src/components/maz-spinner.md +0 -93
- package/docs/src/components/maz-switch.md +0 -92
- package/docs/src/components/maz-table.md +0 -732
- package/docs/src/components/maz-textarea.md +0 -400
- package/docs/src/components/maz-ticker.md +0 -692
- package/docs/src/components/maz-timeline.md +0 -478
- package/docs/src/composables/use-aos.md +0 -34
- package/docs/src/composables/use-breakpoints.md +0 -35
- package/docs/src/composables/use-dialog.md +0 -88
- package/docs/src/composables/use-string-matching.md +0 -63
- package/docs/src/composables/use-toast.md +0 -71
- package/docs/src/composables/use-wait.md +0 -62
- package/docs/src/composables/use-window-size.md +0 -18
- package/docs/src/ecosystem/icons/icon-set.md +0 -123
- package/docs/src/ecosystem/mcp.md +0 -210
- package/docs/src/ecosystem/node/index.md +0 -53
- package/docs/src/ecosystem/utils/camel-case.md +0 -31
- package/docs/src/ecosystem/utils/capitalize.md +0 -50
- package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
- package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
- package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
- package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
- package/docs/src/ecosystem/utils/is-server.md +0 -31
- package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
- package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
- package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
- package/docs/src/ecosystem/utils/upper-first.md +0 -32
- package/docs/src/guide/cli.md +0 -144
- package/docs/src/guide/migration-v4.md +0 -925
- package/docs/src/guide/tailwind.md +0 -158
- package/docs/src/index.md +0 -603
- package/docs/src/made-with-maz-ui.md +0 -58
- package/docs/src/plugins/toast.md +0 -349
- package/docs/src/plugins/wait.md +0 -109
- package/docs/src/theme-editor.md +0 -21
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Theming
|
|
3
|
-
description: Modern and performant theme system for Maz-UI built on native CSS features (light-dark(), color-scheme, color-mix(in oklch)) for v5.
|
|
2
|
+
title: "Theming"
|
|
3
|
+
description: "Modern and performant theme system for Maz-UI built on native CSS features (light-dark(), color-scheme, color-mix(in oklch)) for v5."
|
|
4
|
+
package: "@maz-ui/themes"
|
|
5
|
+
url: "https://maz-ui.com/ecosystem/themes"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# Theming
|
|
7
9
|
|
|
8
|
-
Modern and performant theme system for Maz-UI built on native CSS features (
|
|
10
|
+
> Modern and performant theme system for Maz-UI built on native CSS features (light-dark(), color-scheme, color-mix(in oklch)) for v5.
|
|
11
|
+
|
|
12
|
+
- Package: `@maz-ui/themes`
|
|
13
|
+
- Import: `import { definePreset, useTheme } from '@maz-ui/themes'` or `import { mazUi } from '@maz-ui/themes/presets/mazUi'`
|
|
14
|
+
- Web: https://maz-ui.com/ecosystem/themes
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
Modern and performant theme system for Maz-UI built on native CSS features (`light-dark()`, `color-scheme`, `color-mix(in oklch)`) for v5.
|
|
11
17
|
|
|
12
18
|
## Features
|
|
13
19
|
|
|
@@ -15,7 +21,7 @@ Modern and performant theme system for Maz-UI built on native CSS features (`lig
|
|
|
15
21
|
- **Native widget theming** - `color-scheme` makes scrollbars, native `<select>`, date pickers and autofill follow the active mode automatically
|
|
16
22
|
- **Animated theme switch** - Optional full-page View Transitions via `setColorMode(..., { animate: true })`
|
|
17
23
|
- **Anti-FART** - `<meta name="color-scheme">` injected at boot to prevent any Flash of inAccurate coloR Theme (no setup needed)
|
|
18
|
-
- **Automatic color scales** - `--maz-X-50` through `--maz-X-950` derived via OKLCh relative color syntax
|
|
24
|
+
- **Automatic color scales** - `--maz-X-50` through `--maz-X-950` derived via OKLCh relative color syntax - perceptually uniform and chroma-preserving
|
|
19
25
|
- **Performance Strategies** - Runtime injection or build-time generation according to your needs
|
|
20
26
|
- **Strict TypeScript** - Complete types for perfect DX
|
|
21
27
|
- **Zero FOUC** - Pass the preset object up front; the full CSS is injected synchronously on first paint
|
|
@@ -23,7 +29,7 @@ Modern and performant theme system for Maz-UI built on native CSS features (`lig
|
|
|
23
29
|
|
|
24
30
|
## Theme Editor
|
|
25
31
|
|
|
26
|
-
Create your own theme with the
|
|
32
|
+
Create your own theme with the Theme Editor.
|
|
27
33
|
|
|
28
34
|
## Quick Usage
|
|
29
35
|
|
|
@@ -55,9 +61,9 @@ app.use(MazUi, {
|
|
|
55
61
|
})
|
|
56
62
|
```
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
**Tip: Alternative: MazUiProvider**
|
|
65
|
+
|
|
59
66
|
You can also initialize the theme via the [`MazUiProvider`](../guide/maz-ui-provider.md) component for lazy-loaded pages or subtree-scoped themes.
|
|
60
|
-
:::
|
|
61
67
|
|
|
62
68
|
### 2. Setup your CSS to support theme foundation and dark mode
|
|
63
69
|
|
|
@@ -80,9 +86,9 @@ const { toggleDarkMode, isDark, updateTheme } = useTheme()
|
|
|
80
86
|
</script>
|
|
81
87
|
|
|
82
88
|
<template>
|
|
83
|
-
<div class="
|
|
89
|
+
<div class="bg-surface text-foreground">
|
|
84
90
|
<button
|
|
85
|
-
class="
|
|
91
|
+
class="rounded-md bg-primary text-primary-foreground"
|
|
86
92
|
@click="toggleDarkMode"
|
|
87
93
|
>
|
|
88
94
|
{{ isDark ? '☀️' : '🌙' }} Toggle theme
|
|
@@ -95,21 +101,21 @@ const { toggleDarkMode, isDark, updateTheme } = useTheme()
|
|
|
95
101
|
|
|
96
102
|
- `preset`: The theme preset to use
|
|
97
103
|
- `overrides` (optional): Override specific parts of the theme
|
|
98
|
-
- `strategy` (optional, default `'runtime'`): The rendering strategy to use
|
|
99
|
-
- `darkModeStrategy` (optional, default `'class'`): The dark mode strategy
|
|
100
|
-
- `mode` (optional, default `'both'`): The supported color modes
|
|
101
|
-
- `colorMode` (optional, default `'auto'`): The initial color mode
|
|
104
|
+
- `strategy` (optional, default `'runtime'`): The rendering strategy to use - `'runtime' | 'buildtime'`
|
|
105
|
+
- `darkModeStrategy` (optional, default `'class'`): The dark mode strategy - `'class' | 'media'`, only if you use mode `both`
|
|
106
|
+
- `mode` (optional, default `'both'`): The supported color modes - `'light' | 'dark' | 'both'`
|
|
107
|
+
- `colorMode` (optional, default `'auto'`): The initial color mode - `'light' | 'dark' | 'auto'` (only if mode is `'both'`)
|
|
102
108
|
- `darkClass` (optional, default `'dark'`): Class added to `<html>` when `colorMode === 'dark'`
|
|
103
|
-
- `lightClass` (optional, default `'light'`): Class added to `<html>` when `colorMode === 'light'`
|
|
109
|
+
- `lightClass` (optional, default `'light'`): Class added to `<html>` when `colorMode === 'light'` - mirror of `darkClass`
|
|
104
110
|
- `persistPreset` (optional, default `true`): Persist the active preset name in the `maz-preset` cookie so it is restored on reload.
|
|
105
111
|
|
|
106
112
|
### Preset persistence
|
|
107
113
|
|
|
108
|
-
When `persistPreset` is enabled (default), `@maz-ui/themes` stores the resolved preset name in a `maz-preset` cookie (1-year TTL, `SameSite=Lax`)
|
|
114
|
+
When `persistPreset` is enabled (default), `@maz-ui/themes` stores the resolved preset name in a `maz-preset` cookie (1-year TTL, `SameSite=Lax`) - exactly like `maz-color-mode` for the dark/light state. The cookie is:
|
|
109
115
|
|
|
110
|
-
- **Read at boot** and used to resolve the active preset
|
|
111
|
-
- **Written** after every successful preset resolution and after every `useTheme().updateTheme()` call (idempotent
|
|
112
|
-
- **Auto-cleared** when the saved name no longer resolves (e.g. typo, preset removed in a downgrade)
|
|
116
|
+
- **Read at boot** and used to resolve the active preset - even when `options.preset` is provided. `options.preset` (string name **or** preset object) is treated as the *default* the app boots with, while the cookie carries the user's last explicit choice. The cookie wins.
|
|
117
|
+
- **Written** after every successful preset resolution and after every `useTheme().updateTheme()` call (idempotent - no write if the value already matches).
|
|
118
|
+
- **Auto-cleared** when the saved name no longer resolves (e.g. typo, preset removed in a downgrade) - the runtime falls back to `options.preset` (or default) and clears the cookie silently.
|
|
113
119
|
|
|
114
120
|
Custom preset names are stored exactly like bundled ones: `@maz-ui/themes` does not maintain a whitelist. Switch the option off to disable any cookie read/write:
|
|
115
121
|
|
|
@@ -165,85 +171,12 @@ async function forceDark() {
|
|
|
165
171
|
```
|
|
166
172
|
|
|
167
173
|
- Wraps the switch in `document.startViewTransition()` so the browser captures a snapshot of the page before/after and crossfades between them.
|
|
168
|
-
- The View Transition glue is **lazy-imported**
|
|
174
|
+
- The View Transition glue is **lazy-imported** - when `animate` is not used, it stays out of the boot bundle.
|
|
169
175
|
- **Graceful degradation:** in browsers that don't support the API, the change is applied immediately with no animation (no error thrown).
|
|
170
176
|
|
|
171
177
|
## Interactive Demo
|
|
172
178
|
|
|
173
|
-
|
|
174
|
-
<div class="demo-theme-controls">
|
|
175
|
-
<div class="maz:space-y-4">
|
|
176
|
-
<div class="maz:grid maz:grid-cols-1 maz:md:grid-cols-2 maz:gap-4">
|
|
177
|
-
<MazBtn color="primary">Primary Button</MazBtn>
|
|
178
|
-
<MazBtn color="secondary">Secondary Button</MazBtn>
|
|
179
|
-
<MazBtn color="success">Success Button</MazBtn>
|
|
180
|
-
<MazBtn color="warning">Warning Button</MazBtn>
|
|
181
|
-
</div>
|
|
182
|
-
<div class="theme-controls maz:space-y-4">
|
|
183
|
-
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
184
|
-
<label class="maz:text-sm maz:font-medium">Color Mode: {{ colorMode }}</label>
|
|
185
|
-
<div class="maz:flex maz:gap-2">
|
|
186
|
-
<MazBtn
|
|
187
|
-
size="sm"
|
|
188
|
-
:color="colorMode === 'light' ? 'primary' : 'contrast'"
|
|
189
|
-
@click="setColorMode('light')"
|
|
190
|
-
>
|
|
191
|
-
☀️ Light
|
|
192
|
-
</MazBtn>
|
|
193
|
-
<MazBtn
|
|
194
|
-
size="sm"
|
|
195
|
-
:color="colorMode === 'dark' ? 'primary' : 'contrast'"
|
|
196
|
-
@click="setColorMode('dark')"
|
|
197
|
-
>
|
|
198
|
-
🌙 Dark
|
|
199
|
-
</MazBtn>
|
|
200
|
-
<MazBtn
|
|
201
|
-
size="sm"
|
|
202
|
-
:color="colorMode === 'auto' ? 'primary' : 'contrast'"
|
|
203
|
-
@click="setColorMode('auto')"
|
|
204
|
-
>
|
|
205
|
-
🔄 Auto
|
|
206
|
-
</MazBtn>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
<div class="maz:space-y-2">
|
|
210
|
-
<label class="maz:text-sm maz:font-medium">Preset:</label>
|
|
211
|
-
<div class="maz:flex maz:gap-2">
|
|
212
|
-
<MazBtn
|
|
213
|
-
size="sm"
|
|
214
|
-
:color="presetName === 'maz-ui' ? 'primary' : 'contrast'"
|
|
215
|
-
@click="updateTheme('maz-ui')"
|
|
216
|
-
>
|
|
217
|
-
Maz-UI
|
|
218
|
-
</MazBtn>
|
|
219
|
-
<MazBtn
|
|
220
|
-
size="sm"
|
|
221
|
-
:color="presetName === 'ocean' ? 'primary' : 'contrast'"
|
|
222
|
-
@click="updateTheme('ocean')"
|
|
223
|
-
>
|
|
224
|
-
Ocean
|
|
225
|
-
</MazBtn>
|
|
226
|
-
<MazBtn
|
|
227
|
-
size="sm"
|
|
228
|
-
:color="presetName === 'pristine' ? 'primary' : 'contrast'"
|
|
229
|
-
@click="updateTheme('pristine')"
|
|
230
|
-
>
|
|
231
|
-
Pristine
|
|
232
|
-
</MazBtn>
|
|
233
|
-
<MazBtn
|
|
234
|
-
size="sm"
|
|
235
|
-
:color="presetName === 'obsidian' ? 'primary' : 'contrast'"
|
|
236
|
-
@click="updateTheme('obsidian')"
|
|
237
|
-
>
|
|
238
|
-
Obsidian
|
|
239
|
-
</MazBtn>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
|
|
246
|
-
<template #code>
|
|
179
|
+
**Real-time theme control**
|
|
247
180
|
|
|
248
181
|
```vue
|
|
249
182
|
<script setup>
|
|
@@ -254,16 +187,16 @@ const { presetName, updateTheme, colorMode, setColorMode } = useTheme()
|
|
|
254
187
|
|
|
255
188
|
<template>
|
|
256
189
|
<div class="demo-theme-controls">
|
|
257
|
-
<div class="
|
|
258
|
-
<div class="
|
|
190
|
+
<div class="space-y-4">
|
|
191
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
259
192
|
<MazBtn color="primary">Primary Button</MazBtn>
|
|
260
193
|
<MazBtn color="secondary">Secondary Button</MazBtn>
|
|
261
194
|
<MazBtn color="success">Success Button</MazBtn>
|
|
262
195
|
<MazBtn color="warning">Warning Button</MazBtn>
|
|
263
196
|
</div>
|
|
264
|
-
<div class="theme-controls
|
|
265
|
-
<div class="
|
|
266
|
-
<label class="
|
|
197
|
+
<div class="theme-controls space-y-4">
|
|
198
|
+
<div class="flex items-center gap-4">
|
|
199
|
+
<label class="text-sm font-medium">Mode:</label>
|
|
267
200
|
<MazBtn
|
|
268
201
|
size="sm"
|
|
269
202
|
:color="colorMode === 'light' ? 'primary' : 'secondary'"
|
|
@@ -286,9 +219,9 @@ const { presetName, updateTheme, colorMode, setColorMode } = useTheme()
|
|
|
286
219
|
🔄 Auto
|
|
287
220
|
</MazBtn>
|
|
288
221
|
</div>
|
|
289
|
-
<div class="
|
|
290
|
-
<label class="
|
|
291
|
-
<div class="
|
|
222
|
+
<div class="space-y-2">
|
|
223
|
+
<label class="text-sm font-medium">Preset:</label>
|
|
224
|
+
<div class="flex gap-2">
|
|
292
225
|
<MazBtn
|
|
293
226
|
size="sm"
|
|
294
227
|
:color="presetName === 'maz-ui' ? 'primary' : 'secondary'"
|
|
@@ -325,9 +258,6 @@ const { presetName, updateTheme, colorMode, setColorMode } = useTheme()
|
|
|
325
258
|
</template>
|
|
326
259
|
```
|
|
327
260
|
|
|
328
|
-
</template>
|
|
329
|
-
</ComponentDemo>
|
|
330
|
-
|
|
331
261
|
## Available Presets
|
|
332
262
|
|
|
333
263
|
### Maz-UI (Default)
|
|
@@ -364,7 +294,7 @@ import { obsidian } from '@maz-ui/themes/presets'
|
|
|
364
294
|
|
|
365
295
|
### Nova
|
|
366
296
|
|
|
367
|
-
A modern startup / AI / creative preset
|
|
297
|
+
A modern startup / AI / creative preset - electric violet primary, hot coral secondary, cyan accent. Tight 0.5rem `md` radius, Geist + Inter font stack, snappy ease-out spring. Built for product / AI surfaces (think Linear, Vercel, OpenAI energy) where the UI itself should feel alive.
|
|
368
298
|
|
|
369
299
|
```typescript
|
|
370
300
|
import { nova } from '@maz-ui/themes/presets'
|
|
@@ -374,7 +304,7 @@ import { nova } from '@maz-ui/themes/presets'
|
|
|
374
304
|
|
|
375
305
|
### ⚡ Runtime (Recommended)
|
|
376
306
|
|
|
377
|
-
CSS is generated and injected synchronously on first paint. Pass the preset object directly (`preset: mazUi`) so the full stylesheet is rendered before the first frame
|
|
307
|
+
CSS is generated and injected synchronously on first paint. Pass the preset object directly (`preset: mazUi`) so the full stylesheet is rendered before the first frame - no FOUC.
|
|
378
308
|
|
|
379
309
|
```typescript
|
|
380
310
|
import { mazUi } from '@maz-ui/themes/presets'
|
|
@@ -392,7 +322,7 @@ app.use(MazUi, {
|
|
|
392
322
|
CSS generated at build-time and included in the bundle.
|
|
393
323
|
You have to build your CSS files before running your app.
|
|
394
324
|
|
|
395
|
-
See
|
|
325
|
+
See Build-time for more details.
|
|
396
326
|
|
|
397
327
|
```typescript
|
|
398
328
|
import { mazUi } from '@maz-ui/themes/presets'
|
|
@@ -409,26 +339,7 @@ app.use(MazUi, {
|
|
|
409
339
|
|
|
410
340
|
### Basic Theme
|
|
411
341
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
<ComponentDemo title="Create your own theme">
|
|
415
|
-
<MazBtn @click="applyCustomTheme" color="info">
|
|
416
|
-
Apply Custom Theme
|
|
417
|
-
</MazBtn>
|
|
418
|
-
<MazBtn @click="resetTheme" color="secondary" class="maz:ms-2">
|
|
419
|
-
Reset
|
|
420
|
-
</MazBtn>
|
|
421
|
-
|
|
422
|
-
<div class="maz:mt-4 maz:p-4 maz:bg-primary/10 maz:rounded-md">
|
|
423
|
-
<p v-if="presetName === 'custom-purple'" class="maz:text-primary maz:font-medium">
|
|
424
|
-
Custom theme applied with purple colors!
|
|
425
|
-
</p>
|
|
426
|
-
<p v-else class="maz:text-primary maz:font-medium">
|
|
427
|
-
Default theme
|
|
428
|
-
</p>
|
|
429
|
-
</div>
|
|
430
|
-
|
|
431
|
-
<template #code>
|
|
342
|
+
**Create your own theme**
|
|
432
343
|
|
|
433
344
|
```typescript
|
|
434
345
|
import { definePreset, MazUiTheme, type ThemePresetOverrides, ocean } from '@maz-ui/themes'
|
|
@@ -478,9 +389,6 @@ const { updateTheme } = useTheme()
|
|
|
478
389
|
updateTheme(customTheme)
|
|
479
390
|
```
|
|
480
391
|
|
|
481
|
-
</template>
|
|
482
|
-
</ComponentDemo>
|
|
483
|
-
|
|
484
392
|
### Advanced Theme with Overrides
|
|
485
393
|
|
|
486
394
|
```typescript
|
|
@@ -517,7 +425,7 @@ const brandTheme = await definePreset({
|
|
|
517
425
|
|
|
518
426
|
### Customizing scales
|
|
519
427
|
|
|
520
|
-
Each `ThemeScales` entry maps to a Tailwind utility
|
|
428
|
+
Each `ThemeScales` entry maps to a Tailwind utility - override the keys you care about and the rest stays untouched:
|
|
521
429
|
|
|
522
430
|
```typescript
|
|
523
431
|
const denseTheme = definePreset({
|
|
@@ -525,7 +433,7 @@ const denseTheme = definePreset({
|
|
|
525
433
|
overrides: {
|
|
526
434
|
name: 'dense',
|
|
527
435
|
foundation: {
|
|
528
|
-
// Tighter spacing
|
|
436
|
+
// Tighter spacing - every p-N / gap-N / m-N rescales
|
|
529
437
|
space: '0.2rem',
|
|
530
438
|
},
|
|
531
439
|
scales: {
|
|
@@ -579,7 +487,7 @@ const surfaceTheme = definePreset({
|
|
|
579
487
|
'font-weight': '600',
|
|
580
488
|
},
|
|
581
489
|
container: {
|
|
582
|
-
// Cards / dialogs / popovers / drawers
|
|
490
|
+
// Cards / dialogs / popovers / drawers - light = page surface, dark = a tier above
|
|
583
491
|
bg: { light: 'var(--maz-surface)', dark: 'var(--maz-surface-300)' },
|
|
584
492
|
},
|
|
585
493
|
input: {
|
|
@@ -591,11 +499,11 @@ const surfaceTheme = definePreset({
|
|
|
591
499
|
})
|
|
592
500
|
```
|
|
593
501
|
|
|
594
|
-
Components consume these via `
|
|
502
|
+
Components consume these via `bg-container` / `bg-input` Tailwind utilities, so a single override propagates everywhere - no per-component class hunt.
|
|
595
503
|
|
|
596
504
|
### Dialog sizing
|
|
597
505
|
|
|
598
|
-
`components.dialog` controls the width of [`MazDialog`](
|
|
506
|
+
`components.dialog` controls the width of [`MazDialog`](../components/maz-dialog.md) on tablet and up. The two keys are emitted as `--maz-dialog-max-width` / `--maz-dialog-min-width` and consumed by the component through `var(--maz-dialog-max-width, 38rem)` / `var(--maz-dialog-min-width, 32rem)`:
|
|
599
507
|
|
|
600
508
|
```typescript
|
|
601
509
|
const wideDialogTheme = definePreset({
|
|
@@ -621,7 +529,7 @@ const {
|
|
|
621
529
|
// Reactive state
|
|
622
530
|
preset, // ComputedRef<ThemePreset>
|
|
623
531
|
presetName, // ComputedRef<string>
|
|
624
|
-
colorMode, // Ref<'light' | 'dark' | 'auto'>
|
|
532
|
+
colorMode, // Ref<'light' | 'dark' | 'auto'> - also accepts assignment (computed setter)
|
|
625
533
|
isDark, // ComputedRef<boolean>
|
|
626
534
|
strategy, // ComputedRef<'runtime' | 'buildtime'>
|
|
627
535
|
mode, // ComputedRef<'light' | 'dark' | 'both'>
|
|
@@ -636,14 +544,14 @@ const {
|
|
|
636
544
|
// Set the color mode imperatively
|
|
637
545
|
await setColorMode('dark')
|
|
638
546
|
|
|
639
|
-
// Or assign to `colorMode`
|
|
547
|
+
// Or assign to `colorMode` - it's a computed with a setter
|
|
640
548
|
colorMode.value = 'dark'
|
|
641
549
|
|
|
642
550
|
// Animated full-page switch via View Transitions
|
|
643
551
|
await toggleDarkMode({ animate: true })
|
|
644
552
|
```
|
|
645
553
|
|
|
646
|
-
`setColorMode` and `toggleDarkMode` are **async** (`Promise<void>`). The promise resolves once the change
|
|
554
|
+
`setColorMode` and `toggleDarkMode` are **async** (`Promise<void>`). The promise resolves once the change - and the optional View Transition - has been applied. Callers can ignore the return value when no transition is needed.
|
|
647
555
|
|
|
648
556
|
### Advanced Usage Examples
|
|
649
557
|
|
|
@@ -682,8 +590,6 @@ The build-time strategy allows you to generate your theme CSS files at compile t
|
|
|
682
590
|
|
|
683
591
|
#### 1. Generate CSS
|
|
684
592
|
|
|
685
|
-
::: code-group
|
|
686
|
-
|
|
687
593
|
```typescript [Vue]
|
|
688
594
|
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
689
595
|
import { join } from 'node:path'
|
|
@@ -832,8 +738,6 @@ export default defineConfig({
|
|
|
832
738
|
})
|
|
833
739
|
```
|
|
834
740
|
|
|
835
|
-
:::
|
|
836
|
-
|
|
837
741
|
#### 2. Include in your HTML (Only for Vue users)
|
|
838
742
|
|
|
839
743
|
```html
|
|
@@ -877,7 +781,7 @@ const files = buildSeparateThemeFiles(preset)
|
|
|
877
781
|
|
|
878
782
|
#### `createThemeStylesheet(css, options)`
|
|
879
783
|
|
|
880
|
-
Creates a
|
|
784
|
+
Creates a `
|
|
881
785
|
@reference "../../.vitepress/theme/main.css";
|
|
882
786
|
` tag with the provided CSS.
|
|
883
787
|
|
|
@@ -904,7 +808,7 @@ const styleTag = createThemeStylesheet(css, {
|
|
|
904
808
|
|
|
905
809
|
## Token Reference
|
|
906
810
|
|
|
907
|
-
Every preset emits the same set of CSS variables on `:root`. With `mode: 'both'`, each base color is a single `light-dark(L, D)` declaration that the browser resolves to the active scheme. Use these names directly in your own CSS
|
|
811
|
+
Every preset emits the same set of CSS variables on `:root`. With `mode: 'both'`, each base color is a single `light-dark(L, D)` declaration that the browser resolves to the active scheme. Use these names directly in your own CSS - `var(--maz-primary)`, `calc(var(--maz-space) * 4)`, etc.
|
|
908
812
|
|
|
909
813
|
### Foundation
|
|
910
814
|
|
|
@@ -914,9 +818,9 @@ Single-value design tokens. Set via `foundation.<key>` on the preset.
|
|
|
914
818
|
| --- | --- | --- | --- |
|
|
915
819
|
| `base-font-size` | `--maz-base-font-size` | `14px` | Anchors `rem` for the whole app. Apply on `html { font-size: var(--maz-base-font-size) }`. |
|
|
916
820
|
| `border-width` | `--maz-border-width` | `1px` | Default border for components and the global `*::before/::after` reset. |
|
|
917
|
-
| `space` | `--maz-space` | `0.25rem` | Base step for every Tailwind spacing utility (`
|
|
821
|
+
| `space` | `--maz-space` | `0.25rem` | Base step for every Tailwind spacing utility (`p-1`, `gap-2`, …). |
|
|
918
822
|
| `font-family` | `--maz-font-family` | preset-specific | Sans / body font stack. Bridged to Tailwind `--font-sans`. |
|
|
919
|
-
| `font-mono-stack` | `--maz-font-mono-stack` | `ui-monospace, …` | Monospace stack
|
|
823
|
+
| `font-mono-stack` | `--maz-font-mono-stack` | `ui-monospace, …` | Monospace stack - `MazInputCode`, `<code>`, `<kbd>`. Bridged to `--font-mono`. |
|
|
920
824
|
| `font-display-stack` | `--maz-font-display-stack` | same as `font-family` | Display / heading stack. Bridged to `--font-display`. |
|
|
921
825
|
| `motion-fast` | `--maz-motion-fast` | `100ms` | Bridged to Tailwind `--duration-fast`. |
|
|
922
826
|
| `motion-normal` | `--maz-motion-normal` | `200ms` | Default transition duration (`--default-transition-duration`). |
|
|
@@ -931,28 +835,28 @@ Single-value design tokens. Set via `foundation.<key>` on the preset.
|
|
|
931
835
|
|
|
932
836
|
### Colors
|
|
933
837
|
|
|
934
|
-
Defined per mode under `colors.light` / `colors.dark`. Each base color also gets an automatic 50
|
|
838
|
+
Defined per mode under `colors.light` / `colors.dark`. Each base color also gets an automatic 50-950 scale.
|
|
935
839
|
|
|
936
840
|
| Preset key | CSS variable (base) | Auto scale | Notes |
|
|
937
841
|
| --- | --- | --- | --- |
|
|
938
842
|
| `surface` | `--maz-surface` | `--maz-surface-50..900` | Page / container background. |
|
|
939
843
|
| `foreground` | `--maz-foreground` | `--maz-foreground-50..900` | Default text color. |
|
|
940
844
|
| `primary` | `--maz-primary` | `--maz-primary-50..900` | Brand color. |
|
|
941
|
-
| `primary-foreground` | `--maz-primary-foreground` |
|
|
845
|
+
| `primary-foreground` | `--maz-primary-foreground` | - | Text on `bg-primary`. |
|
|
942
846
|
| `secondary` | `--maz-secondary` | `--maz-secondary-50..900` | |
|
|
943
|
-
| `secondary-foreground` | `--maz-secondary-foreground` |
|
|
847
|
+
| `secondary-foreground` | `--maz-secondary-foreground` | - | |
|
|
944
848
|
| `accent` | `--maz-accent` | `--maz-accent-50..900` | |
|
|
945
|
-
| `accent-foreground` | `--maz-accent-foreground` |
|
|
946
|
-
| `info` | `--maz-info` | `--maz-info-50..900` | Status
|
|
947
|
-
| `info-foreground` | `--maz-info-foreground` |
|
|
948
|
-
| `success` | `--maz-success` | `--maz-success-50..900` | Status
|
|
949
|
-
| `success-foreground` | `--maz-success-foreground` |
|
|
950
|
-
| `warning` | `--maz-warning` | `--maz-warning-50..900` | Status
|
|
951
|
-
| `warning-foreground` | `--maz-warning-foreground` |
|
|
952
|
-
| `destructive` | `--maz-destructive` | `--maz-destructive-50..900` | Status
|
|
953
|
-
| `destructive-foreground` | `--maz-destructive-foreground` |
|
|
849
|
+
| `accent-foreground` | `--maz-accent-foreground` | - | |
|
|
850
|
+
| `info` | `--maz-info` | `--maz-info-50..900` | Status - informational. |
|
|
851
|
+
| `info-foreground` | `--maz-info-foreground` | - | |
|
|
852
|
+
| `success` | `--maz-success` | `--maz-success-50..900` | Status - success. |
|
|
853
|
+
| `success-foreground` | `--maz-success-foreground` | - | |
|
|
854
|
+
| `warning` | `--maz-warning` | `--maz-warning-50..900` | Status - warning. |
|
|
855
|
+
| `warning-foreground` | `--maz-warning-foreground` | - | |
|
|
856
|
+
| `destructive` | `--maz-destructive` | `--maz-destructive-50..900` | Status - error / danger. |
|
|
857
|
+
| `destructive-foreground` | `--maz-destructive-foreground` | - | |
|
|
954
858
|
| `contrast` | `--maz-contrast` | `--maz-contrast-50..900` | High-contrast accent (light = near-black, dark = near-white). |
|
|
955
|
-
| `contrast-foreground` | `--maz-contrast-foreground` |
|
|
859
|
+
| `contrast-foreground` | `--maz-contrast-foreground` | - | |
|
|
956
860
|
| `divider` | `--maz-divider` | `--maz-divider-50..900` | Default border / separator color. |
|
|
957
861
|
| `muted` | `--maz-muted` | `--maz-muted-50..900` | Muted / secondary text. |
|
|
958
862
|
| `overlay` | `--maz-overlay` | `--maz-overlay-50..900` | Backdrop / dialog scrim. |
|
|
@@ -964,14 +868,14 @@ Multi-step scales under `scales.<key>`.
|
|
|
964
868
|
|
|
965
869
|
| Preset key | CSS variables | Tailwind utility |
|
|
966
870
|
| --- | --- | --- |
|
|
967
|
-
| `rounded.xs..3xl` | `--maz-rounded-xs..3xl` | `
|
|
968
|
-
| `shadow.{sm, md, lg, xl, elevation}` | `--maz-shadow-style-{key}` | `
|
|
871
|
+
| `rounded.xs..3xl` | `--maz-rounded-xs..3xl` | `rounded-{key}` (bridged to `--radius-{key}`) |
|
|
872
|
+
| `shadow.{sm, md, lg, xl, elevation}` | `--maz-shadow-style-{key}` | `shadow-{key}` (bridged to `--shadow-{key}`) |
|
|
969
873
|
|
|
970
874
|
> Same naming-collision avoidance as foundation: `rounded.*` (instead of `radius.*`) and `shadow-style-*` (instead of plain `shadow-*`) keep the bridge cycle-free under `prefix(maz)`.
|
|
971
875
|
|
|
972
876
|
### Components
|
|
973
877
|
|
|
974
|
-
Per-component knobs under `components.<key>`. All optional
|
|
878
|
+
Per-component knobs under `components.<key>`. All optional - omit to fall back to the surface tokens.
|
|
975
879
|
|
|
976
880
|
| Preset key | CSS variable | Notes |
|
|
977
881
|
| --- | --- | --- |
|
|
@@ -989,13 +893,13 @@ Each base color is emitted as a `light-dark()` value; scales `--maz-X-50` throug
|
|
|
989
893
|
:root {
|
|
990
894
|
color-scheme: light dark;
|
|
991
895
|
|
|
992
|
-
/* Base colors
|
|
896
|
+
/* Base colors - one declaration each, resolved by the browser */
|
|
993
897
|
--maz-primary: light-dark(oklch(0.65 0.19 254), oklch(0.72 0.18 254));
|
|
994
898
|
--maz-primary-foreground: light-dark(oklch(1 0 0), oklch(0.16 0.01 254));
|
|
995
899
|
--maz-surface: light-dark(oklch(1 0 0), oklch(0.18 0.01 254));
|
|
996
900
|
--maz-foreground: light-dark(oklch(0.26 0.01 254), oklch(0.96 0.005 254));
|
|
997
901
|
|
|
998
|
-
/* Auto-generated 50
|
|
902
|
+
/* Auto-generated 50-950 scale - derived via relative color syntax */
|
|
999
903
|
--maz-primary-500: var(--maz-primary);
|
|
1000
904
|
--maz-primary-600: oklch(from var(--maz-primary) clamp(0, calc(l - 0.07), 1) c h);
|
|
1001
905
|
/* ... */
|
|
@@ -1012,24 +916,21 @@ Each base color is emitted as a `light-dark()` value; scales `--maz-X-50` throug
|
|
|
1012
916
|
--maz-shadow-style-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), …;
|
|
1013
917
|
}
|
|
1014
918
|
|
|
1015
|
-
/* With darkModeStrategy: 'class'
|
|
919
|
+
/* With darkModeStrategy: 'class' - explicit user choice overrides the system */
|
|
1016
920
|
.dark { color-scheme: only dark; }
|
|
1017
921
|
.light { color-scheme: only light; }
|
|
1018
922
|
```
|
|
1019
923
|
|
|
1020
924
|
For deeper detail on the generated CSS contract, see the [`@maz-ui/themes` README](https://github.com/LouisMazel/maz-ui/tree/master/packages/themes#generated-css-variables).
|
|
1021
925
|
|
|
1022
|
-
|
|
1023
926
|
## Usage with Nuxt
|
|
1024
927
|
|
|
1025
|
-
For Nuxt users, check the [dedicated Nuxt documentation](
|
|
928
|
+
For Nuxt users, check the [dedicated Nuxt documentation](./nuxt.md) which covers installation and framework-specific configuration.
|
|
1026
929
|
|
|
1027
930
|
## Migration from Legacy System
|
|
1028
931
|
|
|
1029
932
|
If you're using the legacy theme system with CLI:
|
|
1030
933
|
|
|
1031
|
-
::: code-group
|
|
1032
|
-
|
|
1033
934
|
```typescript [Before (CLI)]
|
|
1034
935
|
// maz-ui.config.ts
|
|
1035
936
|
export default defineConfig({
|
|
@@ -1062,68 +963,4 @@ const myTheme = definePreset({
|
|
|
1062
963
|
app.use(MazUiTheme, { preset: myTheme })
|
|
1063
964
|
```
|
|
1064
965
|
|
|
1065
|
-
:::
|
|
1066
|
-
|
|
1067
966
|
The new system offers much more flexibility and performance!
|
|
1068
|
-
|
|
1069
|
-
<script setup>
|
|
1070
|
-
import { useTheme } from '@maz-ui/themes/composables/useTheme'
|
|
1071
|
-
import { definePreset } from '@maz-ui/themes'
|
|
1072
|
-
import { ref } from 'vue'
|
|
1073
|
-
|
|
1074
|
-
const {
|
|
1075
|
-
isDark,
|
|
1076
|
-
colorMode,
|
|
1077
|
-
preset,
|
|
1078
|
-
setColorMode,
|
|
1079
|
-
updateTheme,
|
|
1080
|
-
presetName
|
|
1081
|
-
} = useTheme()
|
|
1082
|
-
|
|
1083
|
-
const originalPresetName = ref(null)
|
|
1084
|
-
|
|
1085
|
-
const customPreset = await definePreset({
|
|
1086
|
-
base: 'pristine',
|
|
1087
|
-
overrides: {
|
|
1088
|
-
name: 'custom-purple',
|
|
1089
|
-
colors: {
|
|
1090
|
-
light: {
|
|
1091
|
-
'primary': 'oklch(0.62 0.24 305)',
|
|
1092
|
-
'secondary': 'oklch(0.94 0.04 320)',
|
|
1093
|
-
'accent': 'oklch(0.7 0.22 290)'
|
|
1094
|
-
},
|
|
1095
|
-
dark: {
|
|
1096
|
-
'primary': 'oklch(0.72 0.22 305)',
|
|
1097
|
-
'secondary': 'oklch(0.28 0.06 320)',
|
|
1098
|
-
'accent': 'oklch(0.78 0.2 290)'
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
})
|
|
1103
|
-
|
|
1104
|
-
function applyCustomTheme() {
|
|
1105
|
-
if (!originalPresetName.value) {
|
|
1106
|
-
originalPresetName.value = presetName.value
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
updateTheme(customPreset)
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
function resetTheme() {
|
|
1113
|
-
if (originalPresetName.value) {
|
|
1114
|
-
updateTheme(originalPresetName.value)
|
|
1115
|
-
originalPresetName.value = null
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
</script>
|
|
1119
|
-
|
|
1120
|
-
<style scoped>
|
|
1121
|
-
@reference "../../.vitepress/theme/main.css";
|
|
1122
|
-
.demo-theme-controls {
|
|
1123
|
-
@apply maz:w-full;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.theme-controls {
|
|
1127
|
-
@apply maz:border-t maz:border-divider maz:pt-4;
|
|
1128
|
-
}
|
|
1129
|
-
</style>
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Translations (i18n)
|
|
3
|
-
description: Internationalization
|
|
2
|
+
title: "Translations (i18n)"
|
|
3
|
+
description: "Internationalization of the maz-ui components with @maz-ui/translations: built-in locales, custom messages, lazy loading and runtime locale switching with useTranslations"
|
|
4
|
+
package: "@maz-ui/translations"
|
|
5
|
+
url: "https://maz-ui.com/ecosystem/translations"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# Translations (i18n)
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
> Internationalization of the maz-ui components with @maz-ui/translations: built-in locales, custom messages, lazy loading and runtime locale switching with useTranslations
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
- Package: `@maz-ui/translations`
|
|
13
|
+
- Import: `import { useTranslations } from '@maz-ui/translations'` or `import { fr } from '@maz-ui/translations'`
|
|
14
|
+
- Web: https://maz-ui.com/ecosystem/translations
|
|
11
15
|
|
|
12
16
|
## ✨ Features
|
|
13
17
|
|
|
@@ -37,27 +41,25 @@ Maz-UI includes default translations for **8 languages** ready to use out of the
|
|
|
37
41
|
|
|
38
42
|
All these languages include translations for:
|
|
39
43
|
|
|
40
|
-
- 📱 **InputPhoneNumber** ([`MazInputPhoneNumber`](
|
|
41
|
-
- 📁 **Dropzone** ([`MazDropzone`](
|
|
42
|
-
- 📅 **DatePicker** ([`MazDatePicker`](
|
|
43
|
-
- 📋 **Checklist** ([`MazChecklist`](
|
|
44
|
-
- 📤 **Dropdown** ([`MazDropdown`](
|
|
45
|
-
- 🔍 **Select** ([`MazSelect`](
|
|
46
|
-
- 🗂️ **Table** ([`MazTable`](
|
|
47
|
-
- 📄 **Pagination** ([`MazPagination`](
|
|
48
|
-
- 🎠 **Carousel** ([`MazCarousel`](
|
|
49
|
-
- 🌍 **SelectCountry** ([`MazSelectCountry`](
|
|
44
|
+
- 📱 **InputPhoneNumber** ([`MazInputPhoneNumber`](../components/maz-input-phone-number.md))
|
|
45
|
+
- 📁 **Dropzone** ([`MazDropzone`](../components/maz-dropzone.md))
|
|
46
|
+
- 📅 **DatePicker** ([`MazDatePicker`](../components/maz-date-picker.md))
|
|
47
|
+
- 📋 **Checklist** ([`MazChecklist`](../components/maz-checklist.md))
|
|
48
|
+
- 📤 **Dropdown** ([`MazDropdown`](../components/maz-dropdown.md))
|
|
49
|
+
- 🔍 **Select** ([`MazSelect`](../components/maz-select.md))
|
|
50
|
+
- 🗂️ **Table** ([`MazTable`](../components/maz-table.md))
|
|
51
|
+
- 📄 **Pagination** ([`MazPagination`](../components/maz-pagination.md))
|
|
52
|
+
- 🎠 **Carousel** ([`MazCarousel`](../components/maz-carousel.md))
|
|
53
|
+
- 🌍 **SelectCountry** ([`MazSelectCountry`](../components/maz-select-country.md))
|
|
50
54
|
|
|
51
55
|
### Basic Usage
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
**Warning:**
|
|
54
58
|
|
|
55
59
|
**By default Maz-UI will not load any translations to avoid unused code in your bundle.**
|
|
56
60
|
|
|
57
61
|
So, to avoid loading hydration issues or any flashes, use the `messages` option to provide the translations for the language you want to use. Otherwise, the translations will be loaded asynchronously.
|
|
58
62
|
|
|
59
|
-
:::
|
|
60
|
-
|
|
61
63
|
```typescript
|
|
62
64
|
import { fr } from '@maz-ui/translations'
|
|
63
65
|
|
|
@@ -72,9 +74,9 @@ app.use(MazUi, {
|
|
|
72
74
|
})
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
**Tip: Alternative: MazUiProvider**
|
|
78
|
+
|
|
76
79
|
You can also provide translations via the [`MazUiProvider`](../guide/maz-ui-provider.md) component for lazy-loaded pages or subtree-scoped configurations.
|
|
77
|
-
:::
|
|
78
80
|
|
|
79
81
|
## How it works
|
|
80
82
|
|
|
@@ -181,9 +183,9 @@ app.use(MazUi, {
|
|
|
181
183
|
|
|
182
184
|
## Enhanced Lazy Loading
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
**Tip: BUILT-IN FEATURE**
|
|
187
|
+
|
|
185
188
|
All supported languages (fr, es, de, it, pt, ja, zh-CN) are automatically loaded lazily. You don't need to configure anything to benefit from this.
|
|
186
|
-
:::
|
|
187
189
|
|
|
188
190
|
The Maz-UI translation system natively supports **lazy loading**, a powerful feature to optimize your application's performance.
|
|
189
191
|
|
|
@@ -296,7 +298,7 @@ app.use(MazUi, {
|
|
|
296
298
|
|
|
297
299
|
### Create your translation files
|
|
298
300
|
|
|
299
|
-
Check the
|
|
301
|
+
Check the all translations keys section to see all available keys.
|
|
300
302
|
|
|
301
303
|
Create separate files for each language:
|
|
302
304
|
|