@allxsmith/bestax-bulma 5.26.6 → 5.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/columns/Column.js +48 -0
- package/dist/esm/columns/Column.js.map +1 -0
- package/dist/esm/columns/Columns.js +53 -0
- package/dist/esm/columns/Columns.js.map +1 -0
- package/dist/esm/components/Avatar.js +299 -0
- package/dist/esm/components/Avatar.js.map +1 -0
- package/dist/esm/components/Avatars.js +81 -0
- package/dist/esm/components/Avatars.js.map +1 -0
- package/dist/esm/components/Badge.js +105 -0
- package/dist/esm/components/Badge.js.map +1 -0
- package/dist/esm/components/Breadcrumb.js +36 -0
- package/dist/esm/components/Breadcrumb.js.map +1 -0
- package/dist/esm/components/Card.js +252 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/Carousel.js +351 -0
- package/dist/esm/components/Carousel.js.map +1 -0
- package/dist/esm/components/Collapse.js +193 -0
- package/dist/esm/components/Collapse.js.map +1 -0
- package/dist/esm/components/Collapses.js +99 -0
- package/dist/esm/components/Collapses.js.map +1 -0
- package/dist/esm/components/Dialog.js +230 -0
- package/dist/esm/components/Dialog.js.map +1 -0
- package/dist/esm/components/Dropdown.js +362 -0
- package/dist/esm/components/Dropdown.js.map +1 -0
- package/dist/esm/components/Loading.js +87 -0
- package/dist/esm/components/Loading.js.map +1 -0
- package/dist/esm/components/Menu.js +117 -0
- package/dist/esm/components/Menu.js.map +1 -0
- package/dist/esm/components/Message.js +56 -0
- package/dist/esm/components/Message.js.map +1 -0
- package/dist/esm/components/Modal.js +354 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/Navbar.js +287 -0
- package/dist/esm/components/Navbar.js.map +1 -0
- package/dist/esm/components/Pagination.js +191 -0
- package/dist/esm/components/Pagination.js.map +1 -0
- package/dist/esm/components/Panel.js +100 -0
- package/dist/esm/components/Panel.js.map +1 -0
- package/dist/esm/components/Popover.js +298 -0
- package/dist/esm/components/Popover.js.map +1 -0
- package/dist/esm/components/Reveal.js +157 -0
- package/dist/esm/components/Reveal.js.map +1 -0
- package/dist/esm/components/Sidebar.js +209 -0
- package/dist/esm/components/Sidebar.js.map +1 -0
- package/dist/esm/components/Steps.js +128 -0
- package/dist/esm/components/Steps.js.map +1 -0
- package/dist/esm/components/Tabs.js +335 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Toast.js +322 -0
- package/dist/esm/components/Toast.js.map +1 -0
- package/dist/esm/components/Tooltip.js +202 -0
- package/dist/esm/components/Tooltip.js.map +1 -0
- package/dist/esm/components/collapsesContext.js +12 -0
- package/dist/esm/components/collapsesContext.js.map +1 -0
- package/dist/esm/elements/Block.js +29 -0
- package/dist/esm/elements/Block.js.map +1 -0
- package/dist/esm/elements/Box.js +32 -0
- package/dist/esm/elements/Box.js.map +1 -0
- package/dist/esm/elements/Button.js +139 -0
- package/dist/esm/elements/Button.js.map +1 -0
- package/dist/esm/elements/Buttons.js +42 -0
- package/dist/esm/elements/Buttons.js.map +1 -0
- package/dist/esm/elements/Code.js +25 -0
- package/dist/esm/elements/Code.js.map +1 -0
- package/dist/esm/elements/Content.js +33 -0
- package/dist/esm/elements/Content.js.map +1 -0
- package/dist/esm/elements/Delete.js +35 -0
- package/dist/esm/elements/Delete.js.map +1 -0
- package/dist/esm/elements/Divider.js +27 -0
- package/dist/esm/elements/Divider.js.map +1 -0
- package/dist/esm/elements/Emphasis.js +25 -0
- package/dist/esm/elements/Emphasis.js.map +1 -0
- package/dist/esm/elements/Figure.js +58 -0
- package/dist/esm/elements/Figure.js.map +1 -0
- package/dist/esm/elements/Icon.js +256 -0
- package/dist/esm/elements/Icon.js.map +1 -0
- package/dist/esm/elements/IconText.js +36 -0
- package/dist/esm/elements/IconText.js.map +1 -0
- package/dist/esm/elements/Image.js +46 -0
- package/dist/esm/elements/Image.js.map +1 -0
- package/dist/esm/elements/Link.js +36 -0
- package/dist/esm/elements/Link.js.map +1 -0
- package/dist/esm/elements/LinkButton.js +37 -0
- package/dist/esm/elements/LinkButton.js.map +1 -0
- package/dist/esm/elements/ListItem.js +28 -0
- package/dist/esm/elements/ListItem.js.map +1 -0
- package/dist/esm/elements/Loader.js +37 -0
- package/dist/esm/elements/Loader.js.map +1 -0
- package/dist/esm/elements/Notification.js +316 -0
- package/dist/esm/elements/Notification.js.map +1 -0
- package/dist/esm/elements/OrderedList.js +31 -0
- package/dist/esm/elements/OrderedList.js.map +1 -0
- package/dist/esm/elements/Paragraph.js +28 -0
- package/dist/esm/elements/Paragraph.js.map +1 -0
- package/dist/esm/elements/Pre.js +25 -0
- package/dist/esm/elements/Pre.js.map +1 -0
- package/dist/esm/elements/Progress.js +33 -0
- package/dist/esm/elements/Progress.js.map +1 -0
- package/dist/esm/elements/Skeleton.js +30 -0
- package/dist/esm/elements/Skeleton.js.map +1 -0
- package/dist/esm/elements/Span.js +28 -0
- package/dist/esm/elements/Span.js.map +1 -0
- package/dist/esm/elements/Strong.js +25 -0
- package/dist/esm/elements/Strong.js.map +1 -0
- package/dist/esm/elements/SubTitle.js +51 -0
- package/dist/esm/elements/SubTitle.js.map +1 -0
- package/dist/esm/elements/Table.js +51 -0
- package/dist/esm/elements/Table.js.map +1 -0
- package/dist/esm/elements/Tag.js +49 -0
- package/dist/esm/elements/Tag.js.map +1 -0
- package/dist/esm/elements/Tags.js +34 -0
- package/dist/esm/elements/Tags.js.map +1 -0
- package/dist/esm/elements/Tbody.js +26 -0
- package/dist/esm/elements/Tbody.js.map +1 -0
- package/dist/esm/elements/Td.js +61 -0
- package/dist/esm/elements/Td.js.map +1 -0
- package/dist/esm/elements/Tfoot.js +26 -0
- package/dist/esm/elements/Tfoot.js.map +1 -0
- package/dist/esm/elements/Th.js +34 -0
- package/dist/esm/elements/Th.js.map +1 -0
- package/dist/esm/elements/Thead.js +26 -0
- package/dist/esm/elements/Thead.js.map +1 -0
- package/dist/esm/elements/Title.js +44 -0
- package/dist/esm/elements/Title.js.map +1 -0
- package/dist/esm/elements/Tr.js +31 -0
- package/dist/esm/elements/Tr.js.map +1 -0
- package/dist/esm/elements/UnorderedList.js +31 -0
- package/dist/esm/elements/UnorderedList.js.map +1 -0
- package/dist/esm/elements/iconProps.js +49 -0
- package/dist/esm/elements/iconProps.js.map +1 -0
- package/dist/esm/form/Autocomplete.js +279 -0
- package/dist/esm/form/Autocomplete.js.map +1 -0
- package/dist/esm/form/Checkbox.js +111 -0
- package/dist/esm/form/Checkbox.js.map +1 -0
- package/dist/esm/form/Checkboxes.js +89 -0
- package/dist/esm/form/Checkboxes.js.map +1 -0
- package/dist/esm/form/Control.js +79 -0
- package/dist/esm/form/Control.js.map +1 -0
- package/dist/esm/form/DateInput.js +87 -0
- package/dist/esm/form/DateInput.js.map +1 -0
- package/dist/esm/form/DateInputBase.js +263 -0
- package/dist/esm/form/DateInputBase.js.map +1 -0
- package/dist/esm/form/DateRangeInput.js +76 -0
- package/dist/esm/form/DateRangeInput.js.map +1 -0
- package/dist/esm/form/DateRangeInputBase.js +301 -0
- package/dist/esm/form/DateRangeInputBase.js.map +1 -0
- package/dist/esm/form/DateTimeInput.js +87 -0
- package/dist/esm/form/DateTimeInput.js.map +1 -0
- package/dist/esm/form/DateTimeInputBase.js +333 -0
- package/dist/esm/form/DateTimeInputBase.js.map +1 -0
- package/dist/esm/form/Field.js +153 -0
- package/dist/esm/form/Field.js.map +1 -0
- package/dist/esm/form/File.js +109 -0
- package/dist/esm/form/File.js.map +1 -0
- package/dist/esm/form/FormContext.js +170 -0
- package/dist/esm/form/FormContext.js.map +1 -0
- package/dist/esm/form/Input.js +88 -0
- package/dist/esm/form/Input.js.map +1 -0
- package/dist/esm/form/InputBase.js +40 -0
- package/dist/esm/form/InputBase.js.map +1 -0
- package/dist/esm/form/Numberinput.js +199 -0
- package/dist/esm/form/Numberinput.js.map +1 -0
- package/dist/esm/form/Radio.js +108 -0
- package/dist/esm/form/Radio.js.map +1 -0
- package/dist/esm/form/Radios.js +91 -0
- package/dist/esm/form/Radios.js.map +1 -0
- package/dist/esm/form/Rate.js +279 -0
- package/dist/esm/form/Rate.js.map +1 -0
- package/dist/esm/form/Select.js +81 -0
- package/dist/esm/form/Select.js.map +1 -0
- package/dist/esm/form/SelectBase.js +54 -0
- package/dist/esm/form/SelectBase.js.map +1 -0
- package/dist/esm/form/Slider.js +459 -0
- package/dist/esm/form/Slider.js.map +1 -0
- package/dist/esm/form/Switch.js +96 -0
- package/dist/esm/form/Switch.js.map +1 -0
- package/dist/esm/form/Taginput.js +352 -0
- package/dist/esm/form/Taginput.js.map +1 -0
- package/dist/esm/form/TextArea.js +77 -0
- package/dist/esm/form/TextArea.js.map +1 -0
- package/dist/esm/form/TextAreaBase.js +45 -0
- package/dist/esm/form/TextAreaBase.js.map +1 -0
- package/dist/esm/form/TimeInput.js +83 -0
- package/dist/esm/form/TimeInput.js.map +1 -0
- package/dist/esm/form/TimeInputBase.js +246 -0
- package/dist/esm/form/TimeInputBase.js.map +1 -0
- package/dist/esm/form/_pickerInternals/Calendar.js +760 -0
- package/dist/esm/form/_pickerInternals/Calendar.js.map +1 -0
- package/dist/esm/form/_pickerInternals/PickerPopover.js +95 -0
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -0
- package/dist/esm/form/_pickerInternals/TimeWheels.js +721 -0
- package/dist/esm/form/_pickerInternals/TimeWheels.js.map +1 -0
- package/dist/esm/form/_pickerInternals/audioTick.js +109 -0
- package/dist/esm/form/_pickerInternals/audioTick.js.map +1 -0
- package/dist/esm/form/_pickerInternals/dateUtils.js +267 -0
- package/dist/esm/form/_pickerInternals/dateUtils.js.map +1 -0
- package/dist/esm/form/_pickerInternals/formatters.js +322 -0
- package/dist/esm/form/_pickerInternals/formatters.js.map +1 -0
- package/dist/esm/form/_pickerInternals/haptics.js +38 -0
- package/dist/esm/form/_pickerInternals/haptics.js.map +1 -0
- package/dist/esm/form/_pickerInternals/nativeInputSupport.js +25 -0
- package/dist/esm/form/_pickerInternals/nativeInputSupport.js.map +1 -0
- package/dist/esm/form/_pickerInternals/pickerTypes.js +50 -0
- package/dist/esm/form/_pickerInternals/pickerTypes.js.map +1 -0
- package/dist/esm/form/_pickerInternals/segmentMap.js +315 -0
- package/dist/esm/form/_pickerInternals/segmentMap.js.map +1 -0
- package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js +49 -0
- package/dist/esm/form/_pickerInternals/useNativeMobilePicker.js.map +1 -0
- package/dist/esm/form/_pickerInternals/useSegmentedEntry.js +427 -0
- package/dist/esm/form/_pickerInternals/useSegmentedEntry.js.map +1 -0
- package/dist/esm/form/controlLoading.js +18 -0
- package/dist/esm/form/controlLoading.js.map +1 -0
- package/dist/esm/form/useAutoLabelId.js +54 -0
- package/dist/esm/form/useAutoLabelId.js.map +1 -0
- package/dist/esm/grid/Cell.js +35 -0
- package/dist/esm/grid/Cell.js.map +1 -0
- package/dist/esm/grid/Grid.js +51 -0
- package/dist/esm/grid/Grid.js.map +1 -0
- package/dist/esm/helpers/ClientOnly.js +33 -0
- package/dist/esm/helpers/ClientOnly.js.map +1 -0
- package/dist/esm/helpers/Config.js +60 -0
- package/dist/esm/helpers/Config.js.map +1 -0
- package/dist/esm/helpers/Theme.js +947 -0
- package/dist/esm/helpers/Theme.js.map +1 -0
- package/dist/esm/helpers/anchorAttrs.js +72 -0
- package/dist/esm/helpers/anchorAttrs.js.map +1 -0
- package/dist/esm/helpers/bulmaClassHelpers.js +415 -0
- package/dist/esm/helpers/bulmaClassHelpers.js.map +1 -0
- package/dist/esm/helpers/buttonType.js +24 -0
- package/dist/esm/helpers/buttonType.js.map +1 -0
- package/dist/esm/helpers/classNames.js +137 -0
- package/dist/esm/helpers/classNames.js.map +1 -0
- package/dist/esm/helpers/colorDeprecations.js +50 -0
- package/dist/esm/helpers/colorDeprecations.js.map +1 -0
- package/dist/esm/helpers/devWarnings.js +27 -0
- package/dist/esm/helpers/devWarnings.js.map +1 -0
- package/dist/esm/helpers/inertProps.js +27 -0
- package/dist/esm/helpers/inertProps.js.map +1 -0
- package/dist/esm/helpers/mergeBulmaStyles.js +20 -0
- package/dist/esm/helpers/mergeBulmaStyles.js.map +1 -0
- package/dist/esm/helpers/polymorphic.js +18 -0
- package/dist/esm/helpers/polymorphic.js.map +1 -0
- package/dist/esm/helpers/portal.js +76 -0
- package/dist/esm/helpers/portal.js.map +1 -0
- package/dist/esm/helpers/positionStacks.js +45 -0
- package/dist/esm/helpers/positionStacks.js.map +1 -0
- package/dist/esm/helpers/scrollLock.js +38 -0
- package/dist/esm/helpers/scrollLock.js.map +1 -0
- package/dist/esm/helpers/shadowDom.js +71 -0
- package/dist/esm/helpers/shadowDom.js.map +1 -0
- package/dist/esm/helpers/statusRegion.js +282 -0
- package/dist/esm/helpers/statusRegion.js.map +1 -0
- package/dist/esm/helpers/useAnchoredPosition.js +86 -0
- package/dist/esm/helpers/useAnchoredPosition.js.map +1 -0
- package/dist/esm/helpers/useBulmaClasses.js +158 -0
- package/dist/esm/helpers/useBulmaClasses.js.map +1 -0
- package/dist/esm/helpers/useClientLayoutEffect.js +13 -0
- package/dist/esm/helpers/useClientLayoutEffect.js.map +1 -0
- package/dist/esm/helpers/useColorClasses.js +84 -0
- package/dist/esm/helpers/useColorClasses.js.map +1 -0
- package/dist/esm/helpers/useFlexboxClasses.js +92 -0
- package/dist/esm/helpers/useFlexboxClasses.js.map +1 -0
- package/dist/esm/helpers/useFocusTrap.js +470 -0
- package/dist/esm/helpers/useFocusTrap.js.map +1 -0
- package/dist/esm/helpers/useIsHydrated.js +31 -0
- package/dist/esm/helpers/useIsHydrated.js.map +1 -0
- package/dist/esm/helpers/useOtherClasses.js +115 -0
- package/dist/esm/helpers/useOtherClasses.js.map +1 -0
- package/dist/esm/helpers/useSpacingClasses.js +82 -0
- package/dist/esm/helpers/useSpacingClasses.js.map +1 -0
- package/dist/esm/helpers/useTypographyClasses.js +93 -0
- package/dist/esm/helpers/useTypographyClasses.js.map +1 -0
- package/dist/esm/helpers/useVisibilityClasses.js +134 -0
- package/dist/esm/helpers/useVisibilityClasses.js.map +1 -0
- package/dist/esm/helpers/withSubComponents.js +24 -0
- package/dist/esm/helpers/withSubComponents.js.map +1 -0
- package/dist/esm/layout/Container.js +48 -0
- package/dist/esm/layout/Container.js.map +1 -0
- package/dist/esm/layout/Footer.js +33 -0
- package/dist/esm/layout/Footer.js.map +1 -0
- package/dist/esm/layout/Hero.js +90 -0
- package/dist/esm/layout/Hero.js.map +1 -0
- package/dist/esm/layout/Level.js +110 -0
- package/dist/esm/layout/Level.js.map +1 -0
- package/dist/esm/layout/Media.js +86 -0
- package/dist/esm/layout/Media.js.map +1 -0
- package/dist/esm/layout/Section.js +30 -0
- package/dist/esm/layout/Section.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +821 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +115 -16845
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Tabs.d.ts +25 -3
- package/dist/types/elements/Icon.d.ts +10 -7
- package/dist/types/form/DateInputBase.d.ts +8 -6
- package/dist/types/form/DateRangeInput.d.ts +91 -0
- package/dist/types/form/DateRangeInputBase.d.ts +172 -0
- package/dist/types/form/DateTimeInputBase.d.ts +10 -6
- package/dist/types/form/File.d.ts +18 -5
- package/dist/types/form/FormContext.d.ts +11 -0
- package/dist/types/form/TimeInputBase.d.ts +1 -1
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +1 -0
- package/dist/types/form/_pickerInternals/dateUtils.d.ts +7 -0
- package/dist/types/form/_pickerInternals/formatters.d.ts +14 -0
- package/dist/types/form/_pickerInternals/pickerTypes.d.ts +13 -0
- package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
- package/dist/types/index.d.ts +4 -0
- package/dist/types-cjs/components/Tabs.d.ts +25 -3
- package/dist/types-cjs/elements/Icon.d.ts +10 -7
- package/dist/types-cjs/form/DateInputBase.d.ts +8 -6
- package/dist/types-cjs/form/DateRangeInput.d.ts +91 -0
- package/dist/types-cjs/form/DateRangeInputBase.d.ts +172 -0
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +10 -6
- package/dist/types-cjs/form/File.d.ts +18 -5
- package/dist/types-cjs/form/FormContext.d.ts +11 -0
- package/dist/types-cjs/form/TimeInputBase.d.ts +1 -1
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +1 -0
- package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +7 -0
- package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +14 -0
- package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +13 -0
- package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
- package/dist/types-cjs/index.d.ts +4 -0
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/components/_tabs.scss +44 -0
- package/src/scss/form/_dateinput.scss +87 -8
- package/src/scss/form/_daterangeinput.scss +63 -0
- package/src/scss/form/_datetimeinput.scss +7 -2
- package/src/scss/form/_file.scss +37 -0
- package/src/scss/form/_index.scss +2 -0
- package/src/scss/form/_picker-popover.scss +1 -4
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
/* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo, useState, useEffect } from 'react';
|
|
4
|
+
import { classNames } from './classNames.js';
|
|
5
|
+
import { useBulmaClasses } from './useBulmaClasses.js';
|
|
6
|
+
import { validRadii, validGaps } from './bulmaClassHelpers.js';
|
|
7
|
+
import { warnOnce } from './devWarnings.js';
|
|
8
|
+
import { useClassPrefix } from './Config.js';
|
|
9
|
+
|
|
10
|
+
// --- FULL Bulma v1 CSS variable keys (auto-generated from CSSVAR_KEYS) ---
|
|
11
|
+
const bulmaCssVars = [
|
|
12
|
+
// scheme
|
|
13
|
+
'--bulma-scheme-h',
|
|
14
|
+
'--bulma-scheme-s',
|
|
15
|
+
'--bulma-scheme-main',
|
|
16
|
+
'--bulma-scheme-main-bis',
|
|
17
|
+
'--bulma-scheme-main-ter',
|
|
18
|
+
'--bulma-scheme-invert',
|
|
19
|
+
'--bulma-scheme-invert-bis',
|
|
20
|
+
'--bulma-scheme-invert-ter',
|
|
21
|
+
'--bulma-light-l',
|
|
22
|
+
'--bulma-light-invert-l',
|
|
23
|
+
'--bulma-dark-l',
|
|
24
|
+
'--bulma-dark-invert-l',
|
|
25
|
+
'--bulma-soft-l',
|
|
26
|
+
'--bulma-bold-l',
|
|
27
|
+
'--bulma-soft-invert-l',
|
|
28
|
+
'--bulma-bold-invert-l',
|
|
29
|
+
'--bulma-hover-background-l-delta',
|
|
30
|
+
'--bulma-active-background-l-delta',
|
|
31
|
+
'--bulma-hover-border-l-delta',
|
|
32
|
+
'--bulma-active-border-l-delta',
|
|
33
|
+
'--bulma-hover-color-l-delta',
|
|
34
|
+
'--bulma-active-color-l-delta',
|
|
35
|
+
'--bulma-hover-shadow-a-delta',
|
|
36
|
+
'--bulma-active-shadow-a-delta',
|
|
37
|
+
// colors
|
|
38
|
+
'--bulma-primary-h',
|
|
39
|
+
'--bulma-primary-s',
|
|
40
|
+
'--bulma-primary-l',
|
|
41
|
+
'--bulma-link-h',
|
|
42
|
+
'--bulma-link-s',
|
|
43
|
+
'--bulma-link-l',
|
|
44
|
+
'--bulma-info-h',
|
|
45
|
+
'--bulma-info-s',
|
|
46
|
+
'--bulma-info-l',
|
|
47
|
+
'--bulma-success-h',
|
|
48
|
+
'--bulma-success-s',
|
|
49
|
+
'--bulma-success-l',
|
|
50
|
+
'--bulma-warning-h',
|
|
51
|
+
'--bulma-warning-s',
|
|
52
|
+
'--bulma-warning-l',
|
|
53
|
+
'--bulma-danger-h',
|
|
54
|
+
'--bulma-danger-s',
|
|
55
|
+
'--bulma-danger-l',
|
|
56
|
+
// shadow (the upstream token .box/.card/.dropdown/.panel derive their own
|
|
57
|
+
// shadow variables from; overriding it from an ancestor is the route that
|
|
58
|
+
// cascades, since those selectors re-declare their derived var on
|
|
59
|
+
// themselves)
|
|
60
|
+
'--bulma-shadow-h',
|
|
61
|
+
'--bulma-shadow-s',
|
|
62
|
+
'--bulma-shadow-l',
|
|
63
|
+
'--bulma-shadow',
|
|
64
|
+
// typography
|
|
65
|
+
'--bulma-family-primary',
|
|
66
|
+
'--bulma-family-secondary',
|
|
67
|
+
'--bulma-family-code',
|
|
68
|
+
'--bulma-size-small',
|
|
69
|
+
'--bulma-size-normal',
|
|
70
|
+
'--bulma-size-medium',
|
|
71
|
+
'--bulma-size-large',
|
|
72
|
+
'--bulma-weight-light',
|
|
73
|
+
'--bulma-weight-normal',
|
|
74
|
+
'--bulma-weight-medium',
|
|
75
|
+
'--bulma-weight-semibold',
|
|
76
|
+
'--bulma-weight-bold',
|
|
77
|
+
'--bulma-weight-extrabold',
|
|
78
|
+
// other
|
|
79
|
+
'--bulma-block-spacing',
|
|
80
|
+
'--bulma-duration',
|
|
81
|
+
'--bulma-easing',
|
|
82
|
+
'--bulma-radius-small',
|
|
83
|
+
'--bulma-radius',
|
|
84
|
+
'--bulma-radius-medium',
|
|
85
|
+
'--bulma-radius-large',
|
|
86
|
+
'--bulma-radius-rounded',
|
|
87
|
+
'--bulma-speed',
|
|
88
|
+
'--bulma-arrow-color',
|
|
89
|
+
'--bulma-loading-color',
|
|
90
|
+
'--bulma-burger-h',
|
|
91
|
+
'--bulma-burger-s',
|
|
92
|
+
'--bulma-burger-l',
|
|
93
|
+
'--bulma-burger-border-radius',
|
|
94
|
+
'--bulma-burger-gap',
|
|
95
|
+
'--bulma-burger-item-height',
|
|
96
|
+
'--bulma-burger-item-width',
|
|
97
|
+
// generic
|
|
98
|
+
'--bulma-body-background-color',
|
|
99
|
+
'--bulma-body-size',
|
|
100
|
+
'--bulma-body-min-width',
|
|
101
|
+
'--bulma-body-rendering',
|
|
102
|
+
'--bulma-body-family',
|
|
103
|
+
'--bulma-body-overflow-x',
|
|
104
|
+
'--bulma-body-overflow-y',
|
|
105
|
+
'--bulma-body-color',
|
|
106
|
+
'--bulma-body-font-size',
|
|
107
|
+
'--bulma-body-weight',
|
|
108
|
+
'--bulma-body-line-height',
|
|
109
|
+
'--bulma-code-family',
|
|
110
|
+
'--bulma-code-padding',
|
|
111
|
+
'--bulma-code-weight',
|
|
112
|
+
'--bulma-code-size',
|
|
113
|
+
'--bulma-small-font-size',
|
|
114
|
+
'--bulma-hr-background-color',
|
|
115
|
+
'--bulma-hr-height',
|
|
116
|
+
'--bulma-hr-margin',
|
|
117
|
+
'--bulma-strong-color',
|
|
118
|
+
'--bulma-strong-weight',
|
|
119
|
+
'--bulma-pre-font-size',
|
|
120
|
+
'--bulma-pre-padding',
|
|
121
|
+
'--bulma-pre-code-font-size',
|
|
122
|
+
// skeleton
|
|
123
|
+
'--bulma-skeleton-background',
|
|
124
|
+
'--bulma-skeleton-radius',
|
|
125
|
+
'--bulma-skeleton-block-min-height',
|
|
126
|
+
'--bulma-skeleton-lines-gap',
|
|
127
|
+
'--bulma-skeleton-line-height',
|
|
128
|
+
// breadcrumb
|
|
129
|
+
'--bulma-breadcrumb-item-color',
|
|
130
|
+
'--bulma-breadcrumb-item-hover-color',
|
|
131
|
+
'--bulma-breadcrumb-item-active-color',
|
|
132
|
+
'--bulma-breadcrumb-item-padding-vertical',
|
|
133
|
+
'--bulma-breadcrumb-item-padding-horizontal',
|
|
134
|
+
'--bulma-breadcrumb-item-separator-color',
|
|
135
|
+
// card
|
|
136
|
+
'--bulma-card-color',
|
|
137
|
+
'--bulma-card-background-color',
|
|
138
|
+
'--bulma-card-shadow',
|
|
139
|
+
'--bulma-card-radius',
|
|
140
|
+
'--bulma-card-header-background-color',
|
|
141
|
+
'--bulma-card-header-color',
|
|
142
|
+
'--bulma-card-header-padding',
|
|
143
|
+
'--bulma-card-header-shadow',
|
|
144
|
+
'--bulma-card-header-weight',
|
|
145
|
+
'--bulma-card-content-background-color',
|
|
146
|
+
'--bulma-card-content-padding',
|
|
147
|
+
'--bulma-card-footer-background-color',
|
|
148
|
+
'--bulma-card-footer-border-top',
|
|
149
|
+
'--bulma-card-footer-padding',
|
|
150
|
+
'--bulma-card-media-margin',
|
|
151
|
+
// dropdown
|
|
152
|
+
'--bulma-dropdown-menu-min-width',
|
|
153
|
+
'--bulma-dropdown-content-background-color',
|
|
154
|
+
'--bulma-dropdown-content-offset',
|
|
155
|
+
'--bulma-dropdown-content-padding-bottom',
|
|
156
|
+
'--bulma-dropdown-content-padding-top',
|
|
157
|
+
'--bulma-dropdown-content-radius',
|
|
158
|
+
'--bulma-dropdown-content-shadow',
|
|
159
|
+
'--bulma-dropdown-content-z',
|
|
160
|
+
'--bulma-dropdown-item-h',
|
|
161
|
+
'--bulma-dropdown-item-s',
|
|
162
|
+
'--bulma-dropdown-item-l',
|
|
163
|
+
'--bulma-dropdown-item-background-l',
|
|
164
|
+
'--bulma-dropdown-item-background-l-delta',
|
|
165
|
+
'--bulma-dropdown-item-hover-background-l-delta',
|
|
166
|
+
'--bulma-dropdown-item-active-background-l-delta',
|
|
167
|
+
'--bulma-dropdown-item-color-l',
|
|
168
|
+
'--bulma-dropdown-item-selected-h',
|
|
169
|
+
'--bulma-dropdown-item-selected-s',
|
|
170
|
+
'--bulma-dropdown-item-selected-l',
|
|
171
|
+
'--bulma-dropdown-item-selected-background-l',
|
|
172
|
+
'--bulma-dropdown-item-selected-color-l',
|
|
173
|
+
'--bulma-dropdown-divider-background-color',
|
|
174
|
+
// menu
|
|
175
|
+
'--bulma-menu-item-h',
|
|
176
|
+
'--bulma-menu-item-s',
|
|
177
|
+
'--bulma-menu-item-l',
|
|
178
|
+
'--bulma-menu-item-background-l',
|
|
179
|
+
'--bulma-menu-item-background-l-delta',
|
|
180
|
+
'--bulma-menu-item-hover-background-l-delta',
|
|
181
|
+
'--bulma-menu-item-active-background-l-delta',
|
|
182
|
+
'--bulma-menu-item-color-l',
|
|
183
|
+
'--bulma-menu-item-radius',
|
|
184
|
+
'--bulma-menu-item-selected-h',
|
|
185
|
+
'--bulma-menu-item-selected-s',
|
|
186
|
+
'--bulma-menu-item-selected-l',
|
|
187
|
+
'--bulma-menu-item-selected-background-l',
|
|
188
|
+
'--bulma-menu-item-selected-color-l',
|
|
189
|
+
'--bulma-menu-list-border-left',
|
|
190
|
+
'--bulma-menu-list-line-height',
|
|
191
|
+
'--bulma-menu-list-link-padding',
|
|
192
|
+
'--bulma-menu-nested-list-margin',
|
|
193
|
+
'--bulma-menu-nested-list-padding-left',
|
|
194
|
+
'--bulma-menu-label-color',
|
|
195
|
+
'--bulma-menu-label-font-size',
|
|
196
|
+
'--bulma-menu-label-letter-spacing',
|
|
197
|
+
'--bulma-menu-label-spacing',
|
|
198
|
+
// message
|
|
199
|
+
'--bulma-message-h',
|
|
200
|
+
'--bulma-message-s',
|
|
201
|
+
'--bulma-message-background-l',
|
|
202
|
+
'--bulma-message-border-l',
|
|
203
|
+
'--bulma-message-border-l-delta',
|
|
204
|
+
'--bulma-message-border-style',
|
|
205
|
+
'--bulma-message-border-width',
|
|
206
|
+
'--bulma-message-color-l',
|
|
207
|
+
'--bulma-message-radius',
|
|
208
|
+
'--bulma-message-header-weight',
|
|
209
|
+
'--bulma-message-header-padding',
|
|
210
|
+
'--bulma-message-header-radius',
|
|
211
|
+
'--bulma-message-header-body-border-width',
|
|
212
|
+
'--bulma-message-header-background-l',
|
|
213
|
+
'--bulma-message-header-color-l',
|
|
214
|
+
'--bulma-message-body-border-width',
|
|
215
|
+
'--bulma-message-body-color',
|
|
216
|
+
'--bulma-message-body-padding',
|
|
217
|
+
'--bulma-message-body-radius',
|
|
218
|
+
'--bulma-message-body-pre-code-background-color',
|
|
219
|
+
// modal
|
|
220
|
+
'--bulma-modal-z',
|
|
221
|
+
'--bulma-modal-background-background-color',
|
|
222
|
+
'--bulma-modal-content-width',
|
|
223
|
+
'--bulma-modal-content-margin-mobile',
|
|
224
|
+
'--bulma-modal-content-spacing-mobile',
|
|
225
|
+
'--bulma-modal-content-spacing-tablet',
|
|
226
|
+
'--bulma-modal-close-dimensions',
|
|
227
|
+
'--bulma-modal-close-right',
|
|
228
|
+
'--bulma-modal-close-top',
|
|
229
|
+
'--bulma-modal-card-spacing',
|
|
230
|
+
'--bulma-modal-card-head-background-color',
|
|
231
|
+
'--bulma-modal-card-head-padding',
|
|
232
|
+
'--bulma-modal-card-head-radius',
|
|
233
|
+
'--bulma-modal-card-title-color',
|
|
234
|
+
'--bulma-modal-card-title-line-height',
|
|
235
|
+
'--bulma-modal-card-title-size',
|
|
236
|
+
'--bulma-modal-card-foot-background-color',
|
|
237
|
+
'--bulma-modal-card-foot-radius',
|
|
238
|
+
'--bulma-modal-card-body-background-color',
|
|
239
|
+
'--bulma-modal-card-body-padding',
|
|
240
|
+
// navbar
|
|
241
|
+
'--bulma-navbar-h',
|
|
242
|
+
'--bulma-navbar-s',
|
|
243
|
+
'--bulma-navbar-l',
|
|
244
|
+
'--bulma-navbar-background-color',
|
|
245
|
+
'--bulma-navbar-box-shadow-size',
|
|
246
|
+
'--bulma-navbar-box-shadow-color',
|
|
247
|
+
'--bulma-navbar-padding-vertical',
|
|
248
|
+
'--bulma-navbar-padding-horizontal',
|
|
249
|
+
'--bulma-navbar-z',
|
|
250
|
+
'--bulma-navbar-fixed-z',
|
|
251
|
+
'--bulma-navbar-item-background-a',
|
|
252
|
+
'--bulma-navbar-item-background-l',
|
|
253
|
+
'--bulma-navbar-item-background-l-delta',
|
|
254
|
+
'--bulma-navbar-item-hover-background-l-delta',
|
|
255
|
+
'--bulma-navbar-item-active-background-l-delta',
|
|
256
|
+
'--bulma-navbar-item-color-l',
|
|
257
|
+
'--bulma-navbar-item-selected-h',
|
|
258
|
+
'--bulma-navbar-item-selected-s',
|
|
259
|
+
'--bulma-navbar-item-selected-l',
|
|
260
|
+
'--bulma-navbar-item-selected-background-l',
|
|
261
|
+
'--bulma-navbar-item-selected-color-l',
|
|
262
|
+
'--bulma-navbar-item-img-max-height',
|
|
263
|
+
'--bulma-navbar-burger-color',
|
|
264
|
+
'--bulma-navbar-tab-hover-background-color',
|
|
265
|
+
'--bulma-navbar-tab-hover-border-bottom-color',
|
|
266
|
+
'--bulma-navbar-tab-active-color',
|
|
267
|
+
'--bulma-navbar-tab-active-background-color',
|
|
268
|
+
'--bulma-navbar-tab-active-border-bottom-color',
|
|
269
|
+
'--bulma-navbar-tab-active-border-bottom-style',
|
|
270
|
+
'--bulma-navbar-tab-active-border-bottom-width',
|
|
271
|
+
'--bulma-navbar-dropdown-background-color',
|
|
272
|
+
'--bulma-navbar-dropdown-border-l',
|
|
273
|
+
'--bulma-navbar-dropdown-border-color',
|
|
274
|
+
'--bulma-navbar-dropdown-border-style',
|
|
275
|
+
'--bulma-navbar-dropdown-border-width',
|
|
276
|
+
'--bulma-navbar-dropdown-offset',
|
|
277
|
+
'--bulma-navbar-dropdown-arrow',
|
|
278
|
+
'--bulma-navbar-dropdown-radius',
|
|
279
|
+
'--bulma-navbar-dropdown-z',
|
|
280
|
+
'--bulma-navbar-dropdown-boxed-radius',
|
|
281
|
+
'--bulma-navbar-dropdown-boxed-shadow',
|
|
282
|
+
'--bulma-navbar-dropdown-item-h',
|
|
283
|
+
'--bulma-navbar-dropdown-item-s',
|
|
284
|
+
'--bulma-navbar-dropdown-item-l',
|
|
285
|
+
'--bulma-navbar-dropdown-item-background-l',
|
|
286
|
+
'--bulma-navbar-dropdown-item-color-l',
|
|
287
|
+
'--bulma-navbar-divider-background-l',
|
|
288
|
+
'--bulma-navbar-divider-height',
|
|
289
|
+
'--bulma-navbar-bottom-box-shadow-size',
|
|
290
|
+
// pagination
|
|
291
|
+
'--bulma-pagination-margin',
|
|
292
|
+
'--bulma-pagination-min-width',
|
|
293
|
+
'--bulma-pagination-item-h',
|
|
294
|
+
'--bulma-pagination-item-s',
|
|
295
|
+
'--bulma-pagination-item-l',
|
|
296
|
+
'--bulma-pagination-item-background-l-delta',
|
|
297
|
+
'--bulma-pagination-item-hover-background-l-delta',
|
|
298
|
+
'--bulma-pagination-item-active-background-l-delta',
|
|
299
|
+
'--bulma-pagination-item-border-style',
|
|
300
|
+
'--bulma-pagination-item-border-width',
|
|
301
|
+
'--bulma-pagination-item-border-l',
|
|
302
|
+
'--bulma-pagination-item-border-l-delta',
|
|
303
|
+
'--bulma-pagination-item-hover-border-l-delta',
|
|
304
|
+
'--bulma-pagination-item-active-border-l-delta',
|
|
305
|
+
'--bulma-pagination-item-focus-border-l-delta',
|
|
306
|
+
'--bulma-pagination-item-color-l',
|
|
307
|
+
'--bulma-pagination-item-font-size',
|
|
308
|
+
'--bulma-pagination-item-margin',
|
|
309
|
+
'--bulma-pagination-item-padding-left',
|
|
310
|
+
'--bulma-pagination-item-padding-right',
|
|
311
|
+
'--bulma-pagination-item-outer-shadow-h',
|
|
312
|
+
'--bulma-pagination-item-outer-shadow-s',
|
|
313
|
+
'--bulma-pagination-item-outer-shadow-l',
|
|
314
|
+
'--bulma-pagination-item-outer-shadow-a',
|
|
315
|
+
'--bulma-pagination-nav-padding-left',
|
|
316
|
+
'--bulma-pagination-nav-padding-right',
|
|
317
|
+
'--bulma-pagination-disabled-color',
|
|
318
|
+
'--bulma-pagination-disabled-background-color',
|
|
319
|
+
'--bulma-pagination-disabled-border-color',
|
|
320
|
+
'--bulma-pagination-current-color',
|
|
321
|
+
'--bulma-pagination-current-background-color',
|
|
322
|
+
'--bulma-pagination-current-border-color',
|
|
323
|
+
'--bulma-pagination-ellipsis-color',
|
|
324
|
+
'--bulma-pagination-shadow-inset',
|
|
325
|
+
'--bulma-pagination-selected-item-h',
|
|
326
|
+
'--bulma-pagination-selected-item-s',
|
|
327
|
+
'--bulma-pagination-selected-item-l',
|
|
328
|
+
'--bulma-pagination-selected-item-background-l',
|
|
329
|
+
'--bulma-pagination-selected-item-border-l',
|
|
330
|
+
'--bulma-pagination-selected-item-color-l',
|
|
331
|
+
// panel
|
|
332
|
+
'--bulma-panel-margin',
|
|
333
|
+
'--bulma-panel-item-border',
|
|
334
|
+
'--bulma-panel-radius',
|
|
335
|
+
'--bulma-panel-shadow',
|
|
336
|
+
'--bulma-panel-heading-line-height',
|
|
337
|
+
'--bulma-panel-heading-padding',
|
|
338
|
+
'--bulma-panel-heading-radius',
|
|
339
|
+
'--bulma-panel-heading-size',
|
|
340
|
+
'--bulma-panel-heading-weight',
|
|
341
|
+
'--bulma-panel-tabs-font-size',
|
|
342
|
+
'--bulma-panel-tab-border-bottom-color',
|
|
343
|
+
'--bulma-panel-tab-border-bottom-style',
|
|
344
|
+
'--bulma-panel-tab-border-bottom-width',
|
|
345
|
+
'--bulma-panel-tab-active-color',
|
|
346
|
+
'--bulma-panel-list-item-color',
|
|
347
|
+
'--bulma-panel-list-item-hover-color',
|
|
348
|
+
'--bulma-panel-block-color',
|
|
349
|
+
'--bulma-panel-block-hover-background-color',
|
|
350
|
+
'--bulma-panel-block-active-border-left-color',
|
|
351
|
+
'--bulma-panel-block-active-color',
|
|
352
|
+
'--bulma-panel-block-active-icon-color',
|
|
353
|
+
'--bulma-panel-icon-color',
|
|
354
|
+
// tabs
|
|
355
|
+
'--bulma-tabs-border-bottom-color',
|
|
356
|
+
'--bulma-tabs-border-bottom-style',
|
|
357
|
+
'--bulma-tabs-border-bottom-width',
|
|
358
|
+
'--bulma-tabs-link-color',
|
|
359
|
+
'--bulma-tabs-link-hover-border-bottom-color',
|
|
360
|
+
'--bulma-tabs-link-hover-color',
|
|
361
|
+
'--bulma-tabs-link-active-border-bottom-color',
|
|
362
|
+
'--bulma-tabs-link-active-color',
|
|
363
|
+
'--bulma-tabs-link-padding',
|
|
364
|
+
'--bulma-tabs-boxed-link-radius',
|
|
365
|
+
'--bulma-tabs-boxed-link-hover-background-color',
|
|
366
|
+
'--bulma-tabs-boxed-link-hover-border-bottom-color',
|
|
367
|
+
'--bulma-tabs-boxed-link-active-background-color',
|
|
368
|
+
'--bulma-tabs-boxed-link-active-border-color',
|
|
369
|
+
'--bulma-tabs-boxed-link-active-border-bottom-color',
|
|
370
|
+
'--bulma-tabs-toggle-link-border-color',
|
|
371
|
+
'--bulma-tabs-toggle-link-border-style',
|
|
372
|
+
'--bulma-tabs-toggle-link-border-width',
|
|
373
|
+
'--bulma-tabs-toggle-link-hover-background-color',
|
|
374
|
+
'--bulma-tabs-toggle-link-hover-border-color',
|
|
375
|
+
'--bulma-tabs-toggle-link-radius',
|
|
376
|
+
'--bulma-tabs-toggle-link-active-background-color',
|
|
377
|
+
'--bulma-tabs-toggle-link-active-border-color',
|
|
378
|
+
'--bulma-tabs-toggle-link-active-color',
|
|
379
|
+
// box
|
|
380
|
+
'--bulma-box-background-color',
|
|
381
|
+
'--bulma-box-color',
|
|
382
|
+
'--bulma-box-radius',
|
|
383
|
+
'--bulma-box-shadow',
|
|
384
|
+
'--bulma-box-padding',
|
|
385
|
+
'--bulma-box-link-hover-shadow',
|
|
386
|
+
'--bulma-box-link-active-shadow',
|
|
387
|
+
// content
|
|
388
|
+
'--bulma-content-heading-color',
|
|
389
|
+
'--bulma-content-heading-weight',
|
|
390
|
+
'--bulma-content-heading-line-height',
|
|
391
|
+
'--bulma-content-block-margin-bottom',
|
|
392
|
+
'--bulma-content-blockquote-background-color',
|
|
393
|
+
'--bulma-content-blockquote-border-left',
|
|
394
|
+
'--bulma-content-blockquote-padding',
|
|
395
|
+
'--bulma-content-pre-padding',
|
|
396
|
+
'--bulma-content-table-cell-border',
|
|
397
|
+
'--bulma-content-table-cell-border-width',
|
|
398
|
+
'--bulma-content-table-cell-padding',
|
|
399
|
+
'--bulma-content-table-cell-heading-color',
|
|
400
|
+
'--bulma-content-table-head-cell-border-width',
|
|
401
|
+
'--bulma-content-table-head-cell-color',
|
|
402
|
+
'--bulma-content-table-body-last-row-cell-border-bottom-width',
|
|
403
|
+
'--bulma-content-table-foot-cell-border-width',
|
|
404
|
+
'--bulma-content-table-foot-cell-color',
|
|
405
|
+
// delete
|
|
406
|
+
'--bulma-delete-dimensions',
|
|
407
|
+
'--bulma-delete-background-l',
|
|
408
|
+
'--bulma-delete-background-alpha',
|
|
409
|
+
'--bulma-delete-color',
|
|
410
|
+
// icon
|
|
411
|
+
'--bulma-icon-dimensions',
|
|
412
|
+
'--bulma-icon-dimensions-small',
|
|
413
|
+
'--bulma-icon-dimensions-medium',
|
|
414
|
+
'--bulma-icon-dimensions-large',
|
|
415
|
+
'--bulma-icon-text-spacing',
|
|
416
|
+
// notification
|
|
417
|
+
'--bulma-notification-h',
|
|
418
|
+
'--bulma-notification-s',
|
|
419
|
+
'--bulma-notification-background-l',
|
|
420
|
+
'--bulma-notification-color-l',
|
|
421
|
+
'--bulma-notification-code-background-color',
|
|
422
|
+
'--bulma-notification-radius',
|
|
423
|
+
'--bulma-notification-padding',
|
|
424
|
+
// progress
|
|
425
|
+
'--bulma-progress-border-radius',
|
|
426
|
+
'--bulma-progress-bar-background-color',
|
|
427
|
+
'--bulma-progress-value-background-color',
|
|
428
|
+
'--bulma-progress-indeterminate-duration',
|
|
429
|
+
// table
|
|
430
|
+
'--bulma-table-color',
|
|
431
|
+
'--bulma-table-background-color',
|
|
432
|
+
'--bulma-table-cell-border-color',
|
|
433
|
+
'--bulma-table-cell-border-style',
|
|
434
|
+
'--bulma-table-cell-border-width',
|
|
435
|
+
'--bulma-table-cell-padding',
|
|
436
|
+
'--bulma-table-cell-heading-color',
|
|
437
|
+
'--bulma-table-cell-text-align',
|
|
438
|
+
'--bulma-table-head-cell-border-width',
|
|
439
|
+
'--bulma-table-head-cell-color',
|
|
440
|
+
'--bulma-table-foot-cell-border-width',
|
|
441
|
+
'--bulma-table-foot-cell-color',
|
|
442
|
+
'--bulma-table-head-background-color',
|
|
443
|
+
'--bulma-table-body-background-color',
|
|
444
|
+
'--bulma-table-foot-background-color',
|
|
445
|
+
'--bulma-table-row-hover-background-color',
|
|
446
|
+
'--bulma-table-row-active-background-color',
|
|
447
|
+
'--bulma-table-row-active-color',
|
|
448
|
+
'--bulma-table-striped-row-even-background-color',
|
|
449
|
+
'--bulma-table-striped-row-even-hover-background-color',
|
|
450
|
+
// tag
|
|
451
|
+
'--bulma-tag-h',
|
|
452
|
+
'--bulma-tag-s',
|
|
453
|
+
'--bulma-tag-background-l',
|
|
454
|
+
'--bulma-tag-background-l-delta',
|
|
455
|
+
'--bulma-tag-hover-background-l-delta',
|
|
456
|
+
'--bulma-tag-active-background-l-delta',
|
|
457
|
+
'--bulma-tag-color-l',
|
|
458
|
+
'--bulma-tag-radius',
|
|
459
|
+
'--bulma-tag-delete-margin',
|
|
460
|
+
// title
|
|
461
|
+
'--bulma-title-color',
|
|
462
|
+
'--bulma-title-family',
|
|
463
|
+
'--bulma-title-size',
|
|
464
|
+
'--bulma-title-weight',
|
|
465
|
+
'--bulma-title-line-height',
|
|
466
|
+
'--bulma-title-strong-color',
|
|
467
|
+
'--bulma-title-strong-weight',
|
|
468
|
+
'--bulma-title-sub-size',
|
|
469
|
+
'--bulma-title-sup-size',
|
|
470
|
+
'--bulma-subtitle-color',
|
|
471
|
+
'--bulma-subtitle-family',
|
|
472
|
+
'--bulma-subtitle-size',
|
|
473
|
+
'--bulma-subtitle-weight',
|
|
474
|
+
'--bulma-subtitle-line-height',
|
|
475
|
+
'--bulma-subtitle-strong-color',
|
|
476
|
+
'--bulma-subtitle-strong-weight',
|
|
477
|
+
// control
|
|
478
|
+
'--bulma-control-radius',
|
|
479
|
+
'--bulma-control-radius-small',
|
|
480
|
+
'--bulma-control-border-width',
|
|
481
|
+
'--bulma-control-height',
|
|
482
|
+
'--bulma-control-line-height',
|
|
483
|
+
'--bulma-control-padding-vertical',
|
|
484
|
+
'--bulma-control-padding-horizontal',
|
|
485
|
+
'--bulma-control-size',
|
|
486
|
+
'--bulma-control-focus-shadow-l',
|
|
487
|
+
// file
|
|
488
|
+
'--bulma-file-radius',
|
|
489
|
+
'--bulma-file-name-border-color',
|
|
490
|
+
'--bulma-file-name-border-style',
|
|
491
|
+
'--bulma-file-name-border-width',
|
|
492
|
+
'--bulma-file-name-max-width',
|
|
493
|
+
'--bulma-file-h',
|
|
494
|
+
'--bulma-file-s',
|
|
495
|
+
'--bulma-file-background-l',
|
|
496
|
+
'--bulma-file-background-l-delta',
|
|
497
|
+
'--bulma-file-hover-background-l-delta',
|
|
498
|
+
'--bulma-file-active-background-l-delta',
|
|
499
|
+
'--bulma-file-border-l',
|
|
500
|
+
'--bulma-file-border-l-delta',
|
|
501
|
+
'--bulma-file-hover-border-l-delta',
|
|
502
|
+
'--bulma-file-active-border-l-delta',
|
|
503
|
+
'--bulma-file-cta-color-l',
|
|
504
|
+
'--bulma-file-name-color-l',
|
|
505
|
+
'--bulma-file-color-l-delta',
|
|
506
|
+
'--bulma-file-hover-color-l-delta',
|
|
507
|
+
'--bulma-file-active-color-l-delta',
|
|
508
|
+
// input
|
|
509
|
+
'--bulma-input-h',
|
|
510
|
+
'--bulma-input-s',
|
|
511
|
+
'--bulma-input-l',
|
|
512
|
+
'--bulma-input-border-style',
|
|
513
|
+
'--bulma-input-border-l',
|
|
514
|
+
'--bulma-input-border-l-delta',
|
|
515
|
+
'--bulma-input-hover-border-l-delta',
|
|
516
|
+
'--bulma-input-active-border-l-delta',
|
|
517
|
+
'--bulma-input-focus-h',
|
|
518
|
+
'--bulma-input-focus-s',
|
|
519
|
+
'--bulma-input-focus-l',
|
|
520
|
+
'--bulma-input-focus-shadow-size',
|
|
521
|
+
'--bulma-input-focus-shadow-alpha',
|
|
522
|
+
'--bulma-input-color-l',
|
|
523
|
+
'--bulma-input-background-l',
|
|
524
|
+
'--bulma-input-background-l-delta',
|
|
525
|
+
'--bulma-input-height',
|
|
526
|
+
'--bulma-input-shadow',
|
|
527
|
+
'--bulma-input-placeholder-color',
|
|
528
|
+
'--bulma-input-disabled-color',
|
|
529
|
+
'--bulma-input-disabled-background-color',
|
|
530
|
+
'--bulma-input-disabled-border-color',
|
|
531
|
+
'--bulma-input-disabled-placeholder-color',
|
|
532
|
+
'--bulma-input-arrow',
|
|
533
|
+
'--bulma-input-icon-color',
|
|
534
|
+
'--bulma-input-icon-hover-color',
|
|
535
|
+
'--bulma-input-icon-focus-color',
|
|
536
|
+
'--bulma-input-radius',
|
|
537
|
+
// columns
|
|
538
|
+
'--bulma-column-gap',
|
|
539
|
+
// grid
|
|
540
|
+
'--bulma-grid-gap',
|
|
541
|
+
'--bulma-grid-column-count',
|
|
542
|
+
'--bulma-grid-column-min',
|
|
543
|
+
'--bulma-grid-cell-column-span',
|
|
544
|
+
'--bulma-grid-cell-column-start',
|
|
545
|
+
// footer
|
|
546
|
+
'--bulma-footer-background-color',
|
|
547
|
+
'--bulma-footer-color',
|
|
548
|
+
'--bulma-footer-padding',
|
|
549
|
+
// hero
|
|
550
|
+
'--bulma-hero-body-padding',
|
|
551
|
+
'--bulma-hero-body-padding-tablet',
|
|
552
|
+
'--bulma-hero-body-padding-small',
|
|
553
|
+
'--bulma-hero-body-padding-medium',
|
|
554
|
+
'--bulma-hero-body-padding-large',
|
|
555
|
+
// media
|
|
556
|
+
'--bulma-media-border-color',
|
|
557
|
+
'--bulma-media-border-size',
|
|
558
|
+
'--bulma-media-spacing',
|
|
559
|
+
'--bulma-media-spacing-large',
|
|
560
|
+
'--bulma-media-content-spacing',
|
|
561
|
+
'--bulma-media-level-1-spacing',
|
|
562
|
+
'--bulma-media-level-1-content-spacing',
|
|
563
|
+
'--bulma-media-level-2-spacing',
|
|
564
|
+
// section
|
|
565
|
+
'--bulma-section-padding',
|
|
566
|
+
'--bulma-section-padding-desktop',
|
|
567
|
+
'--bulma-section-padding-medium',
|
|
568
|
+
'--bulma-section-padding-large',
|
|
569
|
+
];
|
|
570
|
+
/**
|
|
571
|
+
* Convert a Bulma CSS variable name to a camelCase prop name.
|
|
572
|
+
* @param {string} varName - CSS variable name (e.g., '--bulma-primary-h').
|
|
573
|
+
* @returns {string} The camelCase prop name (e.g., 'primaryH').
|
|
574
|
+
*/
|
|
575
|
+
function cssVarToProp(varName) {
|
|
576
|
+
return varName
|
|
577
|
+
.replace(/^--bulma-/, '')
|
|
578
|
+
.split('-')
|
|
579
|
+
.map((part, i) => i === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1))
|
|
580
|
+
.join('');
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Prop names `cssVarToProp` would mint that are already helper props:
|
|
584
|
+
* `--bulma-shadow` becomes `shadow`, `--bulma-radius` becomes `radius` and
|
|
585
|
+
* `--bulma-column-gap` becomes `columnGap`. They stay out of
|
|
586
|
+
* `bulmaVarPropMap`, so on Theme each is the helper prop it is on every other
|
|
587
|
+
* component, and every one of those variables is still reachable through
|
|
588
|
+
* `bulmaVars`.
|
|
589
|
+
*
|
|
590
|
+
* `radius` was missed here once and set `--bulma-radius` while typed as the
|
|
591
|
+
* helper (#694). It still writes that variable, so what it did then keeps
|
|
592
|
+
* working; see `themeRadiusVar`. `columnGap` joined when the gap helpers
|
|
593
|
+
* became shared helper props, and keeps its old variable route the same way;
|
|
594
|
+
* see `themeColumnGapVar`.
|
|
595
|
+
*/
|
|
596
|
+
const helperPropNames = ['shadow', 'radius', 'columnGap'];
|
|
597
|
+
/**
|
|
598
|
+
* Mapping of camelCase prop names to their Bulma CSS variable counterparts,
|
|
599
|
+
* minus the `helperPropNames` above.
|
|
600
|
+
*/
|
|
601
|
+
const bulmaVarPropMap = Object.fromEntries(bulmaCssVars
|
|
602
|
+
.map(cssVar => [cssVarToProp(cssVar), cssVar])
|
|
603
|
+
.filter(([prop]) => !helperPropNames.includes(prop)));
|
|
604
|
+
/**
|
|
605
|
+
* What each helper value of `radius` writes to `--bulma-radius` on a Theme,
|
|
606
|
+
* alongside its class.
|
|
607
|
+
*
|
|
608
|
+
* Before #694, `radius="radiusless"` wrote `--bulma-radius: radiusless`. That
|
|
609
|
+
* is not a length, and a declaration reading an invalid variable falls back
|
|
610
|
+
* to its property's initial value, which for a border radius is 0. So
|
|
611
|
+
* everything inside the Theme that takes its radius from that variable lost
|
|
612
|
+
* it, and under `isRoot` so did everything on the page that does. Writing a
|
|
613
|
+
* real 0 keeps what
|
|
614
|
+
* people see and makes it valid CSS. Keyed by the helper values, so adding
|
|
615
|
+
* one means saying what it writes.
|
|
616
|
+
*
|
|
617
|
+
* The sizes write nothing and only add their class. Their classes read the
|
|
618
|
+
* radius variables, so `normal` would point `--bulma-radius` at itself, which
|
|
619
|
+
* is invalid and computes to 0, and `rounded` would turn every control inside
|
|
620
|
+
* the Theme into a pill.
|
|
621
|
+
*/
|
|
622
|
+
const radiusHelperVars = {
|
|
623
|
+
radiusless: '0',
|
|
624
|
+
small: undefined,
|
|
625
|
+
normal: undefined,
|
|
626
|
+
large: undefined,
|
|
627
|
+
rounded: undefined,
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* What `radius` writes to `--bulma-radius` on a Theme, or `undefined` when it
|
|
631
|
+
* writes nothing.
|
|
632
|
+
*
|
|
633
|
+
* A helper value writes its `radiusHelperVars` entry. Any other non-empty
|
|
634
|
+
* string is written as given: before #694 every `radius` on Theme set the
|
|
635
|
+
* variable whatever its type said, and a JavaScript caller passing a length
|
|
636
|
+
* got the radius it asked for. That keeps working so nothing breaks, but the
|
|
637
|
+
* type rejects it, so it warns in development and points at `bulmaVars`.
|
|
638
|
+
*
|
|
639
|
+
* Only a string writes anything, because only a string ever set the variable
|
|
640
|
+
* to something usable: an empty value or zero was dropped, and a boolean or
|
|
641
|
+
* any other bare number is not a length. The helper ignores those too, the
|
|
642
|
+
* way it does on every other component.
|
|
643
|
+
*/
|
|
644
|
+
const themeRadiusVar = (radius) => {
|
|
645
|
+
if (typeof radius !== 'string' || radius === '') {
|
|
646
|
+
return undefined;
|
|
647
|
+
}
|
|
648
|
+
if (validRadii.includes(radius)) {
|
|
649
|
+
return radiusHelperVars[radius];
|
|
650
|
+
}
|
|
651
|
+
warnOnce('Theme:radius-variable', `[bestax-bulma] <Theme radius="${radius}">: setting --bulma-radius ` +
|
|
652
|
+
'through the radius prop is deprecated and will stop working in a ' +
|
|
653
|
+
'future major version. On Theme, as on every other component, radius ' +
|
|
654
|
+
`is the border radius helper ("${validRadii.join('", "')}"). Set the variable with ` +
|
|
655
|
+
`bulmaVars={{ '--bulma-radius': '${radius}' }} instead.`);
|
|
656
|
+
return radius;
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* What `columnGap` writes to `--bulma-column-gap` on a Theme, or `undefined`
|
|
660
|
+
* when it writes nothing.
|
|
661
|
+
*
|
|
662
|
+
* Until the gap helpers were shared helper props, `columnGap` on Theme was
|
|
663
|
+
* the camelCase prop Theme mints for `--bulma-column-gap`. It was never in
|
|
664
|
+
* `ThemeProps`, so only untyped code reached it, but that code got the
|
|
665
|
+
* columns gutter it asked for. It is the column gap helper now, as on every
|
|
666
|
+
* other component, so a gap step goes to the helper and writes nothing here.
|
|
667
|
+
* Any other non-empty string is still written as given, so a length such as
|
|
668
|
+
* `'1rem'` keeps working, with a development warning pointing at `bulmaVars`.
|
|
669
|
+
*
|
|
670
|
+
* Only a string writes anything, for the reason `themeRadiusVar` gives: a
|
|
671
|
+
* number or a boolean was never a usable length.
|
|
672
|
+
*/
|
|
673
|
+
const themeColumnGapVar = (columnGap) => {
|
|
674
|
+
if (typeof columnGap !== 'string' || columnGap === '') {
|
|
675
|
+
return undefined;
|
|
676
|
+
}
|
|
677
|
+
if (validGaps.includes(columnGap)) {
|
|
678
|
+
return undefined;
|
|
679
|
+
}
|
|
680
|
+
warnOnce('Theme:column-gap-variable', `[bestax-bulma] <Theme columnGap="${columnGap}">: setting ` +
|
|
681
|
+
'--bulma-column-gap through the columnGap prop is deprecated and will ' +
|
|
682
|
+
'stop working in a future major version. On Theme, as on every other ' +
|
|
683
|
+
'component, columnGap is the column gap helper ' +
|
|
684
|
+
`("${validGaps.join('", "')}"). Set the variable with ` +
|
|
685
|
+
`bulmaVars={{ '--bulma-column-gap': '${columnGap}' }} instead.`);
|
|
686
|
+
return columnGap;
|
|
687
|
+
};
|
|
688
|
+
/** The one `<style>` element every `isRoot` Theme writes into. */
|
|
689
|
+
const ROOT_STYLE_ID = 'bestax-bulma-theme-vars';
|
|
690
|
+
/**
|
|
691
|
+
* The `:root` rules of every mounted `isRoot` Theme that has any, keyed by the
|
|
692
|
+
* Theme's render order.
|
|
693
|
+
*
|
|
694
|
+
* Root Themes share one `<style>` element, so each keeps its rules here and
|
|
695
|
+
* the element is rebuilt from all of them whenever one mounts, changes or
|
|
696
|
+
* unmounts. Before this each Theme overwrote the element with only its own
|
|
697
|
+
* rules, and the first to unmount removed it for all of them (#736).
|
|
698
|
+
*
|
|
699
|
+
* The key is a number each Theme takes when it first renders. React renders a
|
|
700
|
+
* parent before its children and an earlier sibling before a later one, so an
|
|
701
|
+
* inner or later-mounted root Theme sorts later, comes later in the
|
|
702
|
+
* stylesheet, and wins a variable two of them set, as an inner scoped Theme
|
|
703
|
+
* does. Effects would give the wrong answer for nesting: React runs a child's
|
|
704
|
+
* effects before its parent's. Only the relative order matters, so a number
|
|
705
|
+
* skipped by StrictMode calling the initializer twice, or by a render React
|
|
706
|
+
* throws away, is harmless. The key never changes, so an update keeps its
|
|
707
|
+
* place and re-rendering one Theme never changes which one wins.
|
|
708
|
+
*/
|
|
709
|
+
const rootThemeRules = new Map();
|
|
710
|
+
let nextRootOrder = 0;
|
|
711
|
+
/**
|
|
712
|
+
* Write every registered root Theme's rules into the shared element, creating
|
|
713
|
+
* it when needed and removing it once no Theme has any rules left.
|
|
714
|
+
*/
|
|
715
|
+
const renderRootThemeRules = () => {
|
|
716
|
+
let element = document.getElementById(ROOT_STYLE_ID);
|
|
717
|
+
if (rootThemeRules.size === 0) {
|
|
718
|
+
element?.remove();
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (!element) {
|
|
722
|
+
element = document.createElement('style');
|
|
723
|
+
element.id = ROOT_STYLE_ID;
|
|
724
|
+
document.head.appendChild(element);
|
|
725
|
+
}
|
|
726
|
+
element.textContent = [...rootThemeRules]
|
|
727
|
+
.sort(([a], [b]) => a - b)
|
|
728
|
+
.map(([, rules]) => rules)
|
|
729
|
+
.join('\n');
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* Record one Theme's `:root` rules, where an empty string means it has none,
|
|
733
|
+
* and rebuild the shared element if that changed anything. A Theme with no
|
|
734
|
+
* rules never touches the element, which is what it did before the registry
|
|
735
|
+
* too.
|
|
736
|
+
*/
|
|
737
|
+
const setRootThemeRules = (order, rules) => {
|
|
738
|
+
if ((rootThemeRules.get(order) ?? '') === rules) {
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
if (rules) {
|
|
742
|
+
rootThemeRules.set(order, rules);
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
rootThemeRules.delete(order);
|
|
746
|
+
}
|
|
747
|
+
renderRootThemeRules();
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* Theme component that injects Bulma CSS variables either globally or locally.
|
|
751
|
+
*
|
|
752
|
+
* When `isRoot` is true, variables are injected at `:root`. Otherwise, a wrapping
|
|
753
|
+
* `<div>` scopes the variables to its children.
|
|
754
|
+
*
|
|
755
|
+
* @function
|
|
756
|
+
* @param {ThemeProps} props - Props for the Theme component.
|
|
757
|
+
* @returns {JSX.Element} The theme wrapper or fragment.
|
|
758
|
+
*
|
|
759
|
+
* @example
|
|
760
|
+
* // Local theme scope
|
|
761
|
+
* <Theme primaryH="171" primaryS="100%" primaryL="41%">
|
|
762
|
+
* <Button color="primary">Themed</Button>
|
|
763
|
+
* </Theme>
|
|
764
|
+
*/
|
|
765
|
+
const Theme = ({ bulmaVars = {}, children, className, isRoot = false, colorMode, radius, columnGap, ...restProps }) => {
|
|
766
|
+
const radiusVar = themeRadiusVar(radius);
|
|
767
|
+
const columnGapVar = themeColumnGapVar(columnGap);
|
|
768
|
+
const radiusHelper = validRadii.includes(radius)
|
|
769
|
+
? radius
|
|
770
|
+
: undefined;
|
|
771
|
+
// A radius size only adds its class, and a root Theme renders no wrapper to
|
|
772
|
+
// carry one, so on `isRoot` it does nothing at all. Say so, as the other
|
|
773
|
+
// radius routes that do not do what they look like do.
|
|
774
|
+
if (isRoot && radiusHelper && radiusHelperVars[radiusHelper] === undefined) {
|
|
775
|
+
warnOnce('Theme:root-radius-size', `[bestax-bulma] <Theme isRoot radius="${radiusHelper}">: a root Theme ` +
|
|
776
|
+
`has no wrapper element for has-radius-${radiusHelper}, and the ` +
|
|
777
|
+
'radius sizes set no variable, so this does nothing. To round one ' +
|
|
778
|
+
`element, put radius="${radiusHelper}" on it. To change the radius ` +
|
|
779
|
+
"across the page, set bulmaVars={{ '--bulma-radius': '…' }} instead.");
|
|
780
|
+
}
|
|
781
|
+
// The same for a gap step in `columnGap`, which reads like the columns
|
|
782
|
+
// gutter it once set and, at the root, has no element for its class.
|
|
783
|
+
const columnGapStep = typeof columnGap === 'number' ? String(columnGap) : columnGap;
|
|
784
|
+
if (isRoot &&
|
|
785
|
+
columnGapStep !== undefined &&
|
|
786
|
+
validGaps.includes(columnGapStep)) {
|
|
787
|
+
warnOnce('Theme:root-column-gap', `[bestax-bulma] <Theme isRoot columnGap="${columnGapStep}">: a root ` +
|
|
788
|
+
`Theme has no wrapper element for is-column-gap-${columnGapStep}, ` +
|
|
789
|
+
'and a gap step sets no variable, so this does nothing. To change ' +
|
|
790
|
+
'the columns gutter across the page, set ' +
|
|
791
|
+
"bulmaVars={{ '--bulma-column-gap': '…' }} instead.");
|
|
792
|
+
}
|
|
793
|
+
// Extract Bulma variable props from restProps
|
|
794
|
+
const { bulmaVarProps, otherProps } = useMemo(() => {
|
|
795
|
+
const varProps = {};
|
|
796
|
+
const otherPropsObj = {};
|
|
797
|
+
for (const [key, value] of Object.entries(restProps)) {
|
|
798
|
+
if (Object.prototype.hasOwnProperty.call(bulmaVarPropMap, key)) {
|
|
799
|
+
varProps[key] = value;
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
otherPropsObj[key] = value;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return { bulmaVarProps: varProps, otherProps: otherPropsObj };
|
|
806
|
+
}, [restProps]);
|
|
807
|
+
// Everything left in `otherProps` lands on the wrapper div, as a helper
|
|
808
|
+
// class or an attribute, and so does `className`. A root Theme renders no
|
|
809
|
+
// wrapper, so under `isRoot` all of it is dropped. `radius` and `columnGap`
|
|
810
|
+
// are not in `otherProps`; the checks above cover them.
|
|
811
|
+
if (isRoot) {
|
|
812
|
+
const dropped = Object.entries(otherProps)
|
|
813
|
+
.filter(([, value]) => value !== undefined && value !== null && value !== false)
|
|
814
|
+
.map(([key]) => key);
|
|
815
|
+
if (className) {
|
|
816
|
+
dropped.unshift('className');
|
|
817
|
+
}
|
|
818
|
+
if (dropped.length > 0) {
|
|
819
|
+
warnOnce('Theme:root-dropped-props', `[bestax-bulma] <Theme isRoot>: a root Theme renders no wrapper ` +
|
|
820
|
+
`element, so ${dropped.join(', ')} ` +
|
|
821
|
+
`${dropped.length === 1 ? 'has' : 'have'} nothing to apply to. ` +
|
|
822
|
+
'Put helper props and classes on an element inside the Theme ' +
|
|
823
|
+
'instead.');
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
// Use Bulma classes for styling (only when not isRoot). Only a helper value
|
|
827
|
+
// of `radius` reaches the helper; a legacy string went to the variable.
|
|
828
|
+
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
829
|
+
...otherProps,
|
|
830
|
+
radius: radiusHelper,
|
|
831
|
+
columnGap,
|
|
832
|
+
});
|
|
833
|
+
// Merge bulmaVars and individual props, with props taking precedence
|
|
834
|
+
const mergedVars = useMemo(() => {
|
|
835
|
+
const vars = { ...bulmaVars };
|
|
836
|
+
for (const [propName, cssVar] of Object.entries(bulmaVarPropMap)) {
|
|
837
|
+
if (bulmaVarProps[propName] !== undefined) {
|
|
838
|
+
vars[cssVar] = bulmaVarProps[propName];
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
if (radiusVar !== undefined) {
|
|
842
|
+
vars['--bulma-radius'] = radiusVar;
|
|
843
|
+
}
|
|
844
|
+
if (columnGapVar !== undefined) {
|
|
845
|
+
vars['--bulma-column-gap'] = columnGapVar;
|
|
846
|
+
}
|
|
847
|
+
return vars;
|
|
848
|
+
}, [bulmaVars, bulmaVarProps, radiusVar, columnGapVar]);
|
|
849
|
+
// This Theme's place among root Themes; see `rootThemeRules`.
|
|
850
|
+
const [rootOrder] = useState(() => nextRootOrder++);
|
|
851
|
+
// The `:root` rules this Theme contributes, or '' when it contributes none.
|
|
852
|
+
const rootRules = useMemo(() => {
|
|
853
|
+
if (!isRoot) {
|
|
854
|
+
return '';
|
|
855
|
+
}
|
|
856
|
+
const cssRules = Object.entries(mergedVars)
|
|
857
|
+
.filter(([key, value]) => bulmaCssVars.includes(key) && value)
|
|
858
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
859
|
+
.join(' ');
|
|
860
|
+
return cssRules ? `:root { ${cssRules} }` : '';
|
|
861
|
+
}, [mergedVars, isRoot]);
|
|
862
|
+
// Inject CSS variables globally at :root level, alongside any other root
|
|
863
|
+
// Themes. Clearing `isRoot` or every variable passes '', which withdraws
|
|
864
|
+
// this Theme's rules.
|
|
865
|
+
useEffect(() => {
|
|
866
|
+
setRootThemeRules(rootOrder, rootRules);
|
|
867
|
+
}, [rootOrder, rootRules]);
|
|
868
|
+
// Withdraw them on unmount. Kept apart from the effect above so a change
|
|
869
|
+
// rewrites the shared element in place rather than removing and recreating
|
|
870
|
+
// it between the cleanup and the next run.
|
|
871
|
+
useEffect(() => () => setRootThemeRules(rootOrder, ''), [rootOrder]);
|
|
872
|
+
// Bulma names its scheme attribute after the class prefix a stylesheet was
|
|
873
|
+
// built with (`data-<prefix>theme`), so the prefixed builds read
|
|
874
|
+
// `data-bestax-theme` and never `data-theme`.
|
|
875
|
+
const classPrefix = useClassPrefix();
|
|
876
|
+
// Toggle Bulma's light/dark scheme by writing the theme attribute on the
|
|
877
|
+
// document root (<html>). This is always global, even on a scoped Theme.
|
|
878
|
+
// Under a class prefix the prefixed attribute is written as well as
|
|
879
|
+
// `data-theme`, so whichever build is loaded sees it; with no prefix only
|
|
880
|
+
// `data-theme` is. `'system'` removes them so Bulma follows the OS
|
|
881
|
+
// preference.
|
|
882
|
+
useEffect(() => {
|
|
883
|
+
if (colorMode === undefined) {
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
const root = document.documentElement;
|
|
887
|
+
const names = classPrefix
|
|
888
|
+
? ['data-theme', `data-${classPrefix}theme`]
|
|
889
|
+
: ['data-theme'];
|
|
890
|
+
const previous = names.map(name => root.getAttribute(name));
|
|
891
|
+
for (const name of names) {
|
|
892
|
+
if (colorMode === 'system') {
|
|
893
|
+
root.removeAttribute(name);
|
|
894
|
+
continue;
|
|
895
|
+
}
|
|
896
|
+
try {
|
|
897
|
+
root.setAttribute(name, colorMode);
|
|
898
|
+
}
|
|
899
|
+
catch {
|
|
900
|
+
// A class prefix can hold characters an attribute name cannot.
|
|
901
|
+
// `data-theme` is still written, as it was before the prefixed
|
|
902
|
+
// attribute existed, but a sheet built with that prefix keeps its
|
|
903
|
+
// scheme, so say so.
|
|
904
|
+
warnOnce('Theme:color-mode-prefix', `[bestax-bulma] <Theme colorMode="${colorMode}">: the class ` +
|
|
905
|
+
`prefix "${classPrefix}" makes ${name} an invalid attribute ` +
|
|
906
|
+
'name, so only data-theme is written, and a stylesheet built ' +
|
|
907
|
+
'with that prefix keeps its scheme.');
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
// Restore the previous values when colorMode changes or the component unmounts.
|
|
911
|
+
return () => {
|
|
912
|
+
names.forEach((name, i) => {
|
|
913
|
+
const value = previous[i];
|
|
914
|
+
if (value === null) {
|
|
915
|
+
root.removeAttribute(name);
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
root.setAttribute(name, value);
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
};
|
|
922
|
+
}, [colorMode, classPrefix]);
|
|
923
|
+
// For local injection (when isRoot is false), prepare style object for CSS vars
|
|
924
|
+
const style = useMemo(() => {
|
|
925
|
+
if (isRoot) {
|
|
926
|
+
return {};
|
|
927
|
+
}
|
|
928
|
+
const styleObj = {};
|
|
929
|
+
for (const [key, value] of Object.entries(mergedVars)) {
|
|
930
|
+
if (bulmaCssVars.includes(key) && value) {
|
|
931
|
+
styleObj[key] = value;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
return styleObj;
|
|
935
|
+
}, [mergedVars, isRoot]);
|
|
936
|
+
// Generate combined class names for the wrapper div
|
|
937
|
+
const combinedClassName = useMemo(() => {
|
|
938
|
+
if (isRoot) {
|
|
939
|
+
return '';
|
|
940
|
+
}
|
|
941
|
+
return classNames(className, bulmaHelperClasses);
|
|
942
|
+
}, [className, bulmaHelperClasses, isRoot]);
|
|
943
|
+
return isRoot ? (jsx(Fragment, { children: children })) : (jsx("div", { className: combinedClassName || undefined, style: style, ...rest, children: children }));
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
export { Theme };
|
|
947
|
+
//# sourceMappingURL=Theme.js.map
|