@stacksjs/components 0.2.3
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 +477 -0
- package/dist/Accordion-x2gjedap.stx +108 -0
- package/dist/Audio-0fk6p9tn.stx +50 -0
- package/dist/Avatar-5m0v0s4x.stx +88 -0
- package/dist/Badge-ynes82vv.stx +70 -0
- package/dist/Breadcrumb-h9n427sk.stx +79 -0
- package/dist/Button-7xtrzn14.stx +89 -0
- package/dist/Calendar-egvx1pma.stx +232 -0
- package/dist/Card-r9w7vy1a.stx +74 -0
- package/dist/Checkbox-m8v46pmx.stx +92 -0
- package/dist/Checkout-vcnnr176.stx +39 -0
- package/dist/CodeBlock-mwex82cm.stx +57 -0
- package/dist/Combobox-npb08vkp.stx +13 -0
- package/dist/ComboboxButton-vcdyq4zw.stx +13 -0
- package/dist/ComboboxInput-c9d2p02m.stx +25 -0
- package/dist/ComboboxOption-7d0h9ash.stx +52 -0
- package/dist/ComboboxOptions-4dtqc0qa.stx +12 -0
- package/dist/CommandPalette-ah00bf8v.stx +39 -0
- package/dist/CommandPaletteItem-2yx0gvtj.stx +32 -0
- package/dist/DefaultPaymentMethod-emw5fg8s.stx +62 -0
- package/dist/Dialog-1w4rz7x0.stx +19 -0
- package/dist/DialogBackdrop-qbm3y5ab.stx +9 -0
- package/dist/DialogDescription-01w5j74b.stx +11 -0
- package/dist/DialogPanel-brsszrrs.stx +16 -0
- package/dist/DialogTitle-3rxhwg21.stx +11 -0
- package/dist/Drawer-yfaz8q7f.stx +137 -0
- package/dist/Dropdown-ng7nx556.stx +24 -0
- package/dist/DropdownButton-vc4zpyrb.stx +23 -0
- package/dist/DropdownItem-z491y23c.stx +43 -0
- package/dist/DropdownItems-7ykf29sj.stx +18 -0
- package/dist/EmailInput-bfshpj92.stx +41 -0
- package/dist/Footer-xdaf02nr.stx +66 -0
- package/dist/Form-z4f7w6r1.stx +209 -0
- package/dist/Hero-9vvp7pxf.stx +25 -0
- package/dist/Image-ktk0451c.stx +197 -0
- package/dist/Installation-33bj4rm7.stx +39 -0
- package/dist/Listbox-xcejcmyc.stx +14 -0
- package/dist/ListboxButton-nx5kmw19.stx +17 -0
- package/dist/ListboxLabel-aky8a73n.stx +11 -0
- package/dist/ListboxOption-6h4hsdz5.stx +57 -0
- package/dist/ListboxOptions-2sacdtm5.stx +16 -0
- package/dist/Login-s2jkvd9y.stx +163 -0
- package/dist/Navigator-tqqdgdkw.stx +138 -0
- package/dist/Notification-sry8egea.stx +71 -0
- package/dist/NumberInput-zm93ddfw.stx +138 -0
- package/dist/Pagination-yza9v4qw.stx +183 -0
- package/dist/PasswordInput-4xnndp5y.stx +155 -0
- package/dist/PaymentMethods-jxba6kek.stx +113 -0
- package/dist/Popover-scbqatjq.stx +24 -0
- package/dist/PopoverButton-rbxhzj4k.stx +23 -0
- package/dist/PopoverPanel-9ng1rm6e.stx +23 -0
- package/dist/Portal-j111yvqp.stx +74 -0
- package/dist/Progress-gbmw3akr.stx +142 -0
- package/dist/Radio-1n9qamv1.stx +81 -0
- package/dist/RadioGroup-12dw2vhk.stx +13 -0
- package/dist/RadioGroupDescription-bjm3mdht.stx +11 -0
- package/dist/RadioGroupLabel-aky8a73n.stx +11 -0
- package/dist/RadioGroupOption-9pcxgwmd.stx +51 -0
- package/dist/SearchInput-g240e2nq.stx +63 -0
- package/dist/Select-p9f94b20.stx +89 -0
- package/dist/Sidebar-gwxw8q38.stx +288 -0
- package/dist/SidebarFooter-887kxret.stx +95 -0
- package/dist/SidebarHeader-qjeyx0hv.stx +100 -0
- package/dist/SidebarItem-4dpwtmb4.stx +118 -0
- package/dist/SidebarSection-kh92fk4m.stx +108 -0
- package/dist/Signup-3nxq5zag.stx +161 -0
- package/dist/Skeleton-g0nx1njm.stx +48 -0
- package/dist/Spinner-w4zj58xp.stx +109 -0
- package/dist/Stepper-rwc5actp.stx +17 -0
- package/dist/StepperStep-h0k657nm.stx +53 -0
- package/dist/SubscriptionCheckout-4cbxdg7w.stx +353 -0
- package/dist/Switch-kjq8qd2p.stx +74 -0
- package/dist/Table-59j9qwp0.stx +14 -0
- package/dist/TableBody-reka2gwv.stx +10 -0
- package/dist/TableCell-j7nh4sgr.stx +10 -0
- package/dist/TableHead-ecbrwpqm.stx +10 -0
- package/dist/TableHeader-jn2shwsv.stx +13 -0
- package/dist/TableRow-xz8rrxhc.stx +11 -0
- package/dist/Tabs-kb6ex6m7.stx +145 -0
- package/dist/Teleport-819cg9zm.stx +101 -0
- package/dist/TextInput-zx9kgr79.stx +146 -0
- package/dist/Textarea-5xvmrb0z.stx +119 -0
- package/dist/Tooltip-5ehqsy49.stx +76 -0
- package/dist/Transition-2j39s044.stx +174 -0
- package/dist/TwoFactorChallenge-2q4gg89m.stx +125 -0
- package/dist/Video-6aq4shh4.stx +45 -0
- package/dist/VirtualList-weh5qtm1.stx +83 -0
- package/dist/VirtualTable-59a1eskc.stx +113 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/composables/index.d.ts +4 -0
- package/dist/composables/index.js +3 -0
- package/dist/composables/useCopyCode.d.ts +19 -0
- package/dist/composables/useDarkMode.d.ts +25 -0
- package/dist/composables/useSEO.d.ts +36 -0
- package/dist/composables/utilities/index.d.ts +5 -0
- package/dist/composables/utilities/useClickOutside.d.ts +28 -0
- package/dist/composables/utilities/useFocusTrap.d.ts +34 -0
- package/dist/composables/utilities/useKeyboard.d.ts +55 -0
- package/dist/composables/utilities/useLocalStorage.d.ts +33 -0
- package/dist/composables/utilities/useMediaQuery.d.ts +64 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +19 -0
- package/dist/ui/accordion/index.d.ts +12 -0
- package/dist/ui/audio/index.d.ts +12 -0
- package/dist/ui/auth/index.d.ts +29 -0
- package/dist/ui/avatar/index.d.ts +11 -0
- package/dist/ui/badge/index.d.ts +9 -0
- package/dist/ui/breadcrumb/index.d.ts +13 -0
- package/dist/ui/button/index.d.ts +45 -0
- package/dist/ui/calendar/index.d.ts +13 -0
- package/dist/ui/card/index.d.ts +12 -0
- package/dist/ui/checkbox/index.d.ts +15 -0
- package/dist/ui/combobox/index.d.ts +35 -0
- package/dist/ui/command-palette/index.d.ts +13 -0
- package/dist/ui/dialog/index.d.ts +27 -0
- package/dist/ui/drawer/index.d.ts +8 -0
- package/dist/ui/dropdown/index.d.ts +25 -0
- package/dist/ui/form/index.d.ts +48 -0
- package/dist/ui/image/index.d.ts +21 -0
- package/dist/ui/input/index.d.ts +73 -0
- package/dist/ui/listbox/index.d.ts +34 -0
- package/dist/ui/navigator/index.d.ts +18 -0
- package/dist/ui/notification/index.d.ts +11 -0
- package/dist/ui/pagination/index.d.ts +10 -0
- package/dist/ui/payment/index.d.ts +53 -0
- package/dist/ui/popover/index.d.ts +19 -0
- package/dist/ui/portal/index.d.ts +5 -0
- package/dist/ui/progress/index.d.ts +11 -0
- package/dist/ui/radio/index.d.ts +14 -0
- package/dist/ui/radio-group/index.d.ts +26 -0
- package/dist/ui/select/index.d.ts +19 -0
- package/dist/ui/sidebar/index.d.ts +129 -0
- package/dist/ui/skeleton/index.d.ts +10 -0
- package/dist/ui/spinner/index.d.ts +8 -0
- package/dist/ui/stepper/index.d.ts +17 -0
- package/dist/ui/storage/index.d.ts +40 -0
- package/dist/ui/switch/index.d.ts +9 -0
- package/dist/ui/table/index.d.ts +29 -0
- package/dist/ui/tabs/index.d.ts +14 -0
- package/dist/ui/teleport/index.d.ts +6 -0
- package/dist/ui/textarea/index.d.ts +19 -0
- package/dist/ui/tooltip/index.d.ts +9 -0
- package/dist/ui/transition/index.d.ts +24 -0
- package/dist/ui/video/index.d.ts +15 -0
- package/dist/ui/virtual-list/index.d.ts +9 -0
- package/dist/ui/virtual-table/index.d.ts +19 -0
- package/dist/utils/accessibility.d.ts +285 -0
- package/dist/utils/animation/easing.d.ts +112 -0
- package/dist/utils/animation/helpers.d.ts +119 -0
- package/dist/utils/animation/index.d.ts +3 -0
- package/dist/utils/animation/keyframes.d.ts +334 -0
- package/dist/utils/error-handling.d.ts +182 -0
- package/dist/utils/highlighter.d.ts +27 -0
- package/dist/utils/highlighter.js +2 -0
- package/dist/utils/i18n.d.ts +245 -0
- package/dist/utils/keep-alive.d.ts +171 -0
- package/dist/utils/lazy-loading.d.ts +174 -0
- package/dist/utils/prop-validation.d.ts +106 -0
- package/dist/utils/theme.d.ts +234 -0
- package/package.json +69 -0
- package/src/components/CodeBlock.stx +57 -0
- package/src/components/Footer.stx +66 -0
- package/src/components/Hero.stx +25 -0
- package/src/components/Installation.stx +39 -0
- package/src/components/index.ts +4 -0
- package/src/composables/index.ts +4 -0
- package/src/composables/useCopyCode.ts +73 -0
- package/src/composables/useDarkMode.ts +100 -0
- package/src/composables/useSEO.ts +229 -0
- package/src/composables/utilities/index.ts +7 -0
- package/src/composables/utilities/useClickOutside.ts +72 -0
- package/src/composables/utilities/useFocusTrap.ts +159 -0
- package/src/composables/utilities/useKeyboard.ts +124 -0
- package/src/composables/utilities/useLocalStorage.ts +132 -0
- package/src/composables/utilities/useMediaQuery.ts +118 -0
- package/src/index.ts +99 -0
- package/src/stx.d.ts +4 -0
- package/src/ui/accordion/Accordion.stx +108 -0
- package/src/ui/accordion/index.ts +14 -0
- package/src/ui/audio/Audio.stx +50 -0
- package/src/ui/audio/README.md +42 -0
- package/src/ui/audio/index.ts +13 -0
- package/src/ui/auth/Login.stx +163 -0
- package/src/ui/auth/README.md +145 -0
- package/src/ui/auth/Signup.stx +161 -0
- package/src/ui/auth/TwoFactorChallenge.stx +125 -0
- package/src/ui/auth/index.ts +32 -0
- package/src/ui/avatar/Avatar.stx +88 -0
- package/src/ui/avatar/index.ts +12 -0
- package/src/ui/badge/Badge.stx +70 -0
- package/src/ui/badge/index.ts +10 -0
- package/src/ui/breadcrumb/Breadcrumb.stx +79 -0
- package/src/ui/breadcrumb/index.ts +15 -0
- package/src/ui/button/Button.stx +89 -0
- package/src/ui/button/README.md +100 -0
- package/src/ui/button/index.ts +85 -0
- package/src/ui/calendar/Calendar.stx +232 -0
- package/src/ui/calendar/README.md +254 -0
- package/src/ui/calendar/index.ts +14 -0
- package/src/ui/card/Card.stx +74 -0
- package/src/ui/card/index.ts +13 -0
- package/src/ui/checkbox/Checkbox.stx +92 -0
- package/src/ui/checkbox/index.ts +16 -0
- package/src/ui/combobox/Combobox.stx +13 -0
- package/src/ui/combobox/ComboboxButton.stx +13 -0
- package/src/ui/combobox/ComboboxInput.stx +25 -0
- package/src/ui/combobox/ComboboxOption.stx +52 -0
- package/src/ui/combobox/ComboboxOptions.stx +12 -0
- package/src/ui/combobox/README.md +154 -0
- package/src/ui/combobox/index.ts +40 -0
- package/src/ui/command-palette/CommandPalette.stx +39 -0
- package/src/ui/command-palette/CommandPaletteItem.stx +32 -0
- package/src/ui/command-palette/README.md +42 -0
- package/src/ui/command-palette/index.ts +15 -0
- package/src/ui/dialog/Dialog.stx +19 -0
- package/src/ui/dialog/DialogBackdrop.stx +9 -0
- package/src/ui/dialog/DialogDescription.stx +11 -0
- package/src/ui/dialog/DialogPanel.stx +16 -0
- package/src/ui/dialog/DialogTitle.stx +11 -0
- package/src/ui/dialog/README.md +133 -0
- package/src/ui/dialog/index.ts +32 -0
- package/src/ui/drawer/Drawer.stx +137 -0
- package/src/ui/drawer/README.md +110 -0
- package/src/ui/drawer/index.ts +9 -0
- package/src/ui/dropdown/Dropdown.stx +24 -0
- package/src/ui/dropdown/DropdownButton.stx +23 -0
- package/src/ui/dropdown/DropdownItem.stx +43 -0
- package/src/ui/dropdown/DropdownItems.stx +18 -0
- package/src/ui/dropdown/README.md +142 -0
- package/src/ui/dropdown/index.ts +29 -0
- package/src/ui/form/Form.stx +209 -0
- package/src/ui/form/index.ts +67 -0
- package/src/ui/heatmap/Heatmap.stx +315 -0
- package/src/ui/image/Image.stx +197 -0
- package/src/ui/image/README.md +171 -0
- package/src/ui/image/index.ts +22 -0
- package/src/ui/input/EmailInput.stx +41 -0
- package/src/ui/input/NumberInput.stx +138 -0
- package/src/ui/input/PasswordInput.stx +155 -0
- package/src/ui/input/SearchInput.stx +63 -0
- package/src/ui/input/TextInput.stx +146 -0
- package/src/ui/input/index.ts +180 -0
- package/src/ui/listbox/Listbox.stx +14 -0
- package/src/ui/listbox/ListboxButton.stx +17 -0
- package/src/ui/listbox/ListboxLabel.stx +11 -0
- package/src/ui/listbox/ListboxOption.stx +57 -0
- package/src/ui/listbox/ListboxOptions.stx +16 -0
- package/src/ui/listbox/README.md +143 -0
- package/src/ui/listbox/index.ts +39 -0
- package/src/ui/navigator/Navigator.stx +138 -0
- package/src/ui/navigator/README.md +352 -0
- package/src/ui/navigator/index.ts +20 -0
- package/src/ui/notification/Notification.stx +71 -0
- package/src/ui/notification/README.md +118 -0
- package/src/ui/notification/index.ts +12 -0
- package/src/ui/pagination/Pagination.stx +183 -0
- package/src/ui/pagination/index.ts +11 -0
- package/src/ui/payment/Checkout.stx +39 -0
- package/src/ui/payment/DefaultPaymentMethod.stx +62 -0
- package/src/ui/payment/PaymentMethods.stx +113 -0
- package/src/ui/payment/README.md +427 -0
- package/src/ui/payment/SubscriptionCheckout.stx +353 -0
- package/src/ui/payment/index.ts +59 -0
- package/src/ui/popover/Popover.stx +24 -0
- package/src/ui/popover/PopoverButton.stx +23 -0
- package/src/ui/popover/PopoverPanel.stx +23 -0
- package/src/ui/popover/README.md +95 -0
- package/src/ui/popover/index.ts +22 -0
- package/src/ui/portal/Portal.stx +74 -0
- package/src/ui/portal/index.ts +6 -0
- package/src/ui/progress/Progress.stx +142 -0
- package/src/ui/progress/index.ts +12 -0
- package/src/ui/radio/Radio.stx +81 -0
- package/src/ui/radio/index.ts +15 -0
- package/src/ui/radio-group/README.md +145 -0
- package/src/ui/radio-group/RadioGroup.stx +13 -0
- package/src/ui/radio-group/RadioGroupDescription.stx +11 -0
- package/src/ui/radio-group/RadioGroupLabel.stx +11 -0
- package/src/ui/radio-group/RadioGroupOption.stx +51 -0
- package/src/ui/radio-group/index.ts +30 -0
- package/src/ui/select/README.md +204 -0
- package/src/ui/select/Select.stx +89 -0
- package/src/ui/select/index.ts +21 -0
- package/src/ui/sidebar/Sidebar.stx +288 -0
- package/src/ui/sidebar/SidebarFooter.stx +95 -0
- package/src/ui/sidebar/SidebarHeader.stx +100 -0
- package/src/ui/sidebar/SidebarItem.stx +118 -0
- package/src/ui/sidebar/SidebarSection.stx +108 -0
- package/src/ui/sidebar/index.ts +175 -0
- package/src/ui/skeleton/Skeleton.stx +48 -0
- package/src/ui/skeleton/index.ts +11 -0
- package/src/ui/spinner/Spinner.stx +109 -0
- package/src/ui/spinner/index.ts +9 -0
- package/src/ui/stepper/README.md +36 -0
- package/src/ui/stepper/Stepper.stx +17 -0
- package/src/ui/stepper/StepperStep.stx +53 -0
- package/src/ui/stepper/index.ts +19 -0
- package/src/ui/storage/README.md +193 -0
- package/src/ui/storage/index.ts +347 -0
- package/src/ui/switch/README.md +133 -0
- package/src/ui/switch/Switch.stx +74 -0
- package/src/ui/switch/index.ts +10 -0
- package/src/ui/table/README.md +39 -0
- package/src/ui/table/Table.stx +14 -0
- package/src/ui/table/TableBody.stx +10 -0
- package/src/ui/table/TableCell.stx +10 -0
- package/src/ui/table/TableHead.stx +10 -0
- package/src/ui/table/TableHeader.stx +13 -0
- package/src/ui/table/TableRow.stx +11 -0
- package/src/ui/table/index.ts +35 -0
- package/src/ui/tabs/Tabs.stx +145 -0
- package/src/ui/tabs/index.ts +16 -0
- package/src/ui/teleport/Teleport.stx +101 -0
- package/src/ui/teleport/index.ts +7 -0
- package/src/ui/textarea/Textarea.stx +119 -0
- package/src/ui/textarea/index.ts +20 -0
- package/src/ui/tooltip/Tooltip.stx +76 -0
- package/src/ui/tooltip/index.ts +10 -0
- package/src/ui/transition/README.md +30 -0
- package/src/ui/transition/Transition.stx +174 -0
- package/src/ui/transition/index.ts +25 -0
- package/src/ui/video/README.md +48 -0
- package/src/ui/video/Video.stx +45 -0
- package/src/ui/video/index.ts +16 -0
- package/src/ui/virtual-list/VirtualList.stx +83 -0
- package/src/ui/virtual-list/index.ts +10 -0
- package/src/ui/virtual-table/VirtualTable.stx +113 -0
- package/src/ui/virtual-table/index.ts +21 -0
- package/src/utils/PROP_VALIDATION.md +458 -0
- package/src/utils/THEME_SYSTEM.md +702 -0
- package/src/utils/accessibility.ts +841 -0
- package/src/utils/animation/easing.ts +368 -0
- package/src/utils/animation/helpers.ts +223 -0
- package/src/utils/animation/index.ts +5 -0
- package/src/utils/animation/keyframes.ts +230 -0
- package/src/utils/error-handling.ts +473 -0
- package/src/utils/highlighter.ts +93 -0
- package/src/utils/i18n.ts +634 -0
- package/src/utils/keep-alive.ts +818 -0
- package/src/utils/lazy-loading.ts +530 -0
- package/src/utils/prop-validation.ts +478 -0
- package/src/utils/theme.ts +626 -0
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
# Theme System
|
|
2
|
+
|
|
3
|
+
A comprehensive theming system for customizing colors, typography, spacing, and component styles across the entire component library.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createTheme, applyTheme } from '@stacksjs/components'
|
|
9
|
+
|
|
10
|
+
// Create a custom theme
|
|
11
|
+
const myTheme = createTheme({
|
|
12
|
+
colors: {
|
|
13
|
+
primary: '#3b82f6',
|
|
14
|
+
secondary: '#8b5cf6'
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
// Apply the theme
|
|
19
|
+
applyTheme(myTheme)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Table of Contents
|
|
23
|
+
|
|
24
|
+
- [Core Concepts](#core-concepts)
|
|
25
|
+
- [Theme Structure](#theme-structure)
|
|
26
|
+
- [Creating Themes](#creating-themes)
|
|
27
|
+
- [Applying Themes](#applying-themes)
|
|
28
|
+
- [Using Themes](#using-themes)
|
|
29
|
+
- [Theme Presets](#theme-presets)
|
|
30
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
31
|
+
- [Advanced Usage](#advanced-usage)
|
|
32
|
+
|
|
33
|
+
## Core Concepts
|
|
34
|
+
|
|
35
|
+
The theme system uses CSS custom properties (CSS variables) to provide real-time theming without recompiling styles. All theme values are converted to CSS variables and applied to the `:root` element (or a specific container).
|
|
36
|
+
|
|
37
|
+
### Benefits
|
|
38
|
+
|
|
39
|
+
- **No compilation required** - Changes apply immediately
|
|
40
|
+
- **Runtime switching** - Switch themes dynamically
|
|
41
|
+
- **Scoped themes** - Apply different themes to different sections
|
|
42
|
+
- **Type-safe** - Full TypeScript support
|
|
43
|
+
- **Extendable** - Easy to add custom properties
|
|
44
|
+
|
|
45
|
+
## Theme Structure
|
|
46
|
+
|
|
47
|
+
A complete theme object has the following structure:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
interface Theme {
|
|
51
|
+
colors: ColorPalette
|
|
52
|
+
typography: Typography
|
|
53
|
+
spacing: Spacing
|
|
54
|
+
borderRadius: BorderRadius
|
|
55
|
+
shadows: Shadows
|
|
56
|
+
components?: ComponentOverrides
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Colors
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
colors: {
|
|
64
|
+
primary: '#3b82f6', // Primary brand color
|
|
65
|
+
secondary: '#8b5cf6', // Secondary brand color
|
|
66
|
+
success: '#10b981', // Success states
|
|
67
|
+
warning: '#f59e0b', // Warning states
|
|
68
|
+
danger: '#ef4444', // Error/danger states
|
|
69
|
+
info: '#06b6d4', // Informational states
|
|
70
|
+
gray: '#6b7280', // Neutral color
|
|
71
|
+
white: '#ffffff', // White
|
|
72
|
+
black: '#000000', // Black
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Typography
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
typography: {
|
|
80
|
+
fontFamily: {
|
|
81
|
+
sans: 'Inter, system-ui, sans-serif',
|
|
82
|
+
serif: 'Georgia, serif',
|
|
83
|
+
mono: 'Monaco, monospace'
|
|
84
|
+
},
|
|
85
|
+
fontSize: {
|
|
86
|
+
xs: '0.75rem',
|
|
87
|
+
sm: '0.875rem',
|
|
88
|
+
base: '1rem',
|
|
89
|
+
lg: '1.125rem',
|
|
90
|
+
xl: '1.25rem',
|
|
91
|
+
'2xl': '1.5rem',
|
|
92
|
+
'3xl': '1.875rem',
|
|
93
|
+
'4xl': '2.25rem'
|
|
94
|
+
},
|
|
95
|
+
fontWeight: {
|
|
96
|
+
light: '300',
|
|
97
|
+
normal: '400',
|
|
98
|
+
medium: '500',
|
|
99
|
+
semibold: '600',
|
|
100
|
+
bold: '700'
|
|
101
|
+
},
|
|
102
|
+
lineHeight: {
|
|
103
|
+
tight: '1.25',
|
|
104
|
+
normal: '1.5',
|
|
105
|
+
relaxed: '1.75'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Spacing
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
spacing: {
|
|
114
|
+
xs: '0.25rem',
|
|
115
|
+
sm: '0.5rem',
|
|
116
|
+
md: '1rem',
|
|
117
|
+
lg: '1.5rem',
|
|
118
|
+
xl: '2rem',
|
|
119
|
+
'2xl': '3rem',
|
|
120
|
+
'3xl': '4rem',
|
|
121
|
+
'4xl': '6rem'
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Border Radius
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
borderRadius: {
|
|
129
|
+
none: '0',
|
|
130
|
+
sm: '0.125rem',
|
|
131
|
+
md: '0.375rem',
|
|
132
|
+
lg: '0.5rem',
|
|
133
|
+
full: '9999px'
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Shadows
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
shadows: {
|
|
141
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
142
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
|
|
143
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
|
144
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',
|
|
145
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
|
|
146
|
+
none: 'none'
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Component Overrides
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
components: {
|
|
154
|
+
button: {
|
|
155
|
+
borderRadius: '0.375rem',
|
|
156
|
+
padding: '0.5rem 1rem',
|
|
157
|
+
fontSize: '0.875rem',
|
|
158
|
+
fontWeight: '500'
|
|
159
|
+
},
|
|
160
|
+
input: {
|
|
161
|
+
borderRadius: '0.375rem',
|
|
162
|
+
padding: '0.5rem 0.75rem',
|
|
163
|
+
fontSize: '0.875rem',
|
|
164
|
+
borderWidth: '1px'
|
|
165
|
+
},
|
|
166
|
+
card: {
|
|
167
|
+
borderRadius: '0.5rem',
|
|
168
|
+
padding: '1.5rem',
|
|
169
|
+
shadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1)'
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Creating Themes
|
|
175
|
+
|
|
176
|
+
### Basic Theme
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import { createTheme } from '@stacksjs/components'
|
|
180
|
+
|
|
181
|
+
const myTheme = createTheme({
|
|
182
|
+
colors: {
|
|
183
|
+
primary: '#3b82f6',
|
|
184
|
+
secondary: '#8b5cf6'
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Complete Custom Theme
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
const customTheme = createTheme({
|
|
193
|
+
colors: {
|
|
194
|
+
primary: '#3b82f6',
|
|
195
|
+
secondary: '#8b5cf6',
|
|
196
|
+
success: '#10b981',
|
|
197
|
+
warning: '#f59e0b',
|
|
198
|
+
danger: '#ef4444',
|
|
199
|
+
info: '#06b6d4'
|
|
200
|
+
},
|
|
201
|
+
typography: {
|
|
202
|
+
fontFamily: {
|
|
203
|
+
sans: 'Inter, sans-serif',
|
|
204
|
+
mono: 'Fira Code, monospace'
|
|
205
|
+
},
|
|
206
|
+
fontSize: {
|
|
207
|
+
base: '1rem',
|
|
208
|
+
lg: '1.25rem'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
spacing: {
|
|
212
|
+
md: '1rem',
|
|
213
|
+
lg: '2rem'
|
|
214
|
+
},
|
|
215
|
+
borderRadius: {
|
|
216
|
+
md: '0.5rem',
|
|
217
|
+
lg: '1rem'
|
|
218
|
+
},
|
|
219
|
+
components: {
|
|
220
|
+
button: {
|
|
221
|
+
borderRadius: '0.5rem',
|
|
222
|
+
padding: '0.75rem 1.5rem'
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Brand Theme
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
const brandTheme = createTheme({
|
|
232
|
+
colors: {
|
|
233
|
+
primary: '#ff6b6b', // Your brand color
|
|
234
|
+
secondary: '#4ecdc4',
|
|
235
|
+
success: '#95e1d3',
|
|
236
|
+
danger: '#ff6b6b'
|
|
237
|
+
},
|
|
238
|
+
typography: {
|
|
239
|
+
fontFamily: {
|
|
240
|
+
sans: 'Montserrat, sans-serif'
|
|
241
|
+
},
|
|
242
|
+
fontWeight: {
|
|
243
|
+
normal: '400',
|
|
244
|
+
bold: '700'
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
borderRadius: {
|
|
248
|
+
md: '1rem',
|
|
249
|
+
lg: '2rem'
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Applying Themes
|
|
255
|
+
|
|
256
|
+
### Apply to Entire Application
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import { applyTheme, createTheme } from '@stacksjs/components'
|
|
260
|
+
|
|
261
|
+
const theme = createTheme({
|
|
262
|
+
colors: { primary: '#3b82f6' }
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
applyTheme(theme)
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Apply to Specific Container
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
const container = document.getElementById('my-container')
|
|
272
|
+
applyTheme(theme, container)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Dynamic Theme Switching
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
const themes = {
|
|
279
|
+
light: createTheme({
|
|
280
|
+
colors: {
|
|
281
|
+
primary: '#3b82f6',
|
|
282
|
+
white: '#ffffff',
|
|
283
|
+
black: '#000000'
|
|
284
|
+
}
|
|
285
|
+
}),
|
|
286
|
+
dark: createTheme({
|
|
287
|
+
colors: {
|
|
288
|
+
primary: '#60a5fa',
|
|
289
|
+
white: '#1f2937',
|
|
290
|
+
black: '#f9fafb'
|
|
291
|
+
}
|
|
292
|
+
})
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function switchTheme(themeName: 'light' | 'dark') {
|
|
296
|
+
applyTheme(themes[themeName])
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Using Themes
|
|
301
|
+
|
|
302
|
+
### In JavaScript/TypeScript
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
import { useTheme, getThemeValue } from '@stacksjs/components'
|
|
306
|
+
|
|
307
|
+
// Get entire theme object
|
|
308
|
+
const theme = useTheme()
|
|
309
|
+
console.log(theme.colors.primary)
|
|
310
|
+
|
|
311
|
+
// Get specific value by path
|
|
312
|
+
const primaryColor = getThemeValue('colors.primary')
|
|
313
|
+
const baseFontSize = getThemeValue('typography.fontSize.base')
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### In CSS
|
|
317
|
+
|
|
318
|
+
After applying a theme, use CSS custom properties:
|
|
319
|
+
|
|
320
|
+
```css
|
|
321
|
+
.my-component {
|
|
322
|
+
color: var(--color-primary);
|
|
323
|
+
font-family: var(--font-sans);
|
|
324
|
+
font-size: var(--text-base);
|
|
325
|
+
padding: var(--spacing-md);
|
|
326
|
+
border-radius: var(--radius-md);
|
|
327
|
+
box-shadow: var(--shadow-md);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.my-button {
|
|
331
|
+
border-radius: var(--button-border-radius);
|
|
332
|
+
padding: var(--button-padding);
|
|
333
|
+
font-size: var(--button-font-size);
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### In Inline Styles
|
|
338
|
+
|
|
339
|
+
```html
|
|
340
|
+
<div style="color: var(--color-primary); padding: var(--spacing-lg)">
|
|
341
|
+
Themed content
|
|
342
|
+
</div>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Theme Presets
|
|
346
|
+
|
|
347
|
+
The library includes several predefined theme presets:
|
|
348
|
+
|
|
349
|
+
### Default (Blue)
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
import { themePresets, applyTheme } from '@stacksjs/components'
|
|
353
|
+
|
|
354
|
+
applyTheme(themePresets.default)
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Purple
|
|
358
|
+
|
|
359
|
+
```ts
|
|
360
|
+
applyTheme(themePresets.purple)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Green
|
|
364
|
+
|
|
365
|
+
```ts
|
|
366
|
+
applyTheme(themePresets.green)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Orange
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
applyTheme(themePresets.orange)
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Dark
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
applyTheme(themePresets.dark)
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Minimal
|
|
382
|
+
|
|
383
|
+
Reduced shadows and border radius for a cleaner look:
|
|
384
|
+
|
|
385
|
+
```ts
|
|
386
|
+
applyTheme(themePresets.minimal)
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
## CSS Custom Properties
|
|
390
|
+
|
|
391
|
+
All theme values are exposed as CSS custom properties:
|
|
392
|
+
|
|
393
|
+
### Color Variables
|
|
394
|
+
|
|
395
|
+
```css
|
|
396
|
+
--color-primary
|
|
397
|
+
--color-secondary
|
|
398
|
+
--color-success
|
|
399
|
+
--color-warning
|
|
400
|
+
--color-danger
|
|
401
|
+
--color-info
|
|
402
|
+
--color-gray
|
|
403
|
+
--color-white
|
|
404
|
+
--color-black
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Typography Variables
|
|
408
|
+
|
|
409
|
+
```css
|
|
410
|
+
--font-sans
|
|
411
|
+
--font-serif
|
|
412
|
+
--font-mono
|
|
413
|
+
--text-xs
|
|
414
|
+
--text-sm
|
|
415
|
+
--text-base
|
|
416
|
+
--text-lg
|
|
417
|
+
--text-xl
|
|
418
|
+
--text-2xl
|
|
419
|
+
--text-3xl
|
|
420
|
+
--text-4xl
|
|
421
|
+
--font-weight-light
|
|
422
|
+
--font-weight-normal
|
|
423
|
+
--font-weight-medium
|
|
424
|
+
--font-weight-semibold
|
|
425
|
+
--font-weight-bold
|
|
426
|
+
--leading-tight
|
|
427
|
+
--leading-normal
|
|
428
|
+
--leading-relaxed
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Spacing Variables
|
|
432
|
+
|
|
433
|
+
```css
|
|
434
|
+
--spacing-xs
|
|
435
|
+
--spacing-sm
|
|
436
|
+
--spacing-md
|
|
437
|
+
--spacing-lg
|
|
438
|
+
--spacing-xl
|
|
439
|
+
--spacing-2xl
|
|
440
|
+
--spacing-3xl
|
|
441
|
+
--spacing-4xl
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Border Radius Variables
|
|
445
|
+
|
|
446
|
+
```css
|
|
447
|
+
--radius-none
|
|
448
|
+
--radius-sm
|
|
449
|
+
--radius-md
|
|
450
|
+
--radius-lg
|
|
451
|
+
--radius-full
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Shadow Variables
|
|
455
|
+
|
|
456
|
+
```css
|
|
457
|
+
--shadow-sm
|
|
458
|
+
--shadow-md
|
|
459
|
+
--shadow-lg
|
|
460
|
+
--shadow-xl
|
|
461
|
+
--shadow-2xl
|
|
462
|
+
--shadow-none
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Component Variables
|
|
466
|
+
|
|
467
|
+
```css
|
|
468
|
+
--button-border-radius
|
|
469
|
+
--button-padding
|
|
470
|
+
--button-font-size
|
|
471
|
+
--button-font-weight
|
|
472
|
+
|
|
473
|
+
--input-border-radius
|
|
474
|
+
--input-padding
|
|
475
|
+
--input-font-size
|
|
476
|
+
--input-border-width
|
|
477
|
+
|
|
478
|
+
--card-border-radius
|
|
479
|
+
--card-padding
|
|
480
|
+
--card-shadow
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
## Advanced Usage
|
|
484
|
+
|
|
485
|
+
### Generate CSS File
|
|
486
|
+
|
|
487
|
+
```ts
|
|
488
|
+
import { generateThemeCSS, createTheme } from '@stacksjs/components'
|
|
489
|
+
|
|
490
|
+
const theme = createTheme({
|
|
491
|
+
colors: { primary: '#3b82f6' }
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
const cssContent = generateThemeCSS(theme)
|
|
495
|
+
// Write to file or inject into page
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### Extend Existing Theme
|
|
499
|
+
|
|
500
|
+
```ts
|
|
501
|
+
import { getTheme, createTheme } from '@stacksjs/components'
|
|
502
|
+
|
|
503
|
+
const currentTheme = getTheme()
|
|
504
|
+
const extendedTheme = createTheme({
|
|
505
|
+
...currentTheme,
|
|
506
|
+
colors: {
|
|
507
|
+
...currentTheme.colors,
|
|
508
|
+
primary: '#ff6b6b' // Override just primary color
|
|
509
|
+
}
|
|
510
|
+
})
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
### Theme with CSS-in-JS
|
|
514
|
+
|
|
515
|
+
```ts
|
|
516
|
+
import { useTheme } from '@stacksjs/components'
|
|
517
|
+
|
|
518
|
+
function MyComponent() {
|
|
519
|
+
const theme = useTheme()
|
|
520
|
+
|
|
521
|
+
const styles = {
|
|
522
|
+
container: {
|
|
523
|
+
backgroundColor: theme.colors.primary,
|
|
524
|
+
padding: theme.spacing.lg,
|
|
525
|
+
borderRadius: theme.borderRadius.md
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
return <div style={styles.container}>Themed content</div>
|
|
530
|
+
}
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### Scoped Theme Sections
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
const headerTheme = createTheme({
|
|
537
|
+
colors: { primary: '#3b82f6' }
|
|
538
|
+
})
|
|
539
|
+
|
|
540
|
+
const footerTheme = createTheme({
|
|
541
|
+
colors: { primary: '#8b5cf6' }
|
|
542
|
+
})
|
|
543
|
+
|
|
544
|
+
applyTheme(headerTheme, document.getElementById('header'))
|
|
545
|
+
applyTheme(footerTheme, document.getElementById('footer'))
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Responsive Themes
|
|
549
|
+
|
|
550
|
+
```ts
|
|
551
|
+
function applyResponsiveTheme() {
|
|
552
|
+
const isMobile = window.matchMedia('(max-width: 768px)').matches
|
|
553
|
+
|
|
554
|
+
const theme = createTheme({
|
|
555
|
+
typography: {
|
|
556
|
+
fontSize: {
|
|
557
|
+
base: isMobile ? '0.875rem' : '1rem',
|
|
558
|
+
lg: isMobile ? '1rem' : '1.125rem'
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
spacing: {
|
|
562
|
+
md: isMobile ? '0.75rem' : '1rem',
|
|
563
|
+
lg: isMobile ? '1rem' : '1.5rem'
|
|
564
|
+
}
|
|
565
|
+
})
|
|
566
|
+
|
|
567
|
+
applyTheme(theme)
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
window.addEventListener('resize', applyResponsiveTheme)
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Theme Persistence
|
|
574
|
+
|
|
575
|
+
```ts
|
|
576
|
+
import { createTheme, applyTheme } from '@stacksjs/components'
|
|
577
|
+
|
|
578
|
+
function saveTheme(theme: Theme) {
|
|
579
|
+
localStorage.setItem('app-theme', JSON.stringify(theme))
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
function loadTheme(): Theme | null {
|
|
583
|
+
const saved = localStorage.getItem('app-theme')
|
|
584
|
+
return saved ? JSON.parse(saved) : null
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// On app init
|
|
588
|
+
const savedTheme = loadTheme()
|
|
589
|
+
if (savedTheme) {
|
|
590
|
+
applyTheme(savedTheme)
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// When user changes theme
|
|
594
|
+
const newTheme = createTheme({ colors: { primary: '#3b82f6' } })
|
|
595
|
+
applyTheme(newTheme)
|
|
596
|
+
saveTheme(newTheme)
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
## Examples
|
|
600
|
+
|
|
601
|
+
### E-commerce Theme
|
|
602
|
+
|
|
603
|
+
```ts
|
|
604
|
+
const ecommerceTheme = createTheme({
|
|
605
|
+
colors: {
|
|
606
|
+
primary: '#f97316', // Orange for CTAs
|
|
607
|
+
secondary: '#0ea5e9', // Blue for links
|
|
608
|
+
success: '#10b981', // Green for success
|
|
609
|
+
danger: '#ef4444' // Red for errors
|
|
610
|
+
},
|
|
611
|
+
typography: {
|
|
612
|
+
fontFamily: {
|
|
613
|
+
sans: 'Poppins, sans-serif'
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
borderRadius: {
|
|
617
|
+
md: '0.5rem',
|
|
618
|
+
lg: '1rem'
|
|
619
|
+
},
|
|
620
|
+
components: {
|
|
621
|
+
button: {
|
|
622
|
+
borderRadius: '0.5rem',
|
|
623
|
+
padding: '0.75rem 1.5rem',
|
|
624
|
+
fontWeight: '600'
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
})
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
### SaaS Dashboard Theme
|
|
631
|
+
|
|
632
|
+
```ts
|
|
633
|
+
const dashboardTheme = createTheme({
|
|
634
|
+
colors: {
|
|
635
|
+
primary: '#3b82f6',
|
|
636
|
+
secondary: '#6366f1',
|
|
637
|
+
gray: '#6b7280'
|
|
638
|
+
},
|
|
639
|
+
typography: {
|
|
640
|
+
fontFamily: {
|
|
641
|
+
sans: 'Inter, sans-serif',
|
|
642
|
+
mono: 'JetBrains Mono, monospace'
|
|
643
|
+
},
|
|
644
|
+
fontSize: {
|
|
645
|
+
xs: '0.75rem',
|
|
646
|
+
sm: '0.875rem',
|
|
647
|
+
base: '0.875rem' // Smaller base for dashboards
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
spacing: {
|
|
651
|
+
sm: '0.5rem',
|
|
652
|
+
md: '1rem',
|
|
653
|
+
lg: '1.5rem'
|
|
654
|
+
},
|
|
655
|
+
shadows: {
|
|
656
|
+
md: '0 1px 3px 0 rgba(0, 0, 0, 0.1)',
|
|
657
|
+
lg: '0 4px 6px -1px rgba(0, 0, 0, 0.1)'
|
|
658
|
+
}
|
|
659
|
+
})
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### Marketing Site Theme
|
|
663
|
+
|
|
664
|
+
```ts
|
|
665
|
+
const marketingTheme = createTheme({
|
|
666
|
+
colors: {
|
|
667
|
+
primary: '#8b5cf6',
|
|
668
|
+
secondary: '#ec4899'
|
|
669
|
+
},
|
|
670
|
+
typography: {
|
|
671
|
+
fontFamily: {
|
|
672
|
+
sans: 'Montserrat, sans-serif',
|
|
673
|
+
serif: 'Playfair Display, serif'
|
|
674
|
+
},
|
|
675
|
+
fontSize: {
|
|
676
|
+
'2xl': '2rem',
|
|
677
|
+
'3xl': '2.5rem',
|
|
678
|
+
'4xl': '3.5rem'
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
borderRadius: {
|
|
682
|
+
lg: '1rem',
|
|
683
|
+
full: '9999px'
|
|
684
|
+
},
|
|
685
|
+
shadows: {
|
|
686
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
|
687
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',
|
|
688
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
|
689
|
+
}
|
|
690
|
+
})
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
## Best Practices
|
|
694
|
+
|
|
695
|
+
1. **Start with presets** - Use theme presets as a starting point
|
|
696
|
+
2. **Override selectively** - Only customize what you need
|
|
697
|
+
3. **Use semantic colors** - Stick to primary, secondary, success, etc.
|
|
698
|
+
4. **Maintain contrast** - Ensure text is readable on backgrounds
|
|
699
|
+
5. **Test responsiveness** - Check themes on different screen sizes
|
|
700
|
+
6. **Document custom themes** - Keep track of your theme decisions
|
|
701
|
+
7. **Use CSS variables** - Leverage the generated CSS custom properties
|
|
702
|
+
8. **Type safety** - Use TypeScript for theme definitions
|