bestax-mcp 1.18.44 → 1.18.46
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/data/catalog.json +1 -1
- package/data/components/Card.json +1 -1
- package/data/components/Carousel.json +1 -1
- package/data/components/ColorInput.json +2 -2
- package/data/components/DataTable.json +1 -1
- package/data/components/DateInput.json +2 -0
- package/data/components/DateRangeInput.json +2 -0
- package/data/components/DateTimeInput.json +2 -0
- package/data/components/Field.json +1 -1
- package/data/components/Image.json +1 -1
- package/data/components/Media.json +7 -5
- package/data/components/PasswordInput.json +2 -2
- package/data/components/Theme.json +9 -9
- package/data/components/TimeInput.json +2 -0
- package/data/skills/bestax-form/references/api.md +10 -3
- package/data/skills/bestax-layout-scaffold/SKILL.md +4 -3
- package/data/skills/bestax-optimize/references/modular-build.md +3 -2
- package/data/skills/bestax-theming/references/css-variables.md +9 -0
- package/data/skills.json +3 -3
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"title": "Compound (dot-notation) usage › Mixed Approach",
|
|
58
|
-
"code": "<Card header=\"Prop-based header\"
|
|
58
|
+
"code": "<Card header=\"Prop-based header\" m=\"3\">\n <Card.Content>\n <Paragraph>You can mix the prop-based and compound approaches.</Paragraph>\n </Card.Content>\n <Card.Footer>\n <Card.FooterItem as=\"a\" href=\"#save\">\n Save\n </Card.FooterItem>\n <Card.FooterItem as=\"a\" href=\"#cancel\">\n Cancel\n </Card.FooterItem>\n </Card.Footer>\n</Card>"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"title": "Compound (dot-notation) usage › Bulma's Own Markup (`p` Title, `a` Footer Items)",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "Plain Indicators Over the Slides",
|
|
38
|
-
"code": "<Carousel indicatorInside overlayControls={false}>\n {['Garden Room', 'Harbor Suite', 'Loft', 'Courtyard Twin'].map(room => (\n <CarouselItem key={room}>\n <Card m=\"2\">\n <Card.Content
|
|
38
|
+
"code": "<Carousel indicatorInside overlayControls={false}>\n {['Garden Room', 'Harbor Suite', 'Loft', 'Courtyard Twin'].map(room => (\n <CarouselItem key={room}>\n <Card m=\"2\">\n <Card.Content px=\"6\" py=\"6\" textAlign=\"centered\">\n <Title as=\"p\" size=\"5\" mt=\"5\">\n {room}\n </Title>\n <SubTitle as=\"p\" size=\"6\" mb=\"5\">\n Sleeps two\n </SubTitle>\n </Card.Content>\n </Card>\n </CarouselItem>\n ))}\n</Carousel>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"title": "Overlay Arrows",
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
}
|
|
410
410
|
],
|
|
411
411
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
412
|
-
"helperPropsNote": "Helper props go on the `.colorinput` `<div>`, with `className`. The other attributes go on the
|
|
412
|
+
"helperPropsNote": "Helper props go on the `.colorinput` `<div>`, with `className`, except that the background helpers go on the text `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. The other attributes go on the `<input>`.",
|
|
413
413
|
"types": []
|
|
414
414
|
},
|
|
415
415
|
{
|
|
@@ -664,7 +664,7 @@
|
|
|
664
664
|
}
|
|
665
665
|
],
|
|
666
666
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
667
|
-
"helperPropsNote": "Helper props go on the `.colorinput` `<div>`, with `className`. The other attributes go on the
|
|
667
|
+
"helperPropsNote": "Helper props go on the `.colorinput` `<div>`, with `className`, except that the background helpers go on the text `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. The other attributes go on the `<input>`.",
|
|
668
668
|
"types": [],
|
|
669
669
|
"standalone": "base"
|
|
670
670
|
}
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"name": "loading",
|
|
200
200
|
"type": "boolean",
|
|
201
201
|
"default": "false",
|
|
202
|
-
"description": "Shows a page of skeleton rows under the header in place of the rows, and marks the table busy. For data on its way, as from a server with `manual`.",
|
|
202
|
+
"description": "Shows a page of skeleton rows under the header in place of the rows, and marks the table busy. For data on its way, as from a server with `manual`. A skeleton row is as tall as a row of one line of text, so rows of text replace it without the table changing height.",
|
|
203
203
|
"required": false,
|
|
204
204
|
"inherited": false,
|
|
205
205
|
"deprecated": false
|
|
@@ -717,6 +717,7 @@
|
|
|
717
717
|
}
|
|
718
718
|
],
|
|
719
719
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
720
|
+
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
720
721
|
"types": []
|
|
721
722
|
},
|
|
722
723
|
{
|
|
@@ -1060,6 +1061,7 @@
|
|
|
1060
1061
|
],
|
|
1061
1062
|
"extraProps": [],
|
|
1062
1063
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
1064
|
+
"helperPropsNote": "Helper props go on the `.dateinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
1063
1065
|
"types": [],
|
|
1064
1066
|
"standalone": "base"
|
|
1065
1067
|
}
|
|
@@ -612,6 +612,7 @@
|
|
|
612
612
|
}
|
|
613
613
|
],
|
|
614
614
|
"catchAll": "All standard <div> attributes and Bulma helper props",
|
|
615
|
+
"helperPropsNote": "Helper props go on the root `.daterangeinput` `<div>`, with `className` and the other attributes, except that the background helpers go on the `.input` `<div>` that draws the field around the two `<input>`s, since Bulma's `.input` sets its own background. The text helpers go on the root and on both `<input>`s too, which take no alignment or case from around them. Inline they all go on the root.",
|
|
615
616
|
"types": []
|
|
616
617
|
},
|
|
617
618
|
{
|
|
@@ -1009,6 +1010,7 @@
|
|
|
1009
1010
|
],
|
|
1010
1011
|
"extraProps": [],
|
|
1011
1012
|
"catchAll": "All standard <div> attributes and Bulma helper props",
|
|
1013
|
+
"helperPropsNote": "Helper props go on the root `.daterangeinput` `<div>`, with `className` and the other attributes, except that the background helpers go on the `.input` `<div>` that draws the field around the two `<input>`s, since Bulma's `.input` sets its own background. The text helpers go on the root and on both `<input>`s too, which take no alignment or case from around them. Inline they all go on the root.",
|
|
1012
1014
|
"types": [],
|
|
1013
1015
|
"standalone": "base"
|
|
1014
1016
|
}
|
|
@@ -772,6 +772,7 @@
|
|
|
772
772
|
}
|
|
773
773
|
],
|
|
774
774
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
775
|
+
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
775
776
|
"types": []
|
|
776
777
|
},
|
|
777
778
|
{
|
|
@@ -1178,6 +1179,7 @@
|
|
|
1178
1179
|
],
|
|
1179
1180
|
"extraProps": [],
|
|
1180
1181
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
1182
|
+
"helperPropsNote": "Helper props go on the `.datetimeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
1181
1183
|
"types": [],
|
|
1182
1184
|
"standalone": "base"
|
|
1183
1185
|
}
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"code": "<Field horizontal>\n <Field.Label size=\"normal\">\n <label className=\"label\" htmlFor=\"compound-name\">\n Name\n </label>\n </Field.Label>\n <Field.Body>\n <Field.Control>\n <Input id=\"compound-name\" placeholder=\"Jane Doe\" />\n </Field.Control>\n </Field.Body>\n</Field>"
|
|
99
99
|
}
|
|
100
100
|
],
|
|
101
|
-
"accessibility": "- For a single control, prefer the control's own `label` prop, with `horizontal` for a side-by-side row. It renders this `Field` and its label and wires the `for` itself, to your `id` when you pass one: `<Input label=\"Email\" id=\"email\" horizontal />`.\n- The `label` prop names the one control the Field holds. A composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase`, or `DateTimeInputBase`, or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `PinInput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Combobox`, `Taginput`, `File`), adopts a generated id the label's `for` points at, so clicking the label focuses the control and assistive technology announces it. An `inline` picker renders no input, so it takes nothing.\n- A control with an `id` of its own keeps it and never takes the generated one, so `<Field label=\"Email\"><Input id=\"email\" /></Field>` renders a label that names nothing. Leave the `id` off, or pass the same value as `labelProps={{ htmlFor: 'email' }}`. Pass `labelProps={{ htmlFor: undefined }}` to opt out of the association entirely.\n- A range `Slider` takes that id on its low thumb, and its thumbs also point `aria-labelledby` at the label (at `labelProps.id` when you set one), so under a label of \"Price range\" they announce as \"Price range Minimum value\" and \"Price range Maximum value\". An `ariaLabel` entry names its thumb instead, and an `aria-label` or `aria-labelledby` on the Slider takes the label's place in both names. A label you wire by hand with `labelProps={{ htmlFor }}` gets no generated id, so it reaches the thumbs' names only when you give it an `id` there too, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`.\n- An `Autocomplete`, a `Combobox` or a `Taginput` points its open list's `aria-labelledby` at the label the same way, so under a label of \"Country\" the list announces as \"Country\" rather than its fallback name, \"Suggestions\". A label you wire by hand needs an `id` in `labelProps` for this too, as in `labelProps={{ htmlFor: 'country', id: 'country-label' }}`.\n- A group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) can't take a `for`, so the label gets an id (yours from `labelProps.id`, otherwise a generated one) and the group points `aria-labelledby` at it. An `aria-label` or `aria-labelledby` you set on the group wins over the Field's label, as it does over a group's own `label`.\n- Association is skipped for `grouped`/`hasAddons` fields (they hold several controls), and a `Field` nested inside a labeled one starts its own scope. A horizontal Field wraps its children in a `Field.Body` of its own and keeps the association, but the pattern with an inner `Field` in that body needs it wired by hand. A label you wire by hand names the control its `for` points at in a `grouped` or `hasAddons` field too, and with an `id` in `labelProps` it names a range `Slider`'s thumbs and an `Autocomplete`'s, a `Combobox`'s or a `Taginput`'s list there as well. No group points at it on its own.\n- An input in a `hasAddons` row still needs a name of its own. For a visible label, put it on an outer `Field` and wire it by hand, as in [Addons (With a Label)](https://bestax.io/docs/api/form/field#addons-with-a-label). Without one, give the input an `aria-label`, as the other addon examples do. A placeholder disappears once the reader starts typing, so it doesn't stand in for either.\n- Two controls in one plain labeled Field would both adopt its id. Give each an `id` of its own and label it individually.\n- Once a labeled Field's content has mounted, its label keeps the generated `for` only while one of the inputs above holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `for`, so hydration matches, and an input that mounts later puts it back. A `for` you set with `labelProps={{ htmlFor }}` always stays. `Checkbox`, `Radio` and `Switch` take nothing from the label on their own: each is named by its own children, so put the text there, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Where you point content at the label by hand, as with a group in an inner `Field`, `labelProps={{ id }}` is enough in the browser, and `labelProps={{ id, htmlFor: undefined }}` keeps the `for` out of server-rendered HTML too.\n- Grouped/horizontal layouts use Bulma’s grid for layout.",
|
|
101
|
+
"accessibility": "- For a single control, prefer the control's own `label` prop, with `horizontal` for a side-by-side row. It renders this `Field` and its label and wires the `for` itself, to your `id` when you pass one: `<Input label=\"Email\" id=\"email\" horizontal />`.\n- The `label` prop names the one control the Field holds. A composed `InputBase`, `SelectBase`, `TextAreaBase`, `DateInputBase`, `TimeInputBase`, or `DateTimeInputBase`, or a bestax input that renders a single input of its own (`Input`, `Select`, `TextArea`, `Numberinput`, `PinInput`, `Slider`, `DateInput`, `TimeInput`, `DateTimeInput`, `Autocomplete`, `Combobox`, `Taginput`, `File`), adopts a generated id the label's `for` points at, so clicking the label focuses the control and assistive technology announces it. An `inline` picker renders no input, so it takes nothing.\n- A control with an `id` of its own keeps it and never takes the generated one, so `<Field label=\"Email\"><Input id=\"email\" /></Field>` renders a label that names nothing. Leave the `id` off, or pass the same value as `labelProps={{ htmlFor: 'email' }}`. Pass `labelProps={{ htmlFor: undefined }}` to opt out of the association entirely.\n- A range `Slider` takes that id on its low thumb, and its thumbs also point `aria-labelledby` at the label (at `labelProps.id` when you set one), so under a label of \"Price range\" they announce as \"Price range Minimum value\" and \"Price range Maximum value\". An `ariaLabel` entry names its thumb instead, and an `aria-label` or `aria-labelledby` on the Slider takes the label's place in both names. A label you wire by hand with `labelProps={{ htmlFor }}` gets no generated id, so it reaches the thumbs' names only when you give it an `id` there too, as in `labelProps={{ htmlFor: 'price', id: 'price-label' }}`.\n- An `Autocomplete`, a `Combobox` or a `Taginput` points its open list's `aria-labelledby` at the label the same way, so under a label of \"Country\" the list announces as \"Country\" rather than its fallback name, \"Suggestions\". A label you wire by hand needs an `id` in `labelProps` for this too, as in `labelProps={{ htmlFor: 'country', id: 'country-label' }}`.\n- A group (`Radios`, `Checkboxes`, `Rate`, `DateRangeInput`, or a composed `DateRangeInputBase`, `inline` or not) can't take a `for`, so the label gets an id (yours from `labelProps.id`, otherwise a generated one) and the group points `aria-labelledby` at it. An `aria-label` or `aria-labelledby` you set on the group wins over the Field's label, as it does over a group's own `label`.\n- Association is skipped for `grouped`/`hasAddons` fields (they hold several controls), and a `Field` nested inside a labeled one starts its own scope. A horizontal Field wraps its children in a `Field.Body` of its own and keeps the association, but the pattern with an inner `Field` in that body needs it wired by hand. A label you wire by hand names the control its `for` points at in a `grouped` or `hasAddons` field too, and with an `id` in `labelProps` it names a range `Slider`'s thumbs and an `Autocomplete`'s, a `Combobox`'s or a `Taginput`'s list there as well. No group points at it on its own.\n- An input in a `hasAddons` row still needs a name of its own. For a visible label, put it on an outer `Field` and wire it by hand, as in [Addons (With a Label)](https://bestax.io/docs/api/form/field#addons-with-a-label). Without one, give the input an `aria-label`, as the other addon examples do. A placeholder disappears once the reader starts typing, so it doesn't stand in for either.\n- Two controls in one plain labeled Field would both adopt its id. Give each an `id` of its own and label it individually.\n- Once a labeled Field's content has mounted, its label keeps the generated `for` only while one of the inputs above holds the id, and drops it over anything else: a group, a `Checkbox`, `Radio` or `Switch`, an `inline` picker, an inner `Field`, an input with an `id` of its own, markup of your own, or nothing at all. A server render, and the first render while hydrating, still write the `for`, so hydration matches, and an input that mounts later puts it back. A `for` you set with `labelProps={{ htmlFor }}` always stays. `Checkbox`, `Radio` and `Switch` take nothing from the label on their own: each is named by its own children, so put the text there, and the label names one only when you wire it as you would any control with an `id` of its own, `labelProps={{ htmlFor }}` plus that control's `id`. Where you point content at the label by hand, as with a group in an inner `Field`, `labelProps={{ id }}` is enough in the browser, and `labelProps={{ id, htmlFor: undefined }}` keeps the `for` out of server-rendered HTML too.\n- Grouped/horizontal layouts use Bulma’s grid for layout.\n- On a right-to-left page a horizontal label sits to the right of its control, and its text sits against the control, at the label's left edge. Bulma's own stylesheet aligns it right, so this needs `bestax.css` or `extras.css` too.",
|
|
102
102
|
"related": [
|
|
103
103
|
"Checkbox",
|
|
104
104
|
"Checkboxes",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "With Iframe",
|
|
34
|
-
"code": "<Image size=\"16by9\">\n <iframe\n className=\"has-ratio\"\n width=\"640\"\n height=\"360\"\n src=\"https://www.youtube.com/embed/YE7VzlLtp-4\"\n frameBorder=\"0\"\n allowFullScreen\n title=\"
|
|
34
|
+
"code": "<Image size=\"16by9\">\n <iframe\n className=\"has-ratio\"\n width=\"640\"\n height=\"360\"\n src=\"https://www.youtube.com/embed/YE7VzlLtp-4\"\n frameBorder=\"0\"\n allowFullScreen\n title=\"Big Buck Bunny\"\n />\n</Image>"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"title": "With Custom Child",
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "Default Media",
|
|
10
|
-
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>Alexander Hamilton</Strong> <small>@hamilton</small>{' '}\n <small>31m</small>\n <br />\n If men were angels, no government would be necessary. If angels were to\n govern men, neither external nor internal controls on government would\n be necessary.\n </Paragraph>\n </Content>\n <Level as=\"div\" isMobile>\n <Level.Left>\n <Level.Item
|
|
10
|
+
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>Alexander Hamilton</Strong> <small>@hamilton</small>{' '}\n <small>31m</small>\n <br />\n If men were angels, no government would be necessary. If angels were to\n govern men, neither external nor internal controls on government would\n be necessary.\n </Paragraph>\n </Content>\n <Level as=\"div\" isMobile>\n <Level.Left>\n <Level.Item>\n <IconButton\n color=\"text\"\n size=\"small\"\n icon=\"reply\"\n aria-label=\"Reply\"\n />\n </Level.Item>\n <Level.Item>\n <IconButton\n color=\"text\"\n size=\"small\"\n icon=\"retweet\"\n aria-label=\"Retweet\"\n />\n </Level.Item>\n <Level.Item>\n <IconButton\n color=\"text\"\n size=\"small\"\n icon=\"heart\"\n aria-label=\"Like\"\n />\n </Level.Item>\n </Level.Left>\n </Level>\n </Media.Content>\n <Media.Right>\n <Delete aria-label=\"delete\" />\n </Media.Right>\n</Media>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Media With Inputs",
|
|
14
|
-
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Field>\n <Control as=\"p\">\n <TextArea placeholder=\"Add a comment...\" />\n </Control>\n </Field>\n <Level as=\"div\">\n <Level.Left>\n <Level.Item>\n <Button
|
|
14
|
+
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Field>\n <Control as=\"p\">\n <TextArea placeholder=\"Add a comment...\" />\n </Control>\n </Field>\n <Level as=\"div\">\n <Level.Left>\n <Level.Item>\n <Button color=\"info\">Submit</Button>\n </Level.Item>\n </Level.Left>\n <Level.Right>\n <Level.Item>\n <Checkbox>Press enter to submit</Checkbox>\n </Level.Item>\n </Level.Right>\n </Level>\n </Media.Content>\n</Media>"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Nested Media",
|
|
18
|
-
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>John Jay</Strong>\n <br />\n The people, in their collective capacity, are the ultimate authority.\n The Union is essential to the security of the people of America against\n foreign danger.\n <br />\n <small>\n <
|
|
18
|
+
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>John Jay</Strong>\n <br />\n The people, in their collective capacity, are the ultimate authority.\n The Union is essential to the security of the people of America against\n foreign danger.\n <br />\n <small>\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Like\n </LinkButton>{' '}\n ·{' '}\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Reply\n </LinkButton>{' '}\n · 3 hrs\n </small>\n </Paragraph>\n </Content>\n {/* First nested media */}\n <Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"48x48\"\n src=\"https://bulma.io/assets/images/placeholders/96x96.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>James Madison</Strong>\n <br />\n The accumulation of all powers, legislative, executive, and\n judiciary, in the same hands, may justly be pronounced the very\n definition of tyranny.\n <br />\n <small>\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Like\n </LinkButton>{' '}\n ·{' '}\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Reply\n </LinkButton>{' '}\n · 2 hrs\n </small>\n </Paragraph>\n </Content>\n {/* 2nd nested media (two siblings) */}\n <Media>\n Experience has taught mankind the necessity of auxiliary precautions.\n </Media>\n <Media>Ambition must be made to counteract ambition.</Media>\n </Media.Content>\n </Media>\n {/* Second nested media */}\n <Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"48x48\"\n src=\"https://bulma.io/assets/images/placeholders/96x96.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <Paragraph>\n <Strong>Alexander Hamilton</Strong>\n <br />\n Safety from external danger is the most powerful director of\n national conduct. The desire for respect and security will always\n influence the policy of nations.\n <br />\n <small>\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Like\n </LinkButton>{' '}\n ·{' '}\n <LinkButton variant=\"underline\" size=\"small\" color=\"link\">\n Reply\n </LinkButton>{' '}\n · 2 hrs\n </small>\n </Paragraph>\n </Content>\n </Media.Content>\n </Media>\n </Media.Content>\n</Media>"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"title": "Media With Button Below",
|
|
@@ -23,15 +23,17 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "Compound (dot-notation) usage",
|
|
26
|
-
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <p>\n <strong>John Smith</strong> <small>@johnsmith</small>\n <br />\n Composed entirely from the single Media import via dot notation.\n </p>\n </Content>\n </Media.Content>\n <Media.Right>\n <Button
|
|
26
|
+
"code": "<Media>\n <Media.Left>\n <Image\n as=\"p\"\n size=\"64x64\"\n src=\"https://bulma.io/assets/images/placeholders/128x128.png\"\n alt=\"\"\n />\n </Media.Left>\n <Media.Content>\n <Content>\n <p>\n <strong>John Smith</strong> <small>@johnsmith</small>\n <br />\n Composed entirely from the single Media import via dot notation.\n </p>\n </Content>\n </Media.Content>\n <Media.Right>\n <Button size=\"small\">Reply</Button>\n </Media.Right>\n</Media>"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
|
-
"accessibility": "- The Media root renders as a semantic `<article>` by default. Use `as=\"div\"` for a generic container.\n- The left section is commonly used for avatars (as `<figure>`) and is screen-reader accessible.\n- Use clear and descriptive text in content and actions for best accessibility.\n- The `Level` rows in these examples hold actions, not navigation, so they pass `as=\"div\"` rather than render Level's default `<nav>`, a navigation landmark.\n\n:::note\nWhen using only icons or controls, provide `aria-label` or screen-reader-only content as appropriate.\n:::",
|
|
29
|
+
"accessibility": "- The Media root renders as a semantic `<article>` by default. Use `as=\"div\"` for a generic container.\n- The left section is commonly used for avatars (as `<figure>`) and is screen-reader accessible.\n- Use clear and descriptive text in content and actions for best accessibility.\n- The `Level` rows in these examples hold actions, not navigation, so they pass `as=\"div\"` rather than render Level's default `<nav>`, a navigation landmark.\n- Make an action a `<button>`, like the icon-only [`IconButton`](https://bestax.io/docs/api/elements/iconbutton)s in the first example, which require a name (`aria-label`) and hide their glyph from assistive technology. Make it a link only when it goes somewhere, with an `href`: an `<a>` without one takes no keyboard focus and isn't announced as anything to activate.\n\n:::note\nWhen using only icons or controls, provide `aria-label` or screen-reader-only content as appropriate.\n:::",
|
|
30
30
|
"related": [
|
|
31
31
|
"Button",
|
|
32
32
|
"Checkbox",
|
|
33
|
+
"IconButton",
|
|
33
34
|
"Image",
|
|
34
35
|
"Level",
|
|
36
|
+
"LinkButton",
|
|
35
37
|
"TextArea",
|
|
36
38
|
"useBulmaClasses"
|
|
37
39
|
],
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
}
|
|
380
380
|
],
|
|
381
381
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
382
|
-
"helperPropsNote": "Helper props go on the `.password-input-container` `<div>`, with `className` and `style`, so they move and size the field and its toggle together. The other attributes go on the `<input
|
|
382
|
+
"helperPropsNote": "Helper props go on the `.password-input-container` `<div>`, with `className` and `style`, so they move and size the field and its toggle together, except that the background and text helpers go on the `<input>`, since Bulma's `.input` sets its own background and font. The other attributes go on the `<input>` too.",
|
|
383
383
|
"types": []
|
|
384
384
|
},
|
|
385
385
|
{
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
}
|
|
581
581
|
],
|
|
582
582
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
583
|
-
"helperPropsNote": "Helper props go on the `.password-input-container` `<div>`, with `className` and `style`, so they move and size the field and its toggle together. The other attributes go on the `<input
|
|
583
|
+
"helperPropsNote": "Helper props go on the `.password-input-container` `<div>`, with `className` and `style`, so they move and size the field and its toggle together, except that the background and text helpers go on the `<input>`, since Bulma's `.input` sets its own background and font. The other attributes go on the `<input>` too.",
|
|
584
584
|
"types": [],
|
|
585
585
|
"standalone": "base"
|
|
586
586
|
}
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
9
|
"title": "Basic Theme Customization",
|
|
10
|
-
"code": "function BasicThemeCustomization() {\n return (\n <Theme
|
|
10
|
+
"code": "function BasicThemeCustomization() {\n return (\n <Theme\n primaryH=\"262\"\n primaryS=\"52%\"\n primaryL=\"56%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <Box p=\"4\">\n <Button color=\"primary\">Violet Primary Button</Button>\n </Box>\n </Theme>\n );\n}"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Global Theme (Root Level)",
|
|
14
|
-
"code": "function GlobalTheme() {\n return (\n <Theme
|
|
14
|
+
"code": "function GlobalTheme() {\n return (\n <Theme\n isRoot={true}\n primaryH=\"262\"\n primaryS=\"52%\"\n primaryL=\"56%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <div>\n <Button color=\"primary\">Global Violet Theme</Button>\n <Button color=\"info\">Info Button</Button>\n </div>\n </Theme>\n );\n}"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"title": "Dark Mode",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"title": "Local Theme (Component Level)",
|
|
26
|
-
"code": "function LocalTheme() {\n return (\n <div>\n <Button color=\"primary\">Standard Primary</Button>\n\n <Theme
|
|
26
|
+
"code": "function LocalTheme() {\n return (\n <div>\n <Button color=\"primary\">Standard Primary</Button>\n\n <Theme\n primaryH=\"158\"\n primaryS=\"64%\"\n primaryL=\"30%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <Button color=\"primary\">Emerald Primary</Button>\n </Theme>\n\n <Button color=\"primary\">Standard Primary Again</Button>\n </div>\n );\n}"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"title": "Using CSS Variables Object",
|
|
30
|
-
"code": "function SunsetTheme() {\n const sunsetTheme = {\n '--bulma-scheme-h': '
|
|
30
|
+
"code": "function SunsetTheme() {\n // Amber, coral, rose and violet on warm neutrals. A new color keeps the\n // label lightness the stylesheet was built with, so each sets its own.\n const sunsetTheme = {\n '--bulma-scheme-h': '24',\n '--bulma-scheme-s': '22%',\n '--bulma-primary-h': '12',\n '--bulma-primary-s': '76%',\n '--bulma-primary-l': '44%',\n '--bulma-primary-invert-l': '100%',\n '--bulma-link-h': '340',\n '--bulma-link-s': '62%',\n '--bulma-link-l': '48%',\n '--bulma-link-invert-l': '100%',\n '--bulma-info-h': '262',\n '--bulma-info-s': '52%',\n '--bulma-info-l': '56%',\n '--bulma-info-invert-l': '100%',\n '--bulma-warning-h': '38',\n '--bulma-warning-s': '95%',\n '--bulma-warning-l': '54%',\n '--bulma-warning-invert-l': '10%',\n };\n\n return (\n <Theme bulmaVars={sunsetTheme} isRoot>\n <Box p=\"4\">\n <Title>Sunset Theme</Title>\n <Button color=\"primary\">Sunset Button</Button>\n <Button color=\"info\">Info Button</Button>\n </Box>\n </Theme>\n );\n}"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Advanced CSS Variables Usage",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"title": "Complete Color Scheme",
|
|
46
|
-
"code": "function ForestTheme() {\n const forestScheme = {\n schemeH: '
|
|
46
|
+
"code": "function ForestTheme() {\n // Pine, lake, fern, ochre and berry on cool green neutrals\n const forestScheme = {\n schemeH: '140',\n schemeS: '16%',\n primaryH: '152',\n primaryS: '50%',\n primaryL: '32%',\n linkH: '195',\n linkS: '65%',\n linkL: '34%',\n successH: '95',\n successS: '40%',\n successL: '33%',\n warningH: '36',\n warningS: '85%',\n warningL: '52%',\n dangerH: '352',\n dangerS: '60%',\n dangerL: '48%',\n };\n // The label lightnesses have no named prop, so they go through bulmaVars\n const forestLabels = {\n '--bulma-primary-invert-l': '100%',\n '--bulma-link-invert-l': '100%',\n '--bulma-success-invert-l': '100%',\n '--bulma-warning-invert-l': '10%',\n '--bulma-danger-invert-l': '100%',\n };\n\n return (\n <Theme {...forestScheme} bulmaVars={forestLabels} isRoot>\n <Box p=\"4\">\n <Title>Forest Theme</Title>\n <Button color=\"primary\">Forest Primary</Button>\n <Button color=\"link\">Link</Button>\n <Button color=\"success\">Success</Button>\n <Button color=\"warning\">Warning</Button>\n <Button color=\"danger\">Danger</Button>\n </Box>\n </Theme>\n );\n}"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"title": "Theme with Styling",
|
|
50
|
-
"code": "function StyledTheme() {\n return (\n <Theme\n className=\"
|
|
50
|
+
"code": "function StyledTheme() {\n return (\n <Theme\n className=\"has-background-primary-soft has-text-primary-bold\"\n primaryH=\"40\"\n primaryS=\"92%\"\n primaryL=\"52%\"\n bulmaVars={{ '--bulma-primary-invert-l': '10%' }}\n p=\"5\"\n m=\"3\"\n radius=\"large\"\n textAlign=\"centered\"\n >\n <Title>Amber Panel</Title>\n <Button color=\"primary\">Amber Primary</Button>\n </Theme>\n );\n}"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"title": "Nested Themes",
|
|
54
|
-
"code": "function NestedThemes() {\n return (\n <Theme
|
|
54
|
+
"code": "function NestedThemes() {\n return (\n <Theme\n primaryH=\"218\"\n primaryS=\"52%\"\n primaryL=\"48%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n p=\"4\"\n >\n <Title>Outer Theme (Ink Blue)</Title>\n <Button color=\"primary\">Ink Blue Primary</Button>\n\n {/* Sets only the trio: the white label comes from the outer Theme */}\n <Theme primaryH=\"160\" primaryS=\"45%\" primaryL=\"32%\" p=\"3\" mt=\"4\">\n <Title size=\"4\">Inner Theme (Green)</Title>\n <Button color=\"primary\">Green Primary</Button>\n </Theme>\n\n <Button color=\"primary\" mt=\"3\">\n Ink Blue Primary Again\n </Button>\n </Theme>\n );\n}"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"title": "Theme with ConfigProvider",
|
|
58
|
-
"code": "function PrefixedTheme() {\n return (\n <ConfigProvider classPrefix=\"bestax-\">\n <Theme
|
|
58
|
+
"code": "function PrefixedTheme() {\n return (\n <ConfigProvider classPrefix=\"bestax-\">\n <Theme\n primaryH=\"236\"\n primaryS=\"55%\"\n primaryL=\"58%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n isRoot\n >\n <Button color=\"primary\">Prefixed & Themed Button</Button>\n </Theme>\n </ConfigProvider>\n );\n}"
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
"accessibility": null,
|
|
@@ -471,5 +471,5 @@
|
|
|
471
471
|
}
|
|
472
472
|
],
|
|
473
473
|
"cssVars": [],
|
|
474
|
-
"doc": "# Theme\n\n## Overview\n\nThe `Theme` component provides a powerful way to customize Bulma's appearance using CSS custom properties (CSS variables). It allows you to override Bulma's design tokens like colors, spacing, typography, and other visual properties either globally or locally within specific component trees. The Theme component supports both CSS variable injection via props and direct CSS variable objects.\n\n---\n\n## Import\n\n```tsx\nimport { Theme } from '@allxsmith/bestax-bulma';\n```\n\n---\n\n## Usage\n\n### Basic Theme Customization\n\n```tsx\nfunction BasicThemeCustomization() {\n return (\n <Theme primaryH=\"270\" primaryS=\"100%\" primaryL=\"50%\">\n <Box p=\"4\">\n <Button color=\"primary\">Purple Primary Button</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Global Theme (Root Level)\n\n```tsx\nfunction GlobalTheme() {\n return (\n <Theme isRoot={true} primaryH=\"270\" primaryS=\"100%\" primaryL=\"50%\">\n <div>\n <Button color=\"primary\">Global Purple Theme</Button>\n <Button color=\"info\">Info Button</Button>\n </div>\n </Theme>\n );\n}\n```\n\nA root theme writes its variables before the browser paints what it rendered, so an app rendered\nin the browser shows them from its first frame of content. A server render doesn't include them,\nso a page rendered on the server paints with the stylesheet's values until it hydrates. Put the\nvalues that page needs from its first paint in your CSS, on `:root`.\n\n### Dark Mode\n\nThe `colorMode` prop sets Bulma's `data-theme` on `<html>`, flipping the light/dark scheme globally.\nUse `'system'` to follow the OS preference.\n\nA prefixed stylesheet reads Bulma's prefixed attribute instead (`data-bestax-theme` for\n`bestax-prefixed.css` and `bestax-no-helpers-prefixed.css`). Under a `ConfigProvider`\n`classPrefix`, `colorMode` writes that attribute as well as `data-theme`, so it works with the\nprefixed builds.\n\n:::warning Single-mode designs should pin the scheme\n\nOmitting `colorMode` preserves whatever `data-theme` is already set — and when nothing has set\none (the usual case), the scheme follows the visitor's OS: Bulma's text colors flip on a\ndark-mode machine even if your design is light-only, breaking contrast against any fixed custom\nbackgrounds. If you support only one mode, pin it on the `<html>` in your `index.html`\n(`<html lang=\"en\" data-theme=\"light\">`); if you support both, don't hardcode surface/text\ncolors — see [Dark Mode & Contrast](https://bestax.io/docs/guides/features/css-variables#dark-mode--contrast).\n\n:::\n\n`colorMode` writes the attribute before the browser paints what `Theme` rendered, but the page can\npaint before the app's script runs at all, with whatever `<html>` already has, which is why a\nfixed scheme belongs in `index.html`. A toggle that remembers the visitor's choice has two parts.\nFirst, an inline script in the `<head>` of `index.html` writes the saved choice, or else the OS\npreference, before the first paint. Make it a plain `<script>`, not `type=\"module\"`, so it runs\nbefore the body renders. With a prefixed stylesheet, have it set `data-bestax-theme` as well.\n\n```html\n<script>\n // Bulma's scheme on <html> before the first paint: the saved choice,\n // or else the OS preference. The app saves under the same key.\n (() => {\n let saved = null;\n try {\n saved = localStorage.getItem('theme');\n } catch {\n // Storage is blocked, so fall back to the OS preference.\n }\n const dark =\n saved === 'light' || saved === 'dark'\n ? saved === 'dark'\n : window.matchMedia('(prefers-color-scheme: dark)').matches;\n document.documentElement.setAttribute(\n 'data-theme',\n dark ? 'dark' : 'light'\n );\n })();\n</script>\n```\n\nSecond, the app starts `colorMode` from the attribute the script wrote, and saves each choice\nunder the key the script reads. The `bestax-theming` skill's\n[dark-mode example](https://github.com/allxsmith/bestax/blob/main/skills/bestax-theming/examples/dark-mode.tsx)\nis the same recipe, and also covers a page that has no script.\n\n```tsx\n// Pairs with an inline <head> script in index.html that writes data-theme\n// before the first paint: the choice saved under STORAGE_KEY, or else the\n// OS preference. The Theme API page's Dark Mode section has the script.\nimport { useState } from 'react';\nimport { Theme, ToggleButton } from '@allxsmith/bestax-bulma';\n\ntype ColorMode = 'light' | 'dark';\n\n// The key the index.html script reads the saved choice from.\nconst STORAGE_KEY = 'theme';\n\n// The scheme the index.html script wrote on <html>.\nfunction initialColorMode(): ColorMode {\n if (typeof document === 'undefined') return 'light';\n return document.documentElement.getAttribute('data-theme') === 'dark'\n ? 'dark'\n : 'light';\n}\n\nfunction App() {\n const [mode, setMode] = useState<ColorMode>(initialColorMode);\n\n const setDark = (dark: boolean) => {\n const next: ColorMode = dark ? 'dark' : 'light';\n setMode(next);\n try {\n localStorage.setItem(STORAGE_KEY, next);\n } catch {\n // Storage is blocked, so the choice lasts until the page reloads.\n }\n };\n\n return (\n <Theme isRoot colorMode={mode}>\n <ToggleButton pressed={mode === 'dark'} onPressedChange={setDark}>\n Dark mode\n </ToggleButton>\n </Theme>\n );\n}\n```\n\n### Label and Text Lightnesses\n\nA color's trio recolors the color, but two of its lightnesses stay where the stylesheet's Sass\nbuild put them for the color it was built with: its label on a solid surface,\n`--bulma-<color>-invert-l`, and its text on the page, `--bulma-<color>-on-scheme-l`. bestax builds\nits primary from a dark blue, so a light primary set through the trio alone keeps white labels\nit can't carry. A color that reads lighter or darker than the built one sets both through\n`bulmaVars`.\n\nThe text has to read on a light page and on a dark one, so Bulma gives each scheme its own\non-scheme lightness. On a root theme, an on-scheme key takes `{ light, dark }`, and each value\napplies wherever Bulma's own value for that scheme would. A scheme you leave out keeps the\nstylesheet's value, and a string sets one value for both.\n\n```tsx\nfunction StockTurquoise() {\n // Stock Bulma's turquoise, with the values from bulma/css/bulma.css.\n return (\n <Theme\n isRoot\n primaryH=\"171deg\"\n primaryS=\"100%\"\n primaryL=\"41%\"\n bulmaVars={{\n '--bulma-primary-invert-l': 'var(--bulma-primary-05-l)',\n '--bulma-primary-on-scheme-l': { light: '21%', dark: '41%' },\n }}\n >\n <Button color=\"primary\">Dark label</Button>\n <Block textColor=\"primary\" colorShade=\"on-scheme\">\n Turquoise text that reads in both schemes\n </Block>\n </Theme>\n );\n}\n```\n\nA local theme writes its variables as an inline style, which can't hold a value per scheme, so it\nskips `{ light, dark }` and warns in development. Give it a string, or set the per-scheme values\nin your CSS. `bestax-no-dark-mode.css` has no dark scheme, so with it give a string. The\n`bestax-theming` skill's\n[CSS variables reference](https://github.com/allxsmith/bestax/blob/main/skills/bestax-theming/references/css-variables.md)\nsays what reads each lightness and how to pick the values.\n\n### Local Theme (Component Level)\n\n```tsx\nfunction LocalTheme() {\n return (\n <div>\n <Button color=\"primary\">Standard Primary</Button>\n\n <Theme primaryH=\"120\" primaryS=\"100%\" primaryL=\"40%\">\n <Button color=\"primary\">Green Primary</Button>\n </Theme>\n\n <Button color=\"primary\">Standard Primary Again</Button>\n </div>\n );\n}\n```\n\n### Using CSS Variables Object\n\n```tsx\nfunction SunsetTheme() {\n const sunsetTheme = {\n '--bulma-scheme-h': '18',\n '--bulma-scheme-s': '90%',\n '--bulma-light-l': '85%',\n '--bulma-dark-l': '20%',\n '--bulma-primary-h': '25',\n '--bulma-primary-s': '85%',\n '--bulma-primary-l': '55%',\n };\n\n return (\n <Theme bulmaVars={sunsetTheme} isRoot>\n <Box p=\"4\">\n <Title>Sunset Theme</Title>\n <Button color=\"primary\">Sunset Button</Button>\n <Button color=\"info\">Info Button</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Advanced CSS Variables Usage\n\nBulma derives the body font and the control radius from these variables at `:root`, so set\ntypography and radius on an `isRoot` theme.\n\n```tsx\nfunction TypographyTheme() {\n const typographyTheme = {\n '--bulma-family-primary': '\"Helvetica Neue\", sans-serif',\n '--bulma-family-code': '\"Fira Code\", monospace',\n '--bulma-size-normal': '16px',\n '--bulma-weight-bold': '700',\n };\n\n return (\n <Theme isRoot bulmaVars={typographyTheme}>\n <Title>Custom Typography</Title>\n <SubTitle>With custom fonts and weights</SubTitle>\n </Theme>\n );\n}\n```\n\n```tsx\nfunction RadiusTheme() {\n // `radius` is the border radius helper, as on every component, so the radius scale goes through bulmaVars\n const radii = {\n '--bulma-radius-small': '6px',\n '--bulma-radius': '12px',\n '--bulma-radius-medium': '16px',\n '--bulma-radius-large': '20px',\n };\n\n return (\n <Theme isRoot bulmaVars={radii}>\n <Button color=\"primary\">Rounder Button</Button>\n </Theme>\n );\n}\n```\n\nSpacing that Bulma reads where it is used, such as the block and column gaps, works on a scoped\ntheme:\n\n```tsx\nfunction SpacingTheme() {\n const spacingTheme = {\n '--bulma-block-spacing': '2rem',\n '--bulma-column-gap': '1rem',\n };\n\n return (\n <Theme bulmaVars={spacingTheme}>\n <Columns>\n <Column>\n <Box>Wider column gap</Box>\n <Box>Wider block spacing</Box>\n </Column>\n <Column>\n <Box>Wider column gap</Box>\n </Column>\n </Columns>\n </Theme>\n );\n}\n```\n\n### Complete Color Scheme\n\n```tsx\nfunction ForestTheme() {\n const forestScheme = {\n schemeH: '150', // forest green hue\n schemeS: '50%',\n lightL: '80%',\n lightInvertL: '20%',\n darkL: '18%',\n darkInvertL: '85%',\n softL: '55%',\n boldL: '35%',\n primaryH: '160',\n primaryS: '60%',\n primaryL: '45%',\n linkH: '155',\n linkS: '65%',\n linkL: '40%',\n successH: '120',\n successS: '70%',\n successL: '45%',\n warningH: '45',\n warningS: '85%',\n warningL: '55%',\n dangerH: '355',\n dangerS: '75%',\n dangerL: '50%',\n hoverBackgroundLDelta: '4%',\n activeBackgroundLDelta: '8%',\n };\n\n return (\n <Theme {...forestScheme} isRoot>\n <Box p=\"4\">\n <Title>Forest Theme</Title>\n <Button color=\"primary\">Forest Primary</Button>\n <Button color=\"success\">Success</Button>\n <Button color=\"info\">Info</Button>\n <Button color=\"warning\">Warning</Button>\n <Button color=\"danger\">Danger</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Theme with Styling\n\n```tsx\nfunction StyledTheme() {\n return (\n <Theme\n className=\"custom-theme-wrapper\"\n primaryH=\"45\"\n primaryS=\"100%\"\n primaryL=\"50%\"\n p=\"5\"\n m=\"3\"\n textAlign=\"centered\"\n >\n <Title>Styled Theme Container</Title>\n <Button color=\"primary\">Styled Button</Button>\n </Theme>\n );\n}\n```\n\n### Nested Themes\n\n```tsx\nfunction NestedThemes() {\n return (\n <Theme primaryH=\"210\" primaryS=\"60%\" primaryL=\"45%\" p=\"4\">\n <Title>Outer Theme (Blue)</Title>\n <Button color=\"primary\">Blue Primary</Button>\n\n <Theme primaryH=\"120\" primaryS=\"70%\" primaryL=\"40%\" p=\"3\" mt=\"4\">\n <Title size=\"4\">Inner Theme (Green)</Title>\n <Button color=\"primary\">Green Primary</Button>\n </Theme>\n\n <Button color=\"primary\" mt=\"3\">\n Blue Primary Again\n </Button>\n </Theme>\n );\n}\n```\n\n### Theme with ConfigProvider\n\n```tsx\nfunction PrefixedTheme() {\n return (\n <ConfigProvider classPrefix=\"bestax-\">\n <Theme primaryH=\"300\" primaryS=\"80%\" primaryL=\"50%\" isRoot>\n <Button color=\"primary\">Prefixed & Themed Button</Button>\n </Theme>\n </ConfigProvider>\n );\n}\n```\n\n---\n\n## Best Practices\n\n### Global vs Local Themes\n\n- Use `isRoot={true}` for application-wide themes that should affect all components\n- Use local themes (default `isRoot={false}`) for component-specific styling or theme variations\n- Local themes inherit from parent themes and can override specific variables\n- Several `isRoot` themes can be mounted at once, such as a color theme at the app root and a\n typography theme next to it. Each adds its own variables at `:root`; where two set the same\n variable, the inner or later-mounted one wins, as with nested local themes, and unmounting one\n removes only its own variables\n\n### CSS Variable Naming\n\n- All Bulma CSS variables follow the `--bulma-*` naming convention\n- Named props exist for the scheme and color variables only (like `primaryH`); every other variable, typography and radius included, goes through `bulmaVars`\n- `bulmaVars` keys are the full variable names (`'--bulma-family-primary'`), not camelCase\n- `bulmaVars` also accepts the scheme surface variables — `--bulma-scheme-main`, `--bulma-scheme-main-bis`, `--bulma-scheme-main-ter`, `--bulma-scheme-invert`, `--bulma-scheme-invert-bis`, `--bulma-scheme-invert-ter` — so overriding `--bulma-scheme-main-bis`/`-ter` re-tints every scheme-background band (e.g., `<Section bgColor=\"scheme-main-bis\">`) at once\n- `bulmaVars` also accepts each color's label and text lightnesses, `--bulma-<color>-invert-l` and `--bulma-<color>-on-scheme-l`, which a new trio does not move. On a root theme the on-scheme ones take a value per scheme (see [Label and Text Lightnesses](https://bestax.io/docs/api/helpers/theme#label-and-text-lightnesses))\n- `bulmaVars` also accepts `--bulma-shadow` (plus `--bulma-shadow-h`/`-s`/`-l`) — the upstream token that `.box`, `.card`, `.dropdown`, and `.panel` derive their own shadow variables from. Those selectors re-declare their derived variable (e.g. `--bulma-box-shadow`) on themselves, so setting it from an ancestor `Theme` is only inherited and never wins; overriding `--bulma-shadow` itself is the one override that cascades. There is no individual `shadow` prop for this — `shadow` already names the unrelated `shadowless` helper class — so reach it through `bulmaVars`\n\n### Performance Considerations\n\n- Prefer setting themes at higher levels in your component tree rather than deeply nested\n- CSS variables are inherited, so child themes only need to override specific variables\n\n### Color System\n\n- Bulma uses HSL (Hue, Saturation, Lightness) for its color system\n- Hue values range from 0-360 (color wheel degrees)\n- Saturation and Lightness are typically percentages (e.g., '50%')\n- The scheme variables control the base color relationships\n\n---\n\n## API Reference\n\n### Named Props and `bulmaVars`\n\n`ThemeProps` has a named, camelCase prop for each scheme and color variable, listed under\n[CSS Variable Props](https://bestax.io/docs/api/helpers/theme#css-variable-props). Each converts to its CSS variable by the same rule:\n\n```\npropName → --bulma-prop-name\n```\n\n- `primaryH` → `--bulma-primary-h`\n- `schemeS` → `--bulma-scheme-s`\n- `lightL` → `--bulma-light-l`\n- `hoverBackgroundLDelta` → `--bulma-hover-background-l-delta`\n\nEvery other variable (typography, radius, spacing, and the rest) has no named prop in\n`ThemeProps` and goes through `bulmaVars`, keyed by its full `--bulma-*` name. JavaScript code\nthat passes one as a camelCase prop (`familyPrimary`) may still render, but it is outside the\ntyped API, so move it to `bulmaVars`:\n\n```tsx\n<Theme\n isRoot\n primaryH=\"350\"\n primaryS=\"73%\"\n primaryL=\"44%\"\n bulmaVars={{\n '--bulma-radius': '2px',\n '--bulma-radius-small': '1px',\n '--bulma-family-primary': '\"IBM Plex Sans\", system-ui, sans-serif',\n '--bulma-family-code': '\"IBM Plex Mono\", ui-monospace, monospace',\n }}\n>\n <App />\n</Theme>\n```\n\nSome of those names are already helper props, so they cannot double as CSS-variable props:\n\n- `radius` is the border radius helper, as on every other component, so `<Theme radius=\"radiusless\">`\n adds `is-radiusless` to the wrapper. On a Theme it also sets `--bulma-radius` to `0`, so what\n is inside the Theme loses its radius too; under `isRoot` it writes that at `:root`, squaring\n everything on the page that takes its radius from it. The sizes (`small`, `normal`, `large`,\n `rounded`) add their `has-radius-*` class to the wrapper and set no variable, so they round\n the wrapper and leave what is inside alone; under `isRoot` there is no wrapper, so they do\n nothing and warn in development. Set any other `--bulma-radius` through\n `bulmaVars`. `<Theme radius=\"2px\" />` is a type error; in JavaScript it still sets\n `--bulma-radius`, which is how the prop used to behave, but that route is deprecated and logs\n a warning in development.\n- `shadow` is the `shadowless` helper. Set `--bulma-shadow` through `bulmaVars`.\n- `columnGap` is the column gap helper, as on every other component, so `<Theme columnGap=\"2\">`\n adds `is-column-gap-2` to the wrapper and sets no variable; under `isRoot` there is no wrapper,\n so it does nothing and warns in development. Set the columns gutter, `--bulma-column-gap`,\n through `bulmaVars`. Before the gap helpers, JavaScript could pass `columnGap` to set that\n variable. A string that is not a gap step (`columnGap=\"1rem\"`) still does, through a\n deprecated route that logs a warning in development, but a gap step does not:\n `columnGap=\"0\"`, which used to zero the gutters inside the Theme, now adds `is-column-gap-0`\n to the wrapper.\n\n### Props vs bulmaVars\n\nYou can set the scheme and color variables in two ways:\n\n1. **Named Props** (recommended where one exists):\n\n ```tsx\n <Theme primaryH=\"270\" primaryS=\"100%\" primaryL=\"50%\">\n <App />\n </Theme>\n ```\n\n2. **bulmaVars Object** (for every other variable, or when you have many to set):\n\n ```tsx\n <Theme\n bulmaVars={{\n '--bulma-primary-h': '270',\n '--bulma-primary-s': '100%',\n '--bulma-primary-l': '50%',\n '--bulma-block-spacing': '2rem',\n }}\n >\n <App />\n </Theme>\n ```\n\n3. **Combined** (props take precedence over bulmaVars):\n ```tsx\n <Theme\n primaryH=\"270\" // This takes precedence\n bulmaVars={{\n '--bulma-primary-h': '180', // This is overridden\n '--bulma-block-spacing': '2rem',\n }}\n >\n <App />\n </Theme>\n ```\n\n### TypeScript Support\n\n`bulmaVars` is typed as a partial record keyed by the union of every variable `Theme` accepts.\nWrite it as an object literal and your editor autocompletes the keys and flags a misspelled or\nunsupported one as a type error. A separately declared object only has to share one valid key\nto typecheck, so a typo in it is silently dropped; annotate it with\n`satisfies ThemeProps['bulmaVars']` to keep the check:\n\n```tsx\n<Theme\n primaryH=\"270\"\n bulmaVars={{\n '--bulma-block-spacing': '2rem', // start typing '--bulma-' to list the rest\n }}\n>\n <App />\n</Theme>\n```\n\n---\n\n## See Also\n\n- [ConfigProvider](https://bestax.io/docs/api/helpers/config) - For class prefixing and configuration\n- [useBulmaClasses](https://bestax.io/docs/api/helpers/usebulmaclasses) - For applying Bulma helper classes\n- [Bulma CSS Variables Documentation](https://bulma.io/documentation/features/css-variables/) - Official Bulma CSS variables reference\n\n---\n\n## Props\n\n| Prop | Type | Description |\n| ----------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `children` | `ReactNode` | The child components to apply the theme to. |\n| `className` | `string` | Additional CSS classes for the theme wrapper. A root theme has no wrapper, so under `isRoot` it does nothing and warns in development. |\n| `isRoot` | `boolean` | When `true`, applies CSS variables globally at `:root` level. When `false` (default), applies variables only to the wrapper div. Several root themes compose; an inner or later-mounted one wins a variable they share. The variables are written before the browser paints the theme's content, and a server render doesn't include them. A root theme renders no wrapper, so `className` and the helper props, such as `m` or `shadow`, do nothing on it and warn in development. |\n| `colorMode` | `'light' \\| 'dark' \\| 'system'` | Sets Bulma's light/dark scheme by writing the `data-theme` attribute on `<html>`, plus `data-<prefix>theme` inside a `ConfigProvider` with a `classPrefix`. If the prefix cannot form an attribute name, `'light'` and `'dark'` write only `data-theme` and warn in development. Always global (even on a scoped `Theme`). `'system'` removes them so Bulma follows the OS `prefers-color-scheme`. Omit to leave the current setting untouched. |\n| `bulmaVars` | `ThemeProps['bulmaVars']` | Object mapping Bulma CSS variable names to string values (e.g., `{'--bulma-primary-h': '210'}`). Keys are limited to the `BulmaVars` type; anything else is not applied. Each color's `--bulma-<color>-on-scheme-l` also takes `{ light, dark }` on a root theme, as [Label and Text Lightnesses](https://bestax.io/docs/api/helpers/theme#label-and-text-lightnesses) says. A variable Bulma declares on the component itself changes nothing from here and warns in development; see [Which Variables a Theme Can Change](https://bestax.io/docs/api/helpers/theme#which-variables-a-theme-can-change). |\n| `columnGap` | [`BulmaGapStep`](https://bestax.io/docs/api/helpers/valid-values) | The column gap helper: a gap step adds `is-column-gap-<step>` to the wrapper div and sets no variable, so under `isRoot` it does nothing and warns in development. Set `--bulma-column-gap` through `bulmaVars`. Any other string still sets `--bulma-column-gap`, a deprecated route that warns in development. |\n| `radius` | `'radiusless' \\| 'small' \\| 'normal' \\| 'large' \\| 'rounded'` | The border radius helper. `radiusless` adds `is-radiusless` to the wrapper div and sets `--bulma-radius` to `0`, at `:root` under `isRoot`. The sizes add their `has-radius-*` class to the wrapper and set no variable, so under `isRoot` they do nothing and warn in development. Any other string still sets `--bulma-radius`, a deprecated route that warns in development. |\n\n### CSS Variable Props\n\nThe Theme component accepts individual CSS variable props that correspond to Bulma's design tokens. These props are automatically converted to their corresponding CSS custom properties (e.g., `primaryH` → `--bulma-primary-h`).\n\n#### Scheme Variables\n\n| Prop | Type | Description | CSS Variable |\n| ------------------------ | -------- | ------------------------------------------------- | ----------------------------------- |\n| `schemeH` | `string` | Base hue for the color scheme (0-360) | `--bulma-scheme-h` |\n| `schemeS` | `string` | Base saturation for the color scheme (percentage) | `--bulma-scheme-s` |\n| `lightL` | `string` | Lightness value for light backgrounds | `--bulma-light-l` |\n| `lightInvertL` | `string` | Inverted lightness for light backgrounds | `--bulma-light-invert-l` |\n| `darkL` | `string` | Lightness value for dark backgrounds | `--bulma-dark-l` |\n| `darkInvertL` | `string` | Inverted lightness for dark backgrounds | `--bulma-dark-invert-l` |\n| `softL` | `string` | Lightness value for soft colors | `--bulma-soft-l` |\n| `boldL` | `string` | Lightness value for bold colors | `--bulma-bold-l` |\n| `softInvertL` | `string` | Inverted lightness for soft colors | `--bulma-soft-invert-l` |\n| `boldInvertL` | `string` | Inverted lightness for bold colors | `--bulma-bold-invert-l` |\n| `hoverBackgroundLDelta` | `string` | Lightness delta for hover background states | `--bulma-hover-background-l-delta` |\n| `activeBackgroundLDelta` | `string` | Lightness delta for active background states | `--bulma-active-background-l-delta` |\n| `hoverBorderLDelta` | `string` | Lightness delta for hover border states | `--bulma-hover-border-l-delta` |\n| `activeBorderLDelta` | `string` | Lightness delta for active border states | `--bulma-active-border-l-delta` |\n| `hoverColorLDelta` | `string` | Lightness delta for hover text color states | `--bulma-hover-color-l-delta` |\n| `activeColorLDelta` | `string` | Lightness delta for active text color states | `--bulma-active-color-l-delta` |\n| `hoverShadowADelta` | `string` | Alpha delta for hover shadow states | `--bulma-hover-shadow-a-delta` |\n| `activeShadowADelta` | `string` | Alpha delta for active shadow states | `--bulma-active-shadow-a-delta` |\n\n#### Color Variables\n\n| Prop | Type | Description | CSS Variable |\n| ---------- | -------- | ------------------------------------- | ------------------- |\n| `primaryH` | `string` | Primary color hue (0-360) | `--bulma-primary-h` |\n| `primaryS` | `string` | Primary color saturation (percentage) | `--bulma-primary-s` |\n| `primaryL` | `string` | Primary color lightness (percentage) | `--bulma-primary-l` |\n| `linkH` | `string` | Link color hue (0-360) | `--bulma-link-h` |\n| `linkS` | `string` | Link color saturation (percentage) | `--bulma-link-s` |\n| `linkL` | `string` | Link color lightness (percentage) | `--bulma-link-l` |\n| `infoH` | `string` | Info color hue (0-360) | `--bulma-info-h` |\n| `infoS` | `string` | Info color saturation (percentage) | `--bulma-info-s` |\n| `infoL` | `string` | Info color lightness (percentage) | `--bulma-info-l` |\n| `successH` | `string` | Success color hue (0-360) | `--bulma-success-h` |\n| `successS` | `string` | Success color saturation (percentage) | `--bulma-success-s` |\n| `successL` | `string` | Success color lightness (percentage) | `--bulma-success-l` |\n| `warningH` | `string` | Warning color hue (0-360) | `--bulma-warning-h` |\n| `warningS` | `string` | Warning color saturation (percentage) | `--bulma-warning-s` |\n| `warningL` | `string` | Warning color lightness (percentage) | `--bulma-warning-l` |\n| `dangerH` | `string` | Danger color hue (0-360) | `--bulma-danger-h` |\n| `dangerS` | `string` | Danger color saturation (percentage) | `--bulma-danger-s` |\n| `dangerL` | `string` | Danger color lightness (percentage) | `--bulma-danger-l` |\n\n#### Shadow Variables\n\nReachable only through `bulmaVars` — there is no individual prop, since `shadow` already names\nthe `BulmaOtherProps` `shadowless` helper class. As noted above, `--bulma-shadow` is the one\noverride that cascades into `.box`/`.card`/`.dropdown`/`.panel` shadows.\n\n| CSS Variable | Description |\n| ------------------ | ----------------------------------------------------------------------------------------------------- |\n| `--bulma-shadow-h` | Shadow color hue (0-360) |\n| `--bulma-shadow-s` | Shadow color saturation (percentage) |\n| `--bulma-shadow-l` | Shadow color lightness (percentage) |\n| `--bulma-shadow` | The full shadow value that `.box`/`.card`/`.dropdown`/`.panel` derive their own shadow variables from |\n\n#### Which Variables a Theme Can Change\n\n`bulmaVars` takes any key of the `BulmaVars` type. Write it as an object literal and your editor\nlists them as you type `'--bulma-'`. Not every one of those keys does something from a `Theme`,\nthough, and the reason is where Bulma declares the variable.\n\nA `Theme` writes its variables on its wrapper `div`, or at `:root` under `isRoot`. A component\ninherits them from there only if it declares no value of its own, because an element's own\ndeclaration always beats an inherited one.\n\n- **Global variables reach everything under the Theme.** Bulma declares the scheme, color and\n shadow variables above, and the typography, radius, spacing and timing tokens (such as\n `--bulma-family-primary` and `--bulma-radius`), on `:root`. Set them on a `Theme`, or on any\n ancestor. Some of them Bulma also declares again on one component, which keeps its own value\n while everything else takes the Theme's. That component's API page lists the variable as\n declared on it.\n- **Component variables have to be set on the component.** Where Bulma declares a variable on\n the component's own element, as it does `--bulma-card-radius`, `--bulma-tag-h` and\n `--bulma-delete-dimensions`, a value a `Theme` sets never reaches it. Those keys are still\n accepted, so existing code keeps compiling, but they change nothing, and `Theme` logs a\n warning in development naming them. Set them on the component instead, with\n `className` (a class in your own stylesheet) or the `style` prop, or at build time through\n [Sass](https://bestax.io/docs/guides/features/sass-customization).\n\nEach component's API page lists its variables under **CSS & Sass Variables** and says where Bulma\ndeclares them, so check there before reaching for a `Theme`. The\n[shadow note](https://bestax.io/docs/api/helpers/theme#css-variable-naming) above is the same rule in action: `--bulma-box-shadow` lives on\n`.box`, so the way to change box shadows from a `Theme` is the global `--bulma-shadow` they derive\nfrom.\n\nThe Theme component also supports all [Bulma helper class props](https://bestax.io/docs/api/helpers/usebulmaclasses) for styling the wrapper element."
|
|
474
|
+
"doc": "# Theme\n\n## Overview\n\nThe `Theme` component provides a powerful way to customize Bulma's appearance using CSS custom properties (CSS variables). It allows you to override Bulma's design tokens like colors, spacing, typography, and other visual properties either globally or locally within specific component trees. The Theme component supports both CSS variable injection via props and direct CSS variable objects.\n\n---\n\n## Import\n\n```tsx\nimport { Theme } from '@allxsmith/bestax-bulma';\n```\n\n---\n\n## Usage\n\n### Basic Theme Customization\n\n```tsx\nfunction BasicThemeCustomization() {\n return (\n <Theme\n primaryH=\"262\"\n primaryS=\"52%\"\n primaryL=\"56%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <Box p=\"4\">\n <Button color=\"primary\">Violet Primary Button</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Global Theme (Root Level)\n\n```tsx\nfunction GlobalTheme() {\n return (\n <Theme\n isRoot={true}\n primaryH=\"262\"\n primaryS=\"52%\"\n primaryL=\"56%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <div>\n <Button color=\"primary\">Global Violet Theme</Button>\n <Button color=\"info\">Info Button</Button>\n </div>\n </Theme>\n );\n}\n```\n\nA root theme writes its variables before the browser paints what it rendered, so an app rendered\nin the browser shows them from its first frame of content. A server render doesn't include them,\nso a page rendered on the server paints with the stylesheet's values until it hydrates. Put the\nvalues that page needs from its first paint in your CSS, on `:root`.\n\n### Dark Mode\n\nThe `colorMode` prop sets Bulma's `data-theme` on `<html>`, flipping the light/dark scheme globally.\nUse `'system'` to follow the OS preference.\n\nA prefixed stylesheet reads Bulma's prefixed attribute instead (`data-bestax-theme` for\n`bestax-prefixed.css` and `bestax-no-helpers-prefixed.css`). Under a `ConfigProvider`\n`classPrefix`, `colorMode` writes that attribute as well as `data-theme`, so it works with the\nprefixed builds.\n\n:::warning Single-mode designs should pin the scheme\n\nOmitting `colorMode` preserves whatever `data-theme` is already set — and when nothing has set\none (the usual case), the scheme follows the visitor's OS: Bulma's text colors flip on a\ndark-mode machine even if your design is light-only, breaking contrast against any fixed custom\nbackgrounds. If you support only one mode, pin it on the `<html>` in your `index.html`\n(`<html lang=\"en\" data-theme=\"light\">`); if you support both, don't hardcode surface/text\ncolors — see [Dark Mode & Contrast](https://bestax.io/docs/guides/features/css-variables#dark-mode--contrast).\n\n:::\n\n`colorMode` writes the attribute before the browser paints what `Theme` rendered, but the page can\npaint before the app's script runs at all, with whatever `<html>` already has, which is why a\nfixed scheme belongs in `index.html`. A toggle that remembers the visitor's choice has two parts.\nFirst, an inline script in the `<head>` of `index.html` writes the saved choice, or else the OS\npreference, before the first paint. Make it a plain `<script>`, not `type=\"module\"`, so it runs\nbefore the body renders. With a prefixed stylesheet, have it set `data-bestax-theme` as well.\n\n```html\n<script>\n // Bulma's scheme on <html> before the first paint: the saved choice,\n // or else the OS preference. The app saves under the same key.\n (() => {\n let saved = null;\n try {\n saved = localStorage.getItem('theme');\n } catch {\n // Storage is blocked, so fall back to the OS preference.\n }\n const dark =\n saved === 'light' || saved === 'dark'\n ? saved === 'dark'\n : window.matchMedia('(prefers-color-scheme: dark)').matches;\n document.documentElement.setAttribute(\n 'data-theme',\n dark ? 'dark' : 'light'\n );\n })();\n</script>\n```\n\nSecond, the app starts `colorMode` from the attribute the script wrote, and saves each choice\nunder the key the script reads. The `bestax-theming` skill's\n[dark-mode example](https://github.com/allxsmith/bestax/blob/main/skills/bestax-theming/examples/dark-mode.tsx)\nis the same recipe, and also covers a page that has no script.\n\n```tsx\n// Pairs with an inline <head> script in index.html that writes data-theme\n// before the first paint: the choice saved under STORAGE_KEY, or else the\n// OS preference. The Theme API page's Dark Mode section has the script.\nimport { useState } from 'react';\nimport { Theme, ToggleButton } from '@allxsmith/bestax-bulma';\n\ntype ColorMode = 'light' | 'dark';\n\n// The key the index.html script reads the saved choice from.\nconst STORAGE_KEY = 'theme';\n\n// The scheme the index.html script wrote on <html>.\nfunction initialColorMode(): ColorMode {\n if (typeof document === 'undefined') return 'light';\n return document.documentElement.getAttribute('data-theme') === 'dark'\n ? 'dark'\n : 'light';\n}\n\nfunction App() {\n const [mode, setMode] = useState<ColorMode>(initialColorMode);\n\n const setDark = (dark: boolean) => {\n const next: ColorMode = dark ? 'dark' : 'light';\n setMode(next);\n try {\n localStorage.setItem(STORAGE_KEY, next);\n } catch {\n // Storage is blocked, so the choice lasts until the page reloads.\n }\n };\n\n return (\n <Theme isRoot colorMode={mode}>\n <ToggleButton pressed={mode === 'dark'} onPressedChange={setDark}>\n Dark mode\n </ToggleButton>\n </Theme>\n );\n}\n```\n\n### Label and Text Lightnesses\n\nA color's trio recolors the color, but two of its lightnesses stay where the stylesheet's Sass\nbuild put them for the color it was built with: its label on a solid surface,\n`--bulma-<color>-invert-l`, and its text on the page, `--bulma-<color>-on-scheme-l`. bestax builds\nits primary from a dark blue, so a light primary set through the trio alone keeps white labels\nit can't carry. A color that reads lighter or darker than the built one sets both through\n`bulmaVars`.\n\nThe text has to read on a light page and on a dark one, so Bulma gives each scheme its own\non-scheme lightness. On a root theme, an on-scheme key takes `{ light, dark }`, and each value\napplies wherever Bulma's own value for that scheme would. A scheme you leave out keeps the\nstylesheet's value, and a string sets one value for both.\n\n```tsx\nfunction StockTurquoise() {\n // Stock Bulma's turquoise, with the values from bulma/css/bulma.css.\n return (\n <Theme\n isRoot\n primaryH=\"171deg\"\n primaryS=\"100%\"\n primaryL=\"41%\"\n bulmaVars={{\n '--bulma-primary-invert-l': 'var(--bulma-primary-05-l)',\n '--bulma-primary-on-scheme-l': { light: '21%', dark: '41%' },\n }}\n >\n <Button color=\"primary\">Dark label</Button>\n <Block textColor=\"primary\" colorShade=\"on-scheme\">\n Turquoise text that reads in both schemes\n </Block>\n </Theme>\n );\n}\n```\n\nA local theme writes its variables as an inline style, which can't hold a value per scheme, so it\nskips `{ light, dark }` and warns in development. Give it a string, or set the per-scheme values\nin your CSS. `bestax-no-dark-mode.css` has no dark scheme, so with it give a string. The\n`bestax-theming` skill's\n[CSS variables reference](https://github.com/allxsmith/bestax/blob/main/skills/bestax-theming/references/css-variables.md)\nsays what reads each lightness and how to pick the values.\n\n### Local Theme (Component Level)\n\n```tsx\nfunction LocalTheme() {\n return (\n <div>\n <Button color=\"primary\">Standard Primary</Button>\n\n <Theme\n primaryH=\"158\"\n primaryS=\"64%\"\n primaryL=\"30%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n >\n <Button color=\"primary\">Emerald Primary</Button>\n </Theme>\n\n <Button color=\"primary\">Standard Primary Again</Button>\n </div>\n );\n}\n```\n\n### Using CSS Variables Object\n\n```tsx\nfunction SunsetTheme() {\n // Amber, coral, rose and violet on warm neutrals. A new color keeps the\n // label lightness the stylesheet was built with, so each sets its own.\n const sunsetTheme = {\n '--bulma-scheme-h': '24',\n '--bulma-scheme-s': '22%',\n '--bulma-primary-h': '12',\n '--bulma-primary-s': '76%',\n '--bulma-primary-l': '44%',\n '--bulma-primary-invert-l': '100%',\n '--bulma-link-h': '340',\n '--bulma-link-s': '62%',\n '--bulma-link-l': '48%',\n '--bulma-link-invert-l': '100%',\n '--bulma-info-h': '262',\n '--bulma-info-s': '52%',\n '--bulma-info-l': '56%',\n '--bulma-info-invert-l': '100%',\n '--bulma-warning-h': '38',\n '--bulma-warning-s': '95%',\n '--bulma-warning-l': '54%',\n '--bulma-warning-invert-l': '10%',\n };\n\n return (\n <Theme bulmaVars={sunsetTheme} isRoot>\n <Box p=\"4\">\n <Title>Sunset Theme</Title>\n <Button color=\"primary\">Sunset Button</Button>\n <Button color=\"info\">Info Button</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Advanced CSS Variables Usage\n\nBulma derives the body font and the control radius from these variables at `:root`, so set\ntypography and radius on an `isRoot` theme.\n\n```tsx\nfunction TypographyTheme() {\n const typographyTheme = {\n '--bulma-family-primary': '\"Helvetica Neue\", sans-serif',\n '--bulma-family-code': '\"Fira Code\", monospace',\n '--bulma-size-normal': '16px',\n '--bulma-weight-bold': '700',\n };\n\n return (\n <Theme isRoot bulmaVars={typographyTheme}>\n <Title>Custom Typography</Title>\n <SubTitle>With custom fonts and weights</SubTitle>\n </Theme>\n );\n}\n```\n\n```tsx\nfunction RadiusTheme() {\n // `radius` is the border radius helper, as on every component, so the radius scale goes through bulmaVars\n const radii = {\n '--bulma-radius-small': '6px',\n '--bulma-radius': '12px',\n '--bulma-radius-medium': '16px',\n '--bulma-radius-large': '20px',\n };\n\n return (\n <Theme isRoot bulmaVars={radii}>\n <Button color=\"primary\">Rounder Button</Button>\n </Theme>\n );\n}\n```\n\nSpacing that Bulma reads where it is used, such as the block and column gaps, works on a scoped\ntheme:\n\n```tsx\nfunction SpacingTheme() {\n const spacingTheme = {\n '--bulma-block-spacing': '2rem',\n '--bulma-column-gap': '1rem',\n };\n\n return (\n <Theme bulmaVars={spacingTheme}>\n <Columns>\n <Column>\n <Box>Wider column gap</Box>\n <Box>Wider block spacing</Box>\n </Column>\n <Column>\n <Box>Wider column gap</Box>\n </Column>\n </Columns>\n </Theme>\n );\n}\n```\n\n### Complete Color Scheme\n\n```tsx\nfunction ForestTheme() {\n // Pine, lake, fern, ochre and berry on cool green neutrals\n const forestScheme = {\n schemeH: '140',\n schemeS: '16%',\n primaryH: '152',\n primaryS: '50%',\n primaryL: '32%',\n linkH: '195',\n linkS: '65%',\n linkL: '34%',\n successH: '95',\n successS: '40%',\n successL: '33%',\n warningH: '36',\n warningS: '85%',\n warningL: '52%',\n dangerH: '352',\n dangerS: '60%',\n dangerL: '48%',\n };\n // The label lightnesses have no named prop, so they go through bulmaVars\n const forestLabels = {\n '--bulma-primary-invert-l': '100%',\n '--bulma-link-invert-l': '100%',\n '--bulma-success-invert-l': '100%',\n '--bulma-warning-invert-l': '10%',\n '--bulma-danger-invert-l': '100%',\n };\n\n return (\n <Theme {...forestScheme} bulmaVars={forestLabels} isRoot>\n <Box p=\"4\">\n <Title>Forest Theme</Title>\n <Button color=\"primary\">Forest Primary</Button>\n <Button color=\"link\">Link</Button>\n <Button color=\"success\">Success</Button>\n <Button color=\"warning\">Warning</Button>\n <Button color=\"danger\">Danger</Button>\n </Box>\n </Theme>\n );\n}\n```\n\n### Theme with Styling\n\n```tsx\nfunction StyledTheme() {\n return (\n <Theme\n className=\"has-background-primary-soft has-text-primary-bold\"\n primaryH=\"40\"\n primaryS=\"92%\"\n primaryL=\"52%\"\n bulmaVars={{ '--bulma-primary-invert-l': '10%' }}\n p=\"5\"\n m=\"3\"\n radius=\"large\"\n textAlign=\"centered\"\n >\n <Title>Amber Panel</Title>\n <Button color=\"primary\">Amber Primary</Button>\n </Theme>\n );\n}\n```\n\n### Nested Themes\n\n```tsx\nfunction NestedThemes() {\n return (\n <Theme\n primaryH=\"218\"\n primaryS=\"52%\"\n primaryL=\"48%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n p=\"4\"\n >\n <Title>Outer Theme (Ink Blue)</Title>\n <Button color=\"primary\">Ink Blue Primary</Button>\n\n {/* Sets only the trio: the white label comes from the outer Theme */}\n <Theme primaryH=\"160\" primaryS=\"45%\" primaryL=\"32%\" p=\"3\" mt=\"4\">\n <Title size=\"4\">Inner Theme (Green)</Title>\n <Button color=\"primary\">Green Primary</Button>\n </Theme>\n\n <Button color=\"primary\" mt=\"3\">\n Ink Blue Primary Again\n </Button>\n </Theme>\n );\n}\n```\n\n### Theme with ConfigProvider\n\n```tsx\nfunction PrefixedTheme() {\n return (\n <ConfigProvider classPrefix=\"bestax-\">\n <Theme\n primaryH=\"236\"\n primaryS=\"55%\"\n primaryL=\"58%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }}\n isRoot\n >\n <Button color=\"primary\">Prefixed & Themed Button</Button>\n </Theme>\n </ConfigProvider>\n );\n}\n```\n\n---\n\n## Best Practices\n\n### Global vs Local Themes\n\n- Use `isRoot={true}` for application-wide themes that should affect all components\n- Use local themes (default `isRoot={false}`) for component-specific styling or theme variations\n- Local themes inherit from parent themes and can override specific variables\n- Several `isRoot` themes can be mounted at once, such as a color theme at the app root and a\n typography theme next to it. Each adds its own variables at `:root`; where two set the same\n variable, the inner or later-mounted one wins, as with nested local themes, and unmounting one\n removes only its own variables\n\n### CSS Variable Naming\n\n- All Bulma CSS variables follow the `--bulma-*` naming convention\n- Named props exist for the scheme and color variables only (like `primaryH`); every other variable, typography and radius included, goes through `bulmaVars`\n- `bulmaVars` keys are the full variable names (`'--bulma-family-primary'`), not camelCase\n- `bulmaVars` also accepts the scheme surface variables — `--bulma-scheme-main`, `--bulma-scheme-main-bis`, `--bulma-scheme-main-ter`, `--bulma-scheme-invert`, `--bulma-scheme-invert-bis`, `--bulma-scheme-invert-ter` — so overriding `--bulma-scheme-main-bis`/`-ter` re-tints every scheme-background band (e.g., `<Section bgColor=\"scheme-main-bis\">`) at once\n- `bulmaVars` also accepts each color's label and text lightnesses, `--bulma-<color>-invert-l` and `--bulma-<color>-on-scheme-l`, which a new trio does not move. On a root theme the on-scheme ones take a value per scheme (see [Label and Text Lightnesses](https://bestax.io/docs/api/helpers/theme#label-and-text-lightnesses))\n- `bulmaVars` also accepts `--bulma-shadow` (plus `--bulma-shadow-h`/`-s`/`-l`) — the upstream token that `.box`, `.card`, `.dropdown`, and `.panel` derive their own shadow variables from. Those selectors re-declare their derived variable (e.g. `--bulma-box-shadow`) on themselves, so setting it from an ancestor `Theme` is only inherited and never wins; overriding `--bulma-shadow` itself is the one override that cascades. There is no individual `shadow` prop for this — `shadow` already names the unrelated `shadowless` helper class — so reach it through `bulmaVars`\n\n### Performance Considerations\n\n- Prefer setting themes at higher levels in your component tree rather than deeply nested\n- CSS variables are inherited, so child themes only need to override specific variables\n\n### Color System\n\n- Bulma uses HSL (Hue, Saturation, Lightness) for its color system\n- Hue values range from 0-360 (color wheel degrees)\n- Saturation and Lightness are typically percentages (e.g., '50%')\n- The scheme variables control the base color relationships\n\n---\n\n## API Reference\n\n### Named Props and `bulmaVars`\n\n`ThemeProps` has a named, camelCase prop for each scheme and color variable, listed under\n[CSS Variable Props](https://bestax.io/docs/api/helpers/theme#css-variable-props). Each converts to its CSS variable by the same rule:\n\n```\npropName → --bulma-prop-name\n```\n\n- `primaryH` → `--bulma-primary-h`\n- `schemeS` → `--bulma-scheme-s`\n- `lightL` → `--bulma-light-l`\n- `hoverBackgroundLDelta` → `--bulma-hover-background-l-delta`\n\nEvery other variable (typography, radius, spacing, and the rest) has no named prop in\n`ThemeProps` and goes through `bulmaVars`, keyed by its full `--bulma-*` name. JavaScript code\nthat passes one as a camelCase prop (`familyPrimary`) may still render, but it is outside the\ntyped API, so move it to `bulmaVars`:\n\n```tsx\n<Theme\n isRoot\n primaryH=\"350\"\n primaryS=\"73%\"\n primaryL=\"44%\"\n bulmaVars={{\n '--bulma-primary-invert-l': '100%',\n '--bulma-radius': '2px',\n '--bulma-radius-small': '1px',\n '--bulma-family-primary': '\"IBM Plex Sans\", system-ui, sans-serif',\n '--bulma-family-code': '\"IBM Plex Mono\", ui-monospace, monospace',\n }}\n>\n <App />\n</Theme>\n```\n\nSome of those names are already helper props, so they cannot double as CSS-variable props:\n\n- `radius` is the border radius helper, as on every other component, so `<Theme radius=\"radiusless\">`\n adds `is-radiusless` to the wrapper. On a Theme it also sets `--bulma-radius` to `0`, so what\n is inside the Theme loses its radius too; under `isRoot` it writes that at `:root`, squaring\n everything on the page that takes its radius from it. The sizes (`small`, `normal`, `large`,\n `rounded`) add their `has-radius-*` class to the wrapper and set no variable, so they round\n the wrapper and leave what is inside alone; under `isRoot` there is no wrapper, so they do\n nothing and warn in development. Set any other `--bulma-radius` through\n `bulmaVars`. `<Theme radius=\"2px\" />` is a type error; in JavaScript it still sets\n `--bulma-radius`, which is how the prop used to behave, but that route is deprecated and logs\n a warning in development.\n- `shadow` is the `shadowless` helper. Set `--bulma-shadow` through `bulmaVars`.\n- `columnGap` is the column gap helper, as on every other component, so `<Theme columnGap=\"2\">`\n adds `is-column-gap-2` to the wrapper and sets no variable; under `isRoot` there is no wrapper,\n so it does nothing and warns in development. Set the columns gutter, `--bulma-column-gap`,\n through `bulmaVars`. Before the gap helpers, JavaScript could pass `columnGap` to set that\n variable. A string that is not a gap step (`columnGap=\"1rem\"`) still does, through a\n deprecated route that logs a warning in development, but a gap step does not:\n `columnGap=\"0\"`, which used to zero the gutters inside the Theme, now adds `is-column-gap-0`\n to the wrapper.\n\n### Props vs bulmaVars\n\nYou can set the scheme and color variables in two ways:\n\n1. **Named Props** (recommended where one exists):\n\n ```tsx\n <Theme\n primaryH=\"262\"\n primaryS=\"52%\"\n primaryL=\"56%\"\n bulmaVars={{ '--bulma-primary-invert-l': '100%' }} // the label has no named prop\n >\n <App />\n </Theme>\n ```\n\n2. **bulmaVars Object** (for every other variable, or when you have many to set):\n\n ```tsx\n <Theme\n bulmaVars={{\n '--bulma-primary-h': '262',\n '--bulma-primary-s': '52%',\n '--bulma-primary-l': '56%',\n '--bulma-primary-invert-l': '100%',\n '--bulma-block-spacing': '2rem',\n }}\n >\n <App />\n </Theme>\n ```\n\n3. **Combined** (props take precedence over bulmaVars):\n ```tsx\n <Theme\n primaryH=\"262\" // This takes precedence\n bulmaVars={{\n '--bulma-primary-h': '180', // This is overridden\n '--bulma-primary-invert-l': '100%',\n '--bulma-block-spacing': '2rem',\n }}\n >\n <App />\n </Theme>\n ```\n\n### TypeScript Support\n\n`bulmaVars` is typed as a partial record keyed by the union of every variable `Theme` accepts.\nWrite it as an object literal and your editor autocompletes the keys and flags a misspelled or\nunsupported one as a type error. A separately declared object only has to share one valid key\nto typecheck, so a typo in it is silently dropped; annotate it with\n`satisfies ThemeProps['bulmaVars']` to keep the check:\n\n```tsx\n<Theme\n primaryH=\"262\"\n bulmaVars={{\n '--bulma-primary-invert-l': '100%',\n '--bulma-block-spacing': '2rem', // start typing '--bulma-' to list the rest\n }}\n>\n <App />\n</Theme>\n```\n\n---\n\n## See Also\n\n- [ConfigProvider](https://bestax.io/docs/api/helpers/config) - For class prefixing and configuration\n- [useBulmaClasses](https://bestax.io/docs/api/helpers/usebulmaclasses) - For applying Bulma helper classes\n- [Bulma CSS Variables Documentation](https://bulma.io/documentation/features/css-variables/) - Official Bulma CSS variables reference\n\n---\n\n## Props\n\n| Prop | Type | Description |\n| ----------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `children` | `ReactNode` | The child components to apply the theme to. |\n| `className` | `string` | Additional CSS classes for the theme wrapper. A root theme has no wrapper, so under `isRoot` it does nothing and warns in development. |\n| `isRoot` | `boolean` | When `true`, applies CSS variables globally at `:root` level. When `false` (default), applies variables only to the wrapper div. Several root themes compose; an inner or later-mounted one wins a variable they share. The variables are written before the browser paints the theme's content, and a server render doesn't include them. A root theme renders no wrapper, so `className` and the helper props, such as `m` or `shadow`, do nothing on it and warn in development. |\n| `colorMode` | `'light' \\| 'dark' \\| 'system'` | Sets Bulma's light/dark scheme by writing the `data-theme` attribute on `<html>`, plus `data-<prefix>theme` inside a `ConfigProvider` with a `classPrefix`. If the prefix cannot form an attribute name, `'light'` and `'dark'` write only `data-theme` and warn in development. Always global (even on a scoped `Theme`). `'system'` removes them so Bulma follows the OS `prefers-color-scheme`. Omit to leave the current setting untouched. |\n| `bulmaVars` | `ThemeProps['bulmaVars']` | Object mapping Bulma CSS variable names to string values (e.g., `{'--bulma-primary-h': '210'}`). Keys are limited to the `BulmaVars` type; anything else is not applied. Each color's `--bulma-<color>-on-scheme-l` also takes `{ light, dark }` on a root theme, as [Label and Text Lightnesses](https://bestax.io/docs/api/helpers/theme#label-and-text-lightnesses) says. A variable Bulma declares on the component itself changes nothing from here and warns in development; see [Which Variables a Theme Can Change](https://bestax.io/docs/api/helpers/theme#which-variables-a-theme-can-change). |\n| `columnGap` | [`BulmaGapStep`](https://bestax.io/docs/api/helpers/valid-values) | The column gap helper: a gap step adds `is-column-gap-<step>` to the wrapper div and sets no variable, so under `isRoot` it does nothing and warns in development. Set `--bulma-column-gap` through `bulmaVars`. Any other string still sets `--bulma-column-gap`, a deprecated route that warns in development. |\n| `radius` | `'radiusless' \\| 'small' \\| 'normal' \\| 'large' \\| 'rounded'` | The border radius helper. `radiusless` adds `is-radiusless` to the wrapper div and sets `--bulma-radius` to `0`, at `:root` under `isRoot`. The sizes add their `has-radius-*` class to the wrapper and set no variable, so under `isRoot` they do nothing and warn in development. Any other string still sets `--bulma-radius`, a deprecated route that warns in development. |\n\n### CSS Variable Props\n\nThe Theme component accepts individual CSS variable props that correspond to Bulma's design tokens. These props are automatically converted to their corresponding CSS custom properties (e.g., `primaryH` → `--bulma-primary-h`).\n\n#### Scheme Variables\n\n| Prop | Type | Description | CSS Variable |\n| ------------------------ | -------- | ------------------------------------------------- | ----------------------------------- |\n| `schemeH` | `string` | Base hue for the color scheme (0-360) | `--bulma-scheme-h` |\n| `schemeS` | `string` | Base saturation for the color scheme (percentage) | `--bulma-scheme-s` |\n| `lightL` | `string` | Lightness value for light backgrounds | `--bulma-light-l` |\n| `lightInvertL` | `string` | Inverted lightness for light backgrounds | `--bulma-light-invert-l` |\n| `darkL` | `string` | Lightness value for dark backgrounds | `--bulma-dark-l` |\n| `darkInvertL` | `string` | Inverted lightness for dark backgrounds | `--bulma-dark-invert-l` |\n| `softL` | `string` | Lightness value for soft colors | `--bulma-soft-l` |\n| `boldL` | `string` | Lightness value for bold colors | `--bulma-bold-l` |\n| `softInvertL` | `string` | Inverted lightness for soft colors | `--bulma-soft-invert-l` |\n| `boldInvertL` | `string` | Inverted lightness for bold colors | `--bulma-bold-invert-l` |\n| `hoverBackgroundLDelta` | `string` | Lightness delta for hover background states | `--bulma-hover-background-l-delta` |\n| `activeBackgroundLDelta` | `string` | Lightness delta for active background states | `--bulma-active-background-l-delta` |\n| `hoverBorderLDelta` | `string` | Lightness delta for hover border states | `--bulma-hover-border-l-delta` |\n| `activeBorderLDelta` | `string` | Lightness delta for active border states | `--bulma-active-border-l-delta` |\n| `hoverColorLDelta` | `string` | Lightness delta for hover text color states | `--bulma-hover-color-l-delta` |\n| `activeColorLDelta` | `string` | Lightness delta for active text color states | `--bulma-active-color-l-delta` |\n| `hoverShadowADelta` | `string` | Alpha delta for hover shadow states | `--bulma-hover-shadow-a-delta` |\n| `activeShadowADelta` | `string` | Alpha delta for active shadow states | `--bulma-active-shadow-a-delta` |\n\n#### Color Variables\n\n| Prop | Type | Description | CSS Variable |\n| ---------- | -------- | ------------------------------------- | ------------------- |\n| `primaryH` | `string` | Primary color hue (0-360) | `--bulma-primary-h` |\n| `primaryS` | `string` | Primary color saturation (percentage) | `--bulma-primary-s` |\n| `primaryL` | `string` | Primary color lightness (percentage) | `--bulma-primary-l` |\n| `linkH` | `string` | Link color hue (0-360) | `--bulma-link-h` |\n| `linkS` | `string` | Link color saturation (percentage) | `--bulma-link-s` |\n| `linkL` | `string` | Link color lightness (percentage) | `--bulma-link-l` |\n| `infoH` | `string` | Info color hue (0-360) | `--bulma-info-h` |\n| `infoS` | `string` | Info color saturation (percentage) | `--bulma-info-s` |\n| `infoL` | `string` | Info color lightness (percentage) | `--bulma-info-l` |\n| `successH` | `string` | Success color hue (0-360) | `--bulma-success-h` |\n| `successS` | `string` | Success color saturation (percentage) | `--bulma-success-s` |\n| `successL` | `string` | Success color lightness (percentage) | `--bulma-success-l` |\n| `warningH` | `string` | Warning color hue (0-360) | `--bulma-warning-h` |\n| `warningS` | `string` | Warning color saturation (percentage) | `--bulma-warning-s` |\n| `warningL` | `string` | Warning color lightness (percentage) | `--bulma-warning-l` |\n| `dangerH` | `string` | Danger color hue (0-360) | `--bulma-danger-h` |\n| `dangerS` | `string` | Danger color saturation (percentage) | `--bulma-danger-s` |\n| `dangerL` | `string` | Danger color lightness (percentage) | `--bulma-danger-l` |\n\n#### Shadow Variables\n\nReachable only through `bulmaVars` — there is no individual prop, since `shadow` already names\nthe `BulmaOtherProps` `shadowless` helper class. As noted above, `--bulma-shadow` is the one\noverride that cascades into `.box`/`.card`/`.dropdown`/`.panel` shadows.\n\n| CSS Variable | Description |\n| ------------------ | ----------------------------------------------------------------------------------------------------- |\n| `--bulma-shadow-h` | Shadow color hue (0-360) |\n| `--bulma-shadow-s` | Shadow color saturation (percentage) |\n| `--bulma-shadow-l` | Shadow color lightness (percentage) |\n| `--bulma-shadow` | The full shadow value that `.box`/`.card`/`.dropdown`/`.panel` derive their own shadow variables from |\n\n#### Which Variables a Theme Can Change\n\n`bulmaVars` takes any key of the `BulmaVars` type. Write it as an object literal and your editor\nlists them as you type `'--bulma-'`. Not every one of those keys does something from a `Theme`,\nthough, and the reason is where Bulma declares the variable.\n\nA `Theme` writes its variables on its wrapper `div`, or at `:root` under `isRoot`. A component\ninherits them from there only if it declares no value of its own, because an element's own\ndeclaration always beats an inherited one.\n\n- **Global variables reach everything under the Theme.** Bulma declares the scheme, color and\n shadow variables above, and the typography, radius, spacing and timing tokens (such as\n `--bulma-family-primary` and `--bulma-radius`), on `:root`. Set them on a `Theme`, or on any\n ancestor. Some of them Bulma also declares again on one component, which keeps its own value\n while everything else takes the Theme's. That component's API page lists the variable as\n declared on it.\n- **Component variables have to be set on the component.** Where Bulma declares a variable on\n the component's own element, as it does `--bulma-card-radius`, `--bulma-tag-h` and\n `--bulma-delete-dimensions`, a value a `Theme` sets never reaches it. Those keys are still\n accepted, so existing code keeps compiling, but they change nothing, and `Theme` logs a\n warning in development naming them. Set them on the component instead, with\n `className` (a class in your own stylesheet) or the `style` prop, or at build time through\n [Sass](https://bestax.io/docs/guides/features/sass-customization).\n\nEach component's API page lists its variables under **CSS & Sass Variables** and says where Bulma\ndeclares them, so check there before reaching for a `Theme`. The\n[shadow note](https://bestax.io/docs/api/helpers/theme#css-variable-naming) above is the same rule in action: `--bulma-box-shadow` lives on\n`.box`, so the way to change box shadows from a `Theme` is the global `--bulma-shadow` they derive\nfrom.\n\nThe Theme component also supports all [Bulma helper class props](https://bestax.io/docs/api/helpers/usebulmaclasses) for styling the wrapper element."
|
|
475
475
|
}
|
|
@@ -726,6 +726,7 @@
|
|
|
726
726
|
}
|
|
727
727
|
],
|
|
728
728
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
729
|
+
"helperPropsNote": "Helper props go on the `.timeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
729
730
|
"types": []
|
|
730
731
|
},
|
|
731
732
|
{
|
|
@@ -1078,6 +1079,7 @@
|
|
|
1078
1079
|
],
|
|
1079
1080
|
"extraProps": [],
|
|
1080
1081
|
"catchAll": "All standard <input> attributes and Bulma helper props",
|
|
1082
|
+
"helperPropsNote": "Helper props go on the `.timeinput-container` `<div>`, with `className` and the other attributes, except that the background helpers go on the `<input>`, and the text helpers on both, since Bulma's `.input` sets its own background and font, and the popover inside the `<div>` takes the text ones. Inline they all go on the `<div>`, and on the native mobile input, on the `<input>`.",
|
|
1081
1083
|
"types": [],
|
|
1082
1084
|
"standalone": "base"
|
|
1083
1085
|
}
|
|
@@ -85,8 +85,9 @@ password. It takes everything `Input` does except `type` and the right-icon prop
|
|
|
85
85
|
(`iconRight`, `iconRightName`, `iconRightSize`, `hasIconsRight`), which draw nothing and warn in
|
|
86
86
|
development, since the button has that edge. `PasswordInputBase` is the input and its button
|
|
87
87
|
without the `Field` and `Control`. On both, helper props, `className` and `style` go on the
|
|
88
|
-
`.password-input-container` `<div>` that holds the input and its button;
|
|
89
|
-
attributes go on
|
|
88
|
+
`.password-input-container` `<div>` that holds the input and its button; the background and text
|
|
89
|
+
helpers (`backgroundColor`, `textWeight`, `fontFamily`, …), `ref` and the other attributes go on
|
|
90
|
+
the `<input>`.
|
|
90
91
|
|
|
91
92
|
| Prop | Type | Notes |
|
|
92
93
|
| ----------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -186,6 +187,11 @@ variants. Field/Control composition like the other convenience inputs, with pick
|
|
|
186
187
|
with custom fallback). An `inline` picker renders no `Control` anywhere, so leave its
|
|
187
188
|
Control-level props out: they do nothing there and warn in development.
|
|
188
189
|
|
|
190
|
+
Their helper props go on the picker's container, so a margin or a width moves the field and its
|
|
191
|
+
launcher together. The background helpers style the field itself, and the text helpers style the
|
|
192
|
+
field and the popover, so `backgroundColor`, `textWeight` or `fontFamily` work on a picker as they
|
|
193
|
+
do on `Input`.
|
|
194
|
+
|
|
189
195
|
Every one of them has a launcher button at the inline end (`triggerIcon`), the right edge on a
|
|
190
196
|
left-to-right page and the left edge on a right-to-left one. The calendar or clock icon sits at
|
|
191
197
|
the inline start. A picker with its own `locale` or `dir` gives the `Control` it renders the same
|
|
@@ -291,7 +297,8 @@ for none, so `required` works), a swatch, and a launcher that opens the same squ
|
|
|
291
297
|
`alpha`, `swatches` and `eyeDropper` in the pickers' popover. It opens on the launcher, the
|
|
292
298
|
swatch or Alt+ArrowDown; `openOnFocus` and `closeOnSwatchClick` are opt-in. It takes the same
|
|
293
299
|
`value`/`onChange`/`onChangeEnd`/`format`, the Field props, `isLoading`, and `Input`'s
|
|
294
|
-
`color`/`size`/`isRounded`. `ColorInputBase` is the field without Field and Control.
|
|
300
|
+
`color`/`size`/`isRounded`. `ColorInputBase` is the field without Field and Control. Their
|
|
301
|
+
helper props place as the date pickers' do.
|
|
295
302
|
|
|
296
303
|
## Validation-related props (no library)
|
|
297
304
|
|
|
@@ -84,9 +84,10 @@ Centered; a collection of items → Card grid. For mixed requests, pick the domi
|
|
|
84
84
|
items are `ContextMenu.Item`/`ContextMenu.Divider`, which are `Dropdown`'s; no `open` prop,
|
|
85
85
|
`onOpenChange` reports it; always put the same items in a visible `Dropdown` on the row too,
|
|
86
86
|
since a context menu is only a shortcut),
|
|
87
|
-
`Steps value={i}/onStepClick items={[{label, icon?}]}`
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
`Steps value={i}/onStepClick items={[{label, icon?}]}` for a journey the user moves through,
|
|
88
|
+
such as a wizard or a checkout (child form is `Steps.Step`, not `Steps.Item`; a record of
|
|
89
|
+
what happened is `Timeline`). `Reveal cascade` staggers only its **direct children** — to
|
|
90
|
+
stagger a grid, put `<Reveal delay={i * 80}>` inside each `Cell`, not around the container.
|
|
90
91
|
- **An empty list, table or search with no results is `EmptyState`**, not a hand-built `Box`
|
|
91
92
|
of `Icon`, `Title` and `Buttons isCentered`:
|
|
92
93
|
`<EmptyState icon="folder-open" title="No projects yet" titleAs="h3" description="…">` with
|
|
@@ -157,8 +157,9 @@ Notes:
|
|
|
157
157
|
|
|
158
158
|
- The `field` partial **extends** stock Bulma's field (`bulma/sass/form/tools`): it puts the
|
|
159
159
|
`message` of a horizontal form component (`Input horizontal`, `Checkboxes horizontal`,
|
|
160
|
-
`Rate horizontal` and the rest) under its control, where Bulma's row would set it beside
|
|
161
|
-
|
|
160
|
+
`Rate horizontal` and the rest) under its control, where Bulma's row would set it beside, and
|
|
161
|
+
keeps a horizontal label's text against its control on a right-to-left page. An app with one
|
|
162
|
+
needs it next to `bulma/sass/form/tools`, in either order:
|
|
162
163
|
|
|
163
164
|
```scss
|
|
164
165
|
@use 'bulma/sass/form/tools';
|
|
@@ -350,6 +350,9 @@ header taller than Bulma's navbar sets it there. `AppFrame.Nav width` writes
|
|
|
350
350
|
`--bulma-autocomplete-scrollbar-thumb-hover`, `--bulma-autocomplete-scrollbar-track`,
|
|
351
351
|
`--bulma-autocomplete-scrollbar-width`
|
|
352
352
|
|
|
353
|
+
`--bulma-autocomplete-border-hover-color` is registered but has no effect: the input's hover
|
|
354
|
+
border is Bulma's own.
|
|
355
|
+
|
|
353
356
|
### Carousel
|
|
354
357
|
|
|
355
358
|
`--bulma-carousel-arrow-background`, `--bulma-carousel-arrow-background-hover`,
|
|
@@ -416,6 +419,9 @@ Bulma's default font sizes the box is 24px at the default and `small` sizes. For
|
|
|
416
419
|
`min-width: 0; min-height: 0` on `.styled-checkbox.my-box .check` (mind the class prefix), and keep
|
|
417
420
|
the label text inside the `Checkbox`, since the whole label is the click target.
|
|
418
421
|
|
|
422
|
+
`--bulma-checkbox-focus-shadow-size` is registered but has no effect: the keyboard focus ring is a
|
|
423
|
+
`2px` outline in `--bulma-checkbox-active-color`, with no shadow for a size to apply to.
|
|
424
|
+
|
|
419
425
|
### CheckboxCard
|
|
420
426
|
|
|
421
427
|
`--bulma-checkbox-card-active-color`, `--bulma-checkbox-card-border-color`,
|
|
@@ -836,6 +842,9 @@ Bulma's default font sizes the circle is 24px at the default and `small` sizes.
|
|
|
836
842
|
`min-width: 0; min-height: 0` on `.styled-radio.my-radio .check` (mind the class prefix), and keep
|
|
837
843
|
the label text inside the `Radio`, since the whole label is the click target.
|
|
838
844
|
|
|
845
|
+
`--bulma-radio-focus-shadow-size` is registered but has no effect: the keyboard focus ring is a
|
|
846
|
+
`2px` outline in `--bulma-radio-active-color`, with no shadow for a size to apply to.
|
|
847
|
+
|
|
839
848
|
### RadioCard
|
|
840
849
|
|
|
841
850
|
`--bulma-radio-card-active-color`, `--bulma-radio-card-border-color`,
|
package/data/skills.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"promptName": "form",
|
|
30
30
|
"dir": "bestax-form",
|
|
31
31
|
"references": [
|
|
32
|
-
{ "id": "api", "file": "references/api.md", "bytes":
|
|
32
|
+
{ "id": "api", "file": "references/api.md", "bytes": 33774 },
|
|
33
33
|
{ "id": "patterns", "file": "references/patterns.md", "bytes": 10001 }
|
|
34
34
|
],
|
|
35
35
|
"examples": []
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
{
|
|
163
163
|
"id": "modular-build",
|
|
164
164
|
"file": "references/modular-build.md",
|
|
165
|
-
"bytes":
|
|
165
|
+
"bytes": 19954
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
168
|
"examples": []
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
{
|
|
177
177
|
"id": "css-variables",
|
|
178
178
|
"file": "references/css-variables.md",
|
|
179
|
-
"bytes":
|
|
179
|
+
"bytes": 73019
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
"id": "themeable-components",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestax-mcp",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.46",
|
|
4
4
|
"mcpName": "io.github.allxsmith/bestax-mcp",
|
|
5
5
|
"description": "MCP server for @allxsmith/bestax-bulma — component props, examples, CSS variables and agent skills, served offline from a version-pinned index",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
44
44
|
"zod": "^4.6.7",
|
|
45
|
-
"@allxsmith/bestax-bulma": "^5.67.
|
|
45
|
+
"@allxsmith/bestax-bulma": "^5.67.9"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^26.6.6",
|