material-plus-ui 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/accordion/MPAccordion.d.ts +21 -1
- package/dist/components/accordion/MPAccordion.js +1 -1
- package/dist/components/alert/MPAlert.d.ts +33 -2
- package/dist/components/alert/MPAlert.js +1 -1
- package/dist/components/anchor/MPAnchor.d.ts +107 -0
- package/dist/components/anchor/MPAnchor.js +2 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
- package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
- package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
- package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
- package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/MPAnimateFade.js +2 -1
- package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
- package/dist/components/animate-float/MPAnimateFloat.js +2 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
- package/dist/components/animate-lighting/MPAnimateLighting.js +2 -1
- package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
- package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
- package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
- package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
- package/dist/components/animate-shake/MPAnimateShake.js +2 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
- package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
- package/dist/components/animate-split/MPAnimateSplit.js +2 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
- package/dist/components/app-logo/MPAppLogo.d.ts +156 -0
- package/dist/components/app-logo/MPAppLogo.js +2 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
- package/dist/components/area-chart/MPAreaChart.js +2 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
- package/dist/components/avatar/MPAvatar.d.ts +10 -1
- package/dist/components/avatar/MPAvatar.js +1 -1
- package/dist/components/badge/MPBadge.js +1 -1
- package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
- package/dist/components/bar-chart/MPBarChart.js +2 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/blockquote/MPBlockquote.d.ts +10 -1
- package/dist/components/blockquote/MPBlockquote.js +1 -1
- package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +19 -18
- package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
- package/dist/components/box/MPBox.d.ts +43 -8
- package/dist/components/box/MPBox.js +2 -1
- package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
- package/dist/components/button/MPButton.d.ts +49 -3
- package/dist/components/button/MPButton.js +1 -1
- package/dist/components/calendar/MPCalendar.d.ts +160 -0
- package/dist/components/calendar/MPCalendar.js +2 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/MPCard.js +1 -1
- package/dist/components/carousel/MPCarousel.js +1 -1
- package/dist/components/chat-bubble/MPChatBubble.js +1 -1
- package/dist/components/checkbox/MPCheckbox.js +1 -1
- package/dist/components/chip/MPChip.d.ts +31 -7
- package/dist/components/chip/MPChip.js +1 -1
- package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
- package/dist/components/code-block/MPCodeBlock.js +2 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
- package/dist/components/collapsible/MPCollapsible.js +1 -1
- package/dist/components/color-picker/MPColorPicker.js +1 -1
- package/dist/components/combobox/MPCombobox.d.ts +71 -5
- package/dist/components/combobox/MPCombobox.js +1 -1
- package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
- package/dist/components/command-palette/MPCommandPalette.js +1 -1
- package/dist/components/config/MPConfigProvider.d.ts +166 -0
- package/dist/components/config/MPConfigProvider.js +2 -0
- package/dist/components/config/index.d.ts +2 -0
- package/dist/components/config/index.js +1 -0
- package/dist/components/confirm/MPConfirmProvider.d.ts +143 -0
- package/dist/components/confirm/MPConfirmProvider.js +2 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/MPContainer.d.ts +9 -2
- package/dist/components/container/MPContainer.js +2 -1
- package/dist/components/data-list/MPDataList.d.ts +82 -0
- package/dist/components/data-list/MPDataList.js +2 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/MPDataTable.d.ts +295 -0
- package/dist/components/data-table/MPDataTable.js +2 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/MPDatePicker.d.ts +53 -2
- package/dist/components/date-picker/MPDatePicker.js +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
- package/dist/components/dialog/MPDialog.d.ts +24 -3
- package/dist/components/dialog/MPDialog.js +1 -1
- package/dist/components/divider/MPDivider.js +1 -1
- package/dist/components/drawer/MPDrawer.d.ts +8 -2
- package/dist/components/drawer/MPDrawer.js +1 -1
- package/dist/components/empty/MPEmpty.d.ts +10 -1
- package/dist/components/empty/MPEmpty.js +1 -1
- package/dist/components/fieldset/MPFieldset.js +1 -1
- package/dist/components/file-picker/MPFilePicker.js +1 -1
- package/dist/components/flex/MPFlex.d.ts +95 -0
- package/dist/components/flex/MPFlex.js +2 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
- package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
- package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
- package/dist/components/floating-bottom-navigation/index.js +1 -0
- package/dist/components/footer/MPFooter.d.ts +24 -4
- package/dist/components/footer/MPFooter.js +1 -1
- package/dist/components/form/MPForm.js +1 -1
- package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
- package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/MPGrid.d.ts +23 -1
- package/dist/components/grid/MPGrid.js +1 -1
- package/dist/components/header/MPHeader.d.ts +26 -4
- package/dist/components/header/MPHeader.js +1 -1
- package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
- package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/hover-card/MPHoverCard.d.ts +100 -0
- package/dist/components/hover-card/MPHoverCard.js +2 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/image/MPImage.d.ts +121 -0
- package/dist/components/image/MPImage.js +2 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/line-chart/MPLineChart.d.ts +66 -0
- package/dist/components/line-chart/MPLineChart.js +2 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/list/MPList.d.ts +51 -1
- package/dist/components/list/MPList.js +1 -1
- package/dist/components/menu/MPMenu.d.ts +21 -2
- package/dist/components/menu/MPMenu.js +1 -1
- package/dist/components/menubar/MPMenubar.js +1 -1
- package/dist/components/meter/MPMeter.d.ts +87 -0
- package/dist/components/meter/MPMeter.js +2 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/MPMockup.d.ts +143 -0
- package/dist/components/mockup/MPMockup.js +2 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
- package/dist/components/number-field/MPNumberField.d.ts +3 -3
- package/dist/components/number-field/MPNumberField.js +1 -1
- package/dist/components/otp-field/MPOtpField.js +1 -1
- package/dist/components/overlay/MPOverlay.d.ts +1 -1
- package/dist/components/overlay/MPOverlay.js +1 -1
- package/dist/components/pagination/MPPagination.js +1 -1
- package/dist/components/panes/MPPanes.js +1 -1
- package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
- package/dist/components/pie-chart/MPPieChart.js +2 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/MPPill.js +1 -1
- package/dist/components/popconfirm/MPPopconfirm.d.ts +92 -0
- package/dist/components/popconfirm/MPPopconfirm.js +2 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/MPPopover.d.ts +1 -1
- package/dist/components/popover/MPPopover.js +1 -1
- package/dist/components/portal/MPPortal.d.ts +75 -0
- package/dist/components/portal/MPPortal.js +2 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/MPProgressBox.js +1 -1
- package/dist/components/progress-circular/MPProgressCircular.js +1 -1
- package/dist/components/progress-linear/MPProgressLinear.js +1 -1
- package/dist/components/radio-group/MPRadioGroup.js +1 -1
- package/dist/components/rating/MPRating.js +1 -1
- package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
- package/dist/components/scatter-chart/MPScatterChart.js +2 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
- package/dist/components/scroll-area/MPScrollArea.js +2 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
- package/dist/components/scroll-zone/MPScrollZone.js +2 -0
- package/dist/components/scroll-zone/index.d.ts +2 -0
- package/dist/components/scroll-zone/index.js +1 -0
- package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
- package/dist/components/select/MPSelect.d.ts +28 -5
- package/dist/components/select/MPSelect.js +1 -1
- package/dist/components/shortcut/MPShortcut.js +1 -1
- package/dist/components/show/MPShow.d.ts +78 -0
- package/dist/components/show/MPShow.js +2 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/MPSidebar.d.ts +20 -1
- package/dist/components/sidebar/MPSidebar.js +1 -1
- package/dist/components/skeleton/MPSkeleton.js +1 -1
- package/dist/components/slider/MPSlider.d.ts +27 -0
- package/dist/components/slider/MPSlider.js +1 -1
- package/dist/components/snackbar/MPSnackbar.d.ts +20 -1
- package/dist/components/snackbar/MPSnackbar.js +1 -1
- package/dist/components/sparkline/MPSparkline.d.ts +85 -0
- package/dist/components/sparkline/MPSparkline.js +2 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
- package/dist/components/spoiler/MPSpoiler.js +1 -1
- package/dist/components/stack/MPStack.d.ts +198 -0
- package/dist/components/stack/MPStack.js +2 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/statistic/MPStatistic.d.ts +104 -0
- package/dist/components/statistic/MPStatistic.js +2 -0
- package/dist/components/statistic/index.d.ts +2 -0
- package/dist/components/statistic/index.js +1 -0
- package/dist/components/stepper/MPStepper.d.ts +153 -0
- package/dist/components/stepper/MPStepper.js +2 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/index.js +1 -0
- package/dist/components/switch/MPSwitch.js +1 -1
- package/dist/components/table/MPTable.d.ts +24 -2
- package/dist/components/table/MPTable.js +1 -1
- package/dist/components/tabs/MPTabs.d.ts +12 -0
- package/dist/components/tabs/MPTabs.js +1 -1
- package/dist/components/text-field/MPTextField.d.ts +38 -14
- package/dist/components/text-field/MPTextField.js +1 -1
- package/dist/components/time-picker/MPTimePicker.js +1 -1
- package/dist/components/timeline/MPTimeline.d.ts +10 -2
- package/dist/components/timeline/MPTimeline.js +1 -1
- package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
- package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toggle/MPToggle.js +1 -1
- package/dist/components/toolbar/MPToolbar.d.ts +106 -0
- package/dist/components/toolbar/MPToolbar.js +2 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/tour/MPTour.d.ts +120 -0
- package/dist/components/tour/MPTour.js +2 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/MPTransfer.js +1 -1
- package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
- package/dist/components/tree-select/MPTreeSelect.js +2 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/MPTreeView.d.ts +153 -0
- package/dist/components/tree-view/MPTreeView.js +2 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/components/typography/MPTypography.d.ts +17 -1
- package/dist/components/typography/MPTypography.js +1 -1
- package/dist/components/visually-hidden/MPVisuallyHidden.d.ts +60 -0
- package/dist/components/visually-hidden/MPVisuallyHidden.js +2 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/constants/glyphs.d.ts +4 -0
- package/dist/constants/glyphs.js +1 -1
- package/dist/constants/icons.d.ts +2 -0
- package/dist/constants/icons.js +1 -1
- package/dist/hooks/index.d.ts +40 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useMPColorScheme.d.ts +135 -0
- package/dist/hooks/useMPColorScheme.js +2 -0
- package/dist/hooks/useMPDisclosure.d.ts +58 -0
- package/dist/hooks/useMPDisclosure.js +2 -0
- package/dist/hooks/useMPElementSize.d.ts +55 -0
- package/dist/hooks/useMPElementSize.js +2 -0
- package/dist/hooks/useMPMediaQuery.d.ts +40 -0
- package/dist/hooks/useMPMediaQuery.js +2 -0
- package/dist/hooks/useMPOnScreen.d.ts +58 -0
- package/dist/hooks/useMPOnScreen.js +2 -0
- package/dist/hooks/useMPReducedMotion.d.ts +32 -0
- package/dist/hooks/useMPReducedMotion.js +2 -0
- package/dist/hooks/useMPShortcut.d.ts +105 -0
- package/dist/hooks/useMPShortcut.js +2 -0
- package/dist/hooks/useMPWindowClass.d.ts +55 -0
- package/dist/hooks/useMPWindowClass.js +2 -0
- package/dist/index.d.ts +43 -1
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.d.ts +19 -4
- package/dist/internal/Calendar.js +1 -1
- package/dist/internal/ChartChrome.d.ts +205 -0
- package/dist/internal/ChartChrome.js +2 -0
- package/dist/internal/ChartFrame.d.ts +197 -0
- package/dist/internal/ChartFrame.js +2 -0
- package/dist/internal/FieldOutline.d.ts +14 -5
- package/dist/internal/FieldOutline.js +1 -1
- package/dist/internal/Picker.d.ts +15 -3
- package/dist/internal/Picker.js +1 -1
- package/dist/internal/SupportingText.d.ts +24 -0
- package/dist/internal/SupportingText.js +1 -1
- package/dist/internal/animate-core.d.ts +121 -0
- package/dist/internal/animate-core.js +1 -0
- package/dist/internal/animate.d.ts +75 -55
- package/dist/internal/animate.js +1 -1
- package/dist/internal/bottom-navigation.d.ts +58 -0
- package/dist/internal/bottom-navigation.js +2 -0
- package/dist/internal/chart.d.ts +471 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.d.ts +28 -0
- package/dist/internal/color-scheme.js +2 -0
- package/dist/internal/config.d.ts +62 -0
- package/dist/internal/config.js +2 -0
- package/dist/internal/data-table.d.ts +162 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +50 -3
- package/dist/internal/date.js +1 -1
- package/dist/internal/density.d.ts +9 -0
- package/dist/internal/density.js +1 -0
- package/dist/internal/elevation.d.ts +26 -0
- package/dist/internal/elevation.js +1 -0
- package/dist/internal/highlight.d.ts +96 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/i18n.d.ts +196 -1
- package/dist/internal/initials.d.ts +28 -0
- package/dist/internal/initials.js +1 -0
- package/dist/internal/mark.d.ts +52 -0
- package/dist/internal/mark.js +1 -0
- package/dist/internal/measure.d.ts +31 -0
- package/dist/internal/measure.js +1 -0
- package/dist/internal/messages/anchor.d.ts +3 -0
- package/dist/internal/messages/anchor.js +1 -0
- package/dist/internal/messages/chart.d.ts +3 -0
- package/dist/internal/messages/chart.js +1 -0
- package/dist/internal/messages/code.d.ts +3 -0
- package/dist/internal/messages/code.js +1 -0
- package/dist/internal/messages/confirm.d.ts +3 -0
- package/dist/internal/messages/confirm.js +1 -0
- package/dist/internal/messages/data-table.d.ts +3 -0
- package/dist/internal/messages/data-table.js +1 -0
- package/dist/internal/messages/picker.js +1 -1
- package/dist/internal/messages/scroll.d.ts +3 -0
- package/dist/internal/messages/scroll.js +1 -0
- package/dist/internal/messages/sparkline.d.ts +3 -0
- package/dist/internal/messages/sparkline.js +1 -0
- package/dist/internal/messages/tour.d.ts +3 -0
- package/dist/internal/messages/tour.js +1 -0
- package/dist/internal/mockup.d.ts +174 -0
- package/dist/internal/mockup.js +2 -0
- package/dist/internal/page-layout.d.ts +24 -5
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/progress.d.ts +14 -0
- package/dist/internal/responsive.d.ts +55 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scale.d.ts +0 -17
- package/dist/internal/scale.js +1 -1
- package/dist/internal/step.d.ts +86 -0
- package/dist/internal/step.js +1 -0
- package/dist/internal/table.d.ts +53 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/text.d.ts +57 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/time-scale.d.ts +44 -0
- package/dist/internal/time-scale.js +1 -0
- package/dist/internal/transition.d.ts +33 -0
- package/dist/internal/transition.js +1 -0
- package/dist/internal/visibility.d.ts +48 -0
- package/dist/internal/visibility.js +1 -0
- package/dist/internal/window-class.d.ts +48 -0
- package/dist/internal/window-class.js +2 -0
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles/accordion.css +1 -1
- package/dist/styles/alert.css +1 -1
- package/dist/styles/anchor.css +2 -0
- package/dist/styles/animate-appear.css +1 -1
- package/dist/styles/animate-blink.css +1 -1
- package/dist/styles/animate-counter.css +2 -0
- package/dist/styles/animate-fade.css +1 -1
- package/dist/styles/animate-float.css +2 -0
- package/dist/styles/animate-grow.css +1 -1
- package/dist/styles/animate-headline.css +1 -1
- package/dist/styles/animate-lighting.css +1 -1
- package/dist/styles/animate-marquee.css +1 -1
- package/dist/styles/animate-reveal.css +2 -0
- package/dist/styles/animate-rotate.css +1 -1
- package/dist/styles/animate-scramble.css +2 -0
- package/dist/styles/animate-shake.css +2 -0
- package/dist/styles/animate-slide.css +1 -1
- package/dist/styles/animate-split.css +2 -0
- package/dist/styles/animate-typing.css +1 -1
- package/dist/styles/animate-zoom.css +1 -1
- package/dist/styles/app-logo.css +2 -0
- package/dist/styles/area-chart.css +2 -0
- package/dist/styles/aspect-ratio.css +1 -1
- package/dist/styles/avatar.css +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/bar-chart.css +2 -0
- package/dist/styles/blockquote.css +1 -1
- package/dist/styles/bottom-navigation.css +1 -1
- package/dist/styles/box.css +1 -1
- package/dist/styles/breadcrumb.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/calendar.css +2 -0
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/chat-bubble.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chip.css +1 -1
- package/dist/styles/code-block.css +2 -0
- package/dist/styles/collapsible.css +1 -1
- package/dist/styles/color-picker.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/config.css +2 -0
- package/dist/styles/confirm.css +2 -0
- package/dist/styles/container.css +1 -1
- package/dist/styles/data-list.css +2 -0
- package/dist/styles/data-table.css +2 -0
- package/dist/styles/date-picker.css +1 -1
- package/dist/styles/date-range-picker.css +1 -1
- package/dist/styles/date-time-picker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/empty.css +1 -1
- package/dist/styles/fieldset.css +1 -1
- package/dist/styles/file-picker.css +1 -1
- package/dist/styles/flex.css +2 -0
- package/dist/styles/floating-action-button.css +1 -1
- package/dist/styles/floating-bottom-navigation.css +2 -0
- package/dist/styles/footer.css +1 -1
- package/dist/styles/form.css +1 -1
- package/dist/styles/gauge-chart.css +2 -0
- package/dist/styles/grid.css +1 -1
- package/dist/styles/header.css +1 -1
- package/dist/styles/heatmap-chart.css +2 -0
- package/dist/styles/highlight.css +1 -1
- package/dist/styles/hover-card.css +2 -0
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/image.css +2 -0
- package/dist/styles/line-chart.css +2 -0
- package/dist/styles/list.css +1 -1
- package/dist/styles/locale.css +1 -1
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -1
- package/dist/styles/meter.css +2 -0
- package/dist/styles/mockup.css +2 -0
- package/dist/styles/navigation-menu.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/otp-field.css +1 -1
- package/dist/styles/overlay.css +1 -1
- package/dist/styles/page-layout.css +1 -1
- package/dist/styles/pagination.css +1 -1
- package/dist/styles/panes.css +1 -1
- package/dist/styles/pie-chart.css +2 -0
- package/dist/styles/pill.css +1 -1
- package/dist/styles/popconfirm.css +2 -0
- package/dist/styles/popover.css +1 -1
- package/dist/styles/portal.css +2 -0
- package/dist/styles/progress-box.css +1 -1
- package/dist/styles/progress-circular.css +1 -1
- package/dist/styles/progress-linear.css +1 -1
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/rating.css +1 -1
- package/dist/styles/scatter-chart.css +2 -0
- package/dist/styles/scroll-area.css +2 -0
- package/dist/styles/scroll-zone.css +2 -0
- package/dist/styles/segmented-button.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/shortcut.css +1 -1
- package/dist/styles/show.css +2 -0
- package/dist/styles/sidebar.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/sparkline.css +2 -0
- package/dist/styles/spoiler.css +1 -1
- package/dist/styles/stack.css +2 -0
- package/dist/styles/statistic.css +2 -0
- package/dist/styles/stepper.css +2 -0
- package/dist/styles/switch.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text-link.css +1 -1
- package/dist/styles/time-picker.css +1 -1
- package/dist/styles/timeline-chart.css +2 -0
- package/dist/styles/timeline.css +1 -1
- package/dist/styles/toggle.css +1 -1
- package/dist/styles/tokens.css +1 -1
- package/dist/styles/toolbar.css +2 -0
- package/dist/styles/tour.css +2 -0
- package/dist/styles/transfer.css +1 -1
- package/dist/styles/tree-select.css +2 -0
- package/dist/styles/tree-view.css +2 -0
- package/dist/styles/typography.css +1 -1
- package/dist/styles/visually-hidden.css +2 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1423 -114
- package/dist/types.d.ts +628 -3
- package/package.json +8 -2
- package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
- package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/internal/avatar-group.d.ts +0 -22
- package/dist/internal/avatar-group.js +0 -2
- package/dist/styles/avatar-group.css +0 -2
package/dist/tailwind.css
CHANGED
|
@@ -128,7 +128,27 @@
|
|
|
128
128
|
* `outline`, and a focus ring then reads as no change at all.
|
|
129
129
|
*/
|
|
130
130
|
--mp-source-color: #00639b;
|
|
131
|
+
}
|
|
131
132
|
|
|
133
|
+
/*
|
|
134
|
+
* The light scheme's own tone stops, on `:root` and on anything that asks for
|
|
135
|
+
* light by name.
|
|
136
|
+
*
|
|
137
|
+
* The second selector is what makes forcing light **scoped** work. The dark
|
|
138
|
+
* block below applies to any element carrying the attribute, so a dark region
|
|
139
|
+
* inside a light page has always been one attribute; the reverse was not, and
|
|
140
|
+
* the documentation said it was. Under a system preference of dark, a
|
|
141
|
+
* `[data-mp-scheme='light']` on a section matched no rule at all — the media
|
|
142
|
+
* query had already retuned `:root`, the section inherited it, and nothing
|
|
143
|
+
* put the light stops back. It came out dark.
|
|
144
|
+
*
|
|
145
|
+
* `--mp-source-color` stays on `:root` alone and above this, deliberately.
|
|
146
|
+
* Repeating it here would freeze it: a consumer scoping a different source
|
|
147
|
+
* colour to a section would find this rule overriding theirs on any element
|
|
148
|
+
* that also asked for light.
|
|
149
|
+
*/
|
|
150
|
+
:root,
|
|
151
|
+
[data-mp-scheme='light'] {
|
|
132
152
|
/*
|
|
133
153
|
* Tone stops.
|
|
134
154
|
*
|
|
@@ -242,6 +262,59 @@
|
|
|
242
262
|
--_mp-chroma-error: 0.1783;
|
|
243
263
|
--_mp-hue-error: 28.7;
|
|
244
264
|
|
|
265
|
+
/*
|
|
266
|
+
* The chart ramp's lightness, one stop per slot.
|
|
267
|
+
*
|
|
268
|
+
* Eight slots, and the *only* thing that changes between the two schemes is
|
|
269
|
+
* this list: the hues are the same eight in both, because a series that
|
|
270
|
+
* changed hue when the page went dark would be a series a reader has to
|
|
271
|
+
* learn twice.
|
|
272
|
+
*
|
|
273
|
+
* These are not the accent tones. A chart's job for colour is identity —
|
|
274
|
+
* telling one series from another — and MD3's accent stops are tuned for
|
|
275
|
+
* legibility of a *label on a fill*, which is a different question. Every
|
|
276
|
+
* number here was fitted rather than chosen: see the derivations below.
|
|
277
|
+
*/
|
|
278
|
+
--_mp-tone-chart-1: 0.56;
|
|
279
|
+
--_mp-tone-chart-2: 0.44;
|
|
280
|
+
--_mp-tone-chart-3: 0.62;
|
|
281
|
+
--_mp-tone-chart-4: 0.44;
|
|
282
|
+
--_mp-tone-chart-5: 0.62;
|
|
283
|
+
--_mp-tone-chart-6: 0.44;
|
|
284
|
+
--_mp-tone-chart-7: 0.62;
|
|
285
|
+
--_mp-tone-chart-8: 0.5;
|
|
286
|
+
|
|
287
|
+
/*
|
|
288
|
+
* The sequential ramp, for a magnitude rather than an identity.
|
|
289
|
+
*
|
|
290
|
+
* One hue and five steps, because that is what a *quantity* wants. The eight
|
|
291
|
+
* slots above are an identity channel, and reading them as an order is the
|
|
292
|
+
* mistake this exists to prevent: nobody can say whether slot 6 is more than
|
|
293
|
+
* slot 3.
|
|
294
|
+
*
|
|
295
|
+
* The step nearest the surface decides where the ramp starts. It has to
|
|
296
|
+
* clear 2:1 against the page or the lowest cell of a heatmap is a hole
|
|
297
|
+
* rather than a reading, and that floor is what put the light end at 0.755
|
|
298
|
+
* rather than somewhere paler. The four checks are monotone lightness,
|
|
299
|
+
* adjacent steps at least 0.06 apart, that contrast, and one hue throughout;
|
|
300
|
+
* both schemes pass all four.
|
|
301
|
+
*
|
|
302
|
+
* The scheme flips the anchor rather than the hue. On a light page the ramp
|
|
303
|
+
* runs pale to deep and on a dark one deep to bright, because "more" is
|
|
304
|
+
* further from the page in both — a ramp that ran the same way in the dark
|
|
305
|
+
* would put its high end where the eye reads nothing.
|
|
306
|
+
*/
|
|
307
|
+
--_mp-tone-chart-scale-1: 0.755;
|
|
308
|
+
--_mp-tone-chart-scale-2: 0.68;
|
|
309
|
+
--_mp-tone-chart-scale-3: 0.605;
|
|
310
|
+
--_mp-tone-chart-scale-4: 0.53;
|
|
311
|
+
--_mp-tone-chart-scale-5: 0.45;
|
|
312
|
+
--_mp-chroma-chart-scale-1: 0.06;
|
|
313
|
+
--_mp-chroma-chart-scale-2: 0.085;
|
|
314
|
+
--_mp-chroma-chart-scale-3: 0.11;
|
|
315
|
+
--_mp-chroma-chart-scale-4: 0.13;
|
|
316
|
+
--_mp-chroma-chart-scale-5: 0.15;
|
|
317
|
+
|
|
245
318
|
/*
|
|
246
319
|
* The chroma a whole palette carries, as opposed to the chroma one role of it
|
|
247
320
|
* came out at. Deliberately *not* reassigned for the dark scheme below, and
|
|
@@ -313,6 +386,32 @@
|
|
|
313
386
|
--_mp-tone-error: 0.834;
|
|
314
387
|
--_mp-chroma-error: 0.0677;
|
|
315
388
|
--_mp-hue-error: 22;
|
|
389
|
+
|
|
390
|
+
/* The chart ramp again — see the light block. The hues do not move; only
|
|
391
|
+
these do, because a dark surface needs the marks lighter to clear 3:1. */
|
|
392
|
+
--_mp-tone-chart-1: 0.56;
|
|
393
|
+
--_mp-tone-chart-2: 0.6;
|
|
394
|
+
--_mp-tone-chart-3: 0.64;
|
|
395
|
+
--_mp-tone-chart-4: 0.64;
|
|
396
|
+
--_mp-tone-chart-5: 0.56;
|
|
397
|
+
--_mp-tone-chart-6: 0.64;
|
|
398
|
+
--_mp-tone-chart-7: 0.64;
|
|
399
|
+
--_mp-tone-chart-8: 0.64;
|
|
400
|
+
|
|
401
|
+
/* The anchor flips: deep to bright, so "more" is still further from the
|
|
402
|
+
page. The low end sits at 0.405 for the same 2:1 reason the light one
|
|
403
|
+
sits at 0.755, measured against this scheme's surface rather than the
|
|
404
|
+
other's. */
|
|
405
|
+
--_mp-tone-chart-scale-1: 0.405;
|
|
406
|
+
--_mp-tone-chart-scale-2: 0.49;
|
|
407
|
+
--_mp-tone-chart-scale-3: 0.575;
|
|
408
|
+
--_mp-tone-chart-scale-4: 0.66;
|
|
409
|
+
--_mp-tone-chart-scale-5: 0.745;
|
|
410
|
+
--_mp-chroma-chart-scale-1: 0.06;
|
|
411
|
+
--_mp-chroma-chart-scale-2: 0.09;
|
|
412
|
+
--_mp-chroma-chart-scale-3: 0.115;
|
|
413
|
+
--_mp-chroma-chart-scale-4: 0.135;
|
|
414
|
+
--_mp-chroma-chart-scale-5: 0.15;
|
|
316
415
|
}
|
|
317
416
|
}
|
|
318
417
|
|
|
@@ -353,6 +452,28 @@
|
|
|
353
452
|
--_mp-tone-error: 0.834;
|
|
354
453
|
--_mp-chroma-error: 0.0677;
|
|
355
454
|
--_mp-hue-error: 22;
|
|
455
|
+
|
|
456
|
+
/* The chart ramp again — see the light block. */
|
|
457
|
+
--_mp-tone-chart-1: 0.56;
|
|
458
|
+
--_mp-tone-chart-2: 0.6;
|
|
459
|
+
--_mp-tone-chart-3: 0.64;
|
|
460
|
+
--_mp-tone-chart-4: 0.64;
|
|
461
|
+
--_mp-tone-chart-5: 0.56;
|
|
462
|
+
--_mp-tone-chart-6: 0.64;
|
|
463
|
+
--_mp-tone-chart-7: 0.64;
|
|
464
|
+
--_mp-tone-chart-8: 0.64;
|
|
465
|
+
|
|
466
|
+
/* The dark scheme's ramp again, for a region forced dark. */
|
|
467
|
+
--_mp-tone-chart-scale-1: 0.405;
|
|
468
|
+
--_mp-tone-chart-scale-2: 0.49;
|
|
469
|
+
--_mp-tone-chart-scale-3: 0.575;
|
|
470
|
+
--_mp-tone-chart-scale-4: 0.66;
|
|
471
|
+
--_mp-tone-chart-scale-5: 0.745;
|
|
472
|
+
--_mp-chroma-chart-scale-1: 0.06;
|
|
473
|
+
--_mp-chroma-chart-scale-2: 0.09;
|
|
474
|
+
--_mp-chroma-chart-scale-3: 0.115;
|
|
475
|
+
--_mp-chroma-chart-scale-4: 0.135;
|
|
476
|
+
--_mp-chroma-chart-scale-5: 0.15;
|
|
356
477
|
}
|
|
357
478
|
|
|
358
479
|
/*
|
|
@@ -636,6 +757,85 @@
|
|
|
636
757
|
*/
|
|
637
758
|
--_mp-color-scrim: var(--mp-sys-color-scrim, var(--md-sys-color-scrim, #000000));
|
|
638
759
|
|
|
760
|
+
/*
|
|
761
|
+
* The chart ramp: eight slots a series is handed in order.
|
|
762
|
+
*
|
|
763
|
+
* ## Why these are not derived from the source colour
|
|
764
|
+
*
|
|
765
|
+
* They were, first. Rotating eight hues off `--mp-source-color` is the
|
|
766
|
+
* obvious answer — it themes for free and it is one line per slot — and it
|
|
767
|
+
* does not survive being measured. Colour-vision deficiency collapses the
|
|
768
|
+
* red-green axis at *absolute* hues, so a ramp whose adjacent pairs are
|
|
769
|
+
* clear of that axis puts a different pair straight onto it the moment the
|
|
770
|
+
* whole thing is rotated. Fitted to the default seed and then re-checked
|
|
771
|
+
* against five others, the rotated ramp failed the protan/deutan separation
|
|
772
|
+
* for four of the five.
|
|
773
|
+
*
|
|
774
|
+
* So the hues are fixed and only the lightness follows the scheme. Slot one
|
|
775
|
+
* happens to be the default seed's own blue, which is why an untouched theme
|
|
776
|
+
* looks of a piece; that is where the resemblance ends, and it is on purpose.
|
|
777
|
+
* A series colour is an identity code rather than brand — nothing here is
|
|
778
|
+
* ever the background of a label, and `--_mp-color-on-surface` is what the
|
|
779
|
+
* text beside a mark wears.
|
|
780
|
+
*
|
|
781
|
+
* ## What "fitted" means
|
|
782
|
+
*
|
|
783
|
+
* Eight hues at least 30° apart, a chroma of 0.15 (browser-clamped per hue
|
|
784
|
+
* to whatever sRGB has), and a lightness per slot per scheme, searched until
|
|
785
|
+
* every one of these holds in both schemes:
|
|
786
|
+
*
|
|
787
|
+
* - lightness inside the readable band, chroma at or above 0.10, so a slot
|
|
788
|
+
* never reads as grey;
|
|
789
|
+
* - every **adjacent** pair at ΔE 8 or better under protanopia and
|
|
790
|
+
* deuteranopia — the fit clears 16.2 light and 13.7 dark;
|
|
791
|
+
* - every adjacent pair at ΔE 15 or better under ordinary vision, so the
|
|
792
|
+
* ones a reader compares most are the easiest to tell apart — 26.5 and
|
|
793
|
+
* 20.6;
|
|
794
|
+
* - and 3:1 against the surface for all eight in both schemes.
|
|
795
|
+
*
|
|
796
|
+
* **Three is the cap where any two marks can touch** — a scatter, a bubble
|
|
797
|
+
* chart, a heatmap. Eight slots are pairwise-separable only to the third,
|
|
798
|
+
* and no ordering of eight can do better; that is a property of the colour
|
|
799
|
+
* space rather than of this palette. Past three, fold the tail into one
|
|
800
|
+
* "other" series or draw a second chart.
|
|
801
|
+
*
|
|
802
|
+
* A consumer overrides one with `--mp-chart-3`, exactly as they would a
|
|
803
|
+
* colour role — and owns the checks for it from that point.
|
|
804
|
+
*/
|
|
805
|
+
--_mp-chart-1: var(--mp-chart-1, oklch(var(--_mp-tone-chart-1) 0.15 245));
|
|
806
|
+
--_mp-chart-2: var(--mp-chart-2, oklch(var(--_mp-tone-chart-2) 0.15 55));
|
|
807
|
+
--_mp-chart-3: var(--mp-chart-3, oklch(var(--_mp-tone-chart-3) 0.15 180));
|
|
808
|
+
--_mp-chart-4: var(--mp-chart-4, oklch(var(--_mp-tone-chart-4) 0.15 280));
|
|
809
|
+
--_mp-chart-5: var(--mp-chart-5, oklch(var(--_mp-tone-chart-5) 0.15 0));
|
|
810
|
+
--_mp-chart-6: var(--mp-chart-6, oklch(var(--_mp-tone-chart-6) 0.15 120));
|
|
811
|
+
--_mp-chart-7: var(--mp-chart-7, oklch(var(--_mp-tone-chart-7) 0.15 315));
|
|
812
|
+
--_mp-chart-8: var(--mp-chart-8, oklch(var(--_mp-tone-chart-8) 0.15 150));
|
|
813
|
+
|
|
814
|
+
/* The sequential ramp, on slot one's hue so a chart using both reads as one
|
|
815
|
+
family. Each step takes its own chroma as well as its own lightness: a
|
|
816
|
+
ramp at one chroma throughout goes grey at the pale end and muddy at the
|
|
817
|
+
deep one. */
|
|
818
|
+
--_mp-chart-scale-1: var(
|
|
819
|
+
--mp-chart-scale-1,
|
|
820
|
+
oklch(var(--_mp-tone-chart-scale-1) var(--_mp-chroma-chart-scale-1) 245)
|
|
821
|
+
);
|
|
822
|
+
--_mp-chart-scale-2: var(
|
|
823
|
+
--mp-chart-scale-2,
|
|
824
|
+
oklch(var(--_mp-tone-chart-scale-2) var(--_mp-chroma-chart-scale-2) 245)
|
|
825
|
+
);
|
|
826
|
+
--_mp-chart-scale-3: var(
|
|
827
|
+
--mp-chart-scale-3,
|
|
828
|
+
oklch(var(--_mp-tone-chart-scale-3) var(--_mp-chroma-chart-scale-3) 245)
|
|
829
|
+
);
|
|
830
|
+
--_mp-chart-scale-4: var(
|
|
831
|
+
--mp-chart-scale-4,
|
|
832
|
+
oklch(var(--_mp-tone-chart-scale-4) var(--_mp-chroma-chart-scale-4) 245)
|
|
833
|
+
);
|
|
834
|
+
--_mp-chart-scale-5: var(
|
|
835
|
+
--mp-chart-scale-5,
|
|
836
|
+
oklch(var(--_mp-tone-chart-scale-5) var(--_mp-chroma-chart-scale-5) 245)
|
|
837
|
+
);
|
|
838
|
+
|
|
639
839
|
/* Not derived from the source colour. MD3's error palette is a fixed red
|
|
640
840
|
regardless of the seed — an error that shifted hue with the brand would
|
|
641
841
|
stop reading as an error. It still tracks the scheme, so it belongs here
|
|
@@ -792,6 +992,8 @@
|
|
|
792
992
|
--shadow-mp-1: var(--mp-sys-elevation-level1);
|
|
793
993
|
--shadow-mp-2: var(--mp-sys-elevation-level2);
|
|
794
994
|
--shadow-mp-3: var(--mp-sys-elevation-level3);
|
|
995
|
+
--shadow-mp-4: var(--mp-sys-elevation-level4);
|
|
996
|
+
--shadow-mp-5: var(--mp-sys-elevation-level5);
|
|
795
997
|
|
|
796
998
|
--ease-mp-standard: var(--mp-sys-motion-easing-standard);
|
|
797
999
|
}
|
|
@@ -942,18 +1144,26 @@
|
|
|
942
1144
|
--mp-sys-shape-corner-full: 9999px;
|
|
943
1145
|
|
|
944
1146
|
/*
|
|
945
|
-
* Elevation.
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
1147
|
+
* Elevation. MD3's five raised levels, all of them, because `elevation` is a
|
|
1148
|
+
* prop now and a caller who can name a level has to find it defined — a
|
|
1149
|
+
* ladder with holes in it is worse than no ladder. The first three are what
|
|
1150
|
+
* the components themselves read: an elevated button rests at 1 and rises to
|
|
1151
|
+
* 2 under the pointer, a menu floats at 2, and a dialog — which has taken
|
|
1152
|
+
* the page rather than merely covered part of it — sits at 3.
|
|
949
1153
|
*
|
|
950
|
-
*
|
|
951
|
-
*
|
|
952
|
-
*
|
|
1154
|
+
* Level 0 has no token because it is not a shadow. It is the absence of one,
|
|
1155
|
+
* which CSS already spells `none`.
|
|
1156
|
+
*
|
|
1157
|
+
* Every one is the spec's own two-shadow recipe — a tight key shadow plus a
|
|
1158
|
+
* wider ambient one — rather than one blurred box shadow. The pair is what
|
|
1159
|
+
* makes a raised surface read as lit from above instead of as a sticker with
|
|
1160
|
+
* a halo.
|
|
953
1161
|
*/
|
|
954
1162
|
--mp-sys-elevation-level1: 0 1px 2px 0 rgb(0 0 0 / 0.3), 0 1px 3px 1px rgb(0 0 0 / 0.15);
|
|
955
1163
|
--mp-sys-elevation-level2: 0 1px 2px 0 rgb(0 0 0 / 0.3), 0 2px 6px 2px rgb(0 0 0 / 0.15);
|
|
956
1164
|
--mp-sys-elevation-level3: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 4px 8px 3px rgb(0 0 0 / 0.15);
|
|
1165
|
+
--mp-sys-elevation-level4: 0 2px 3px 0 rgb(0 0 0 / 0.3), 0 6px 10px 4px rgb(0 0 0 / 0.15);
|
|
1166
|
+
--mp-sys-elevation-level5: 0 4px 4px 0 rgb(0 0 0 / 0.3), 0 8px 12px 6px rgb(0 0 0 / 0.15);
|
|
957
1167
|
|
|
958
1168
|
/*
|
|
959
1169
|
* Motion.
|
|
@@ -1176,10 +1386,66 @@
|
|
|
1176
1386
|
--shadow-mp-1: var(--mp-sys-elevation-level1);
|
|
1177
1387
|
--shadow-mp-2: var(--mp-sys-elevation-level2);
|
|
1178
1388
|
--shadow-mp-3: var(--mp-sys-elevation-level3);
|
|
1389
|
+
--shadow-mp-4: var(--mp-sys-elevation-level4);
|
|
1390
|
+
--shadow-mp-5: var(--mp-sys-elevation-level5);
|
|
1179
1391
|
|
|
1180
1392
|
--ease-mp-standard: var(--mp-sys-motion-easing-standard);
|
|
1181
1393
|
}
|
|
1182
1394
|
|
|
1395
|
+
/* ---------------------------------------------------------------------------
|
|
1396
|
+
* The window size classes
|
|
1397
|
+
*
|
|
1398
|
+
* Material's five, as variants: `@variant mp-medium` is what every width-driven
|
|
1399
|
+
* rule in this file is written against, and `mp-medium:flex` is the same
|
|
1400
|
+
* boundary for a consumer's own utilities — which until now was a block of CSS
|
|
1401
|
+
* in the grid's documentation for a reader to copy into their own `@theme`.
|
|
1402
|
+
*
|
|
1403
|
+
* `compact` has no variant because its floor is nought. There is no window
|
|
1404
|
+
* narrower than no window, and `mp-below-compact` could never match at all.
|
|
1405
|
+
*
|
|
1406
|
+
* ## Why not `--breakpoint-mp-*` in `@theme`
|
|
1407
|
+
*
|
|
1408
|
+
* Because that namespace is not only a variant. Tailwind's own `.container`
|
|
1409
|
+
* utility is generated from every registered breakpoint, so four names there
|
|
1410
|
+
* would quietly add four `max-width` steps to a class the consumer wrote and
|
|
1411
|
+
* this library has nothing to do with — the same collision the `@theme` block
|
|
1412
|
+
* above prefixes every one of its names to avoid, arriving through a namespace
|
|
1413
|
+
* a prefix does not protect.
|
|
1414
|
+
*
|
|
1415
|
+
* A custom variant registers exactly one thing: the variant.
|
|
1416
|
+
*
|
|
1417
|
+
* ## Moving them
|
|
1418
|
+
*
|
|
1419
|
+
* A project that runs Tailwind itself can, by declaring the same name again
|
|
1420
|
+
* after importing this file — the later definition wins:
|
|
1421
|
+
*
|
|
1422
|
+
* @custom-variant mp-medium (@media (width >= 700px));
|
|
1423
|
+
* @custom-variant mp-below-medium (@media (width < 700px));
|
|
1424
|
+
*
|
|
1425
|
+
* Both halves, because the two are separate registrations rather than one
|
|
1426
|
+
* boundary Tailwind derives a pair from. That moves the grid, the measures and
|
|
1427
|
+
* the visibility rules together, and the application's own `mp-medium:` with
|
|
1428
|
+
* them. A project on the compiled `styles.css` cannot: that file is Tailwind's
|
|
1429
|
+
* output and the queries in it are already numbers.
|
|
1430
|
+
*
|
|
1431
|
+
* The JavaScript half of the same ladder is `WINDOW_MIN` in
|
|
1432
|
+
* `src/internal/window-class.ts`, and the two have to agree — a hook that says
|
|
1433
|
+
* `compact` where the stylesheet is laying out `medium` is a page arguing with
|
|
1434
|
+
* itself. `test/styles/breakpoints.test.tsx` reads both and fails if they ever
|
|
1435
|
+
* stop matching, and `MPConfigProvider`'s `breakpoints` is how an application
|
|
1436
|
+
* that moved one here tells the JavaScript side.
|
|
1437
|
+
* ------------------------------------------------------------------------- */
|
|
1438
|
+
|
|
1439
|
+
@custom-variant mp-medium (@media (width >= 600px));
|
|
1440
|
+
@custom-variant mp-expanded (@media (width >= 840px));
|
|
1441
|
+
@custom-variant mp-large (@media (width >= 1200px));
|
|
1442
|
+
@custom-variant mp-extra-large (@media (width >= 1600px));
|
|
1443
|
+
|
|
1444
|
+
@custom-variant mp-below-medium (@media (width < 600px));
|
|
1445
|
+
@custom-variant mp-below-expanded (@media (width < 840px));
|
|
1446
|
+
@custom-variant mp-below-large (@media (width < 1200px));
|
|
1447
|
+
@custom-variant mp-below-extra-large (@media (width < 1600px));
|
|
1448
|
+
|
|
1183
1449
|
/* ---------------------------------------------------------------------------
|
|
1184
1450
|
* The layout grid
|
|
1185
1451
|
*
|
|
@@ -1194,14 +1460,40 @@
|
|
|
1194
1460
|
* `min(span, columns)` is the clamp: `span={99}` fills its row instead of
|
|
1195
1461
|
* running off the page, which is what the caller meant.
|
|
1196
1462
|
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1463
|
+
* `span="grow"` is the one width that is not this arithmetic. It is the row's
|
|
1464
|
+
* remainder, which nothing here can compute — only the flex algorithm knows what
|
|
1465
|
+
* is left after the other items have been laid out — so a growing item is given
|
|
1466
|
+
* a width of nought and a `flex-grow` of one, and takes the rest.
|
|
1467
|
+
*
|
|
1468
|
+
* ## The rungs
|
|
1469
|
+
*
|
|
1470
|
+
* A responsive prop writes only the classes the caller named — `span={{ expanded: 6 }}`
|
|
1471
|
+
* is one custom property and not five — which keeps the inline style on a grid
|
|
1472
|
+
* item down to what was asked for, and leaves the stylesheet to fill the gaps.
|
|
1473
|
+
* Every class therefore has to fall back through every class below it.
|
|
1474
|
+
*
|
|
1475
|
+
* Written as one `var()` chain per class that is five levels deep by
|
|
1476
|
+
* `extra-large` and repeated in full in every media block, which is a shape with
|
|
1477
|
+
* two problems: the reader cannot check it, and inserting a class means
|
|
1478
|
+
* rewriting every chain in the file.
|
|
1479
|
+
*
|
|
1480
|
+
* So the fallback is a **ladder**. `--_mp-cols-0` is what the compact slot says,
|
|
1481
|
+
* `--_mp-cols-1` is the medium slot *or the rung below it*, and a media query
|
|
1482
|
+
* moves exactly one rung. The index is the class's place in `WINDOW_CLASSES` —
|
|
1483
|
+
* `src/internal/window-class.ts` — so `-0` is compact and `-3` is large; the top
|
|
1484
|
+
* rung is `extra-large` and takes the plain name, because that is the one the
|
|
1485
|
+
* arithmetic reads and a fifth alias would be a rung to nowhere.
|
|
1486
|
+
*
|
|
1487
|
+
* Every fallback is then one level deep however high the ladder goes, and adding
|
|
1488
|
+
* a responsive prop anywhere in the library is this same shape again rather than
|
|
1489
|
+
* five chains of five.
|
|
1490
|
+
*
|
|
1491
|
+
* ## The widths
|
|
1202
1492
|
*
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1493
|
+
* `@variant mp-medium` rather than `@media (width >= 600px)`, so the four
|
|
1494
|
+
* boundaries are read from the `@theme` block above rather than written out here
|
|
1495
|
+
* a second time — and a project that runs Tailwind can move them. See the note
|
|
1496
|
+
* on the breakpoints for what that does and does not reach.
|
|
1205
1497
|
*
|
|
1206
1498
|
* Unlayered, like the two animation classes below and for the same reason: a
|
|
1207
1499
|
* layered rule loses to every unlayered one, and a consumer's own page styling
|
|
@@ -1209,136 +1501,379 @@
|
|
|
1209
1501
|
* an application's stylesheet is not a grid.
|
|
1210
1502
|
* ------------------------------------------------------------------------- */
|
|
1211
1503
|
|
|
1504
|
+
/*
|
|
1505
|
+
* The flex container's five axes, each of them resolved per window size class.
|
|
1506
|
+
*
|
|
1507
|
+
* The same four-step fallback the grid's slots use, and for the same reason: a
|
|
1508
|
+
* responsive prop writes only the classes a caller named, so each step falls
|
|
1509
|
+
* back to the one below it and the whole ladder falls back to the property's own
|
|
1510
|
+
* default. `direction={{ compact: 'column', medium: 'row' }}` is two slots, and
|
|
1511
|
+
* a window crossing 600dp changes the layout with nothing re-rendering.
|
|
1512
|
+
*
|
|
1513
|
+
* The `initial` block is the boundary a nested flex needs, exactly as a nested
|
|
1514
|
+
* grid does: these are inline custom properties and a custom property inherits,
|
|
1515
|
+
* so an inner flex that only declared `--_mp-flex-dir-compact` would otherwise
|
|
1516
|
+
* resolve its parent's `--_mp-flex-dir-large` at every class above compact — a
|
|
1517
|
+
* row that is told `row` and comes out a column on a laptop.
|
|
1518
|
+
*/
|
|
1519
|
+
.mp-flex {
|
|
1520
|
+
--_mp-flex-dir-0: var(--_mp-flex-dir-compact, row);
|
|
1521
|
+
--_mp-flex-dir-1: var(--_mp-flex-dir-0);
|
|
1522
|
+
--_mp-flex-dir-2: var(--_mp-flex-dir-1);
|
|
1523
|
+
--_mp-flex-dir-3: var(--_mp-flex-dir-2);
|
|
1524
|
+
--_mp-flex-dir: var(--_mp-flex-dir-3);
|
|
1525
|
+
|
|
1526
|
+
--_mp-flex-wrap-0: var(--_mp-flex-wrap-compact, nowrap);
|
|
1527
|
+
--_mp-flex-wrap-1: var(--_mp-flex-wrap-0);
|
|
1528
|
+
--_mp-flex-wrap-2: var(--_mp-flex-wrap-1);
|
|
1529
|
+
--_mp-flex-wrap-3: var(--_mp-flex-wrap-2);
|
|
1530
|
+
--_mp-flex-wrap: var(--_mp-flex-wrap-3);
|
|
1531
|
+
|
|
1532
|
+
--_mp-flex-justify-0: var(--_mp-flex-justify-compact, flex-start);
|
|
1533
|
+
--_mp-flex-justify-1: var(--_mp-flex-justify-0);
|
|
1534
|
+
--_mp-flex-justify-2: var(--_mp-flex-justify-1);
|
|
1535
|
+
--_mp-flex-justify-3: var(--_mp-flex-justify-2);
|
|
1536
|
+
--_mp-flex-justify: var(--_mp-flex-justify-3);
|
|
1537
|
+
|
|
1538
|
+
--_mp-flex-align-0: var(--_mp-flex-align-compact, stretch);
|
|
1539
|
+
--_mp-flex-align-1: var(--_mp-flex-align-0);
|
|
1540
|
+
--_mp-flex-align-2: var(--_mp-flex-align-1);
|
|
1541
|
+
--_mp-flex-align-3: var(--_mp-flex-align-2);
|
|
1542
|
+
--_mp-flex-align: var(--_mp-flex-align-3);
|
|
1543
|
+
|
|
1544
|
+
--_mp-flex-gap-0: var(--_mp-flex-gap-compact, 0px);
|
|
1545
|
+
--_mp-flex-gap-1: var(--_mp-flex-gap-0);
|
|
1546
|
+
--_mp-flex-gap-2: var(--_mp-flex-gap-1);
|
|
1547
|
+
--_mp-flex-gap-3: var(--_mp-flex-gap-2);
|
|
1548
|
+
--_mp-flex-gap: var(--_mp-flex-gap-3);
|
|
1549
|
+
|
|
1550
|
+
--_mp-flex-dir-compact: initial;
|
|
1551
|
+
--_mp-flex-dir-medium: initial;
|
|
1552
|
+
--_mp-flex-dir-expanded: initial;
|
|
1553
|
+
--_mp-flex-dir-large: initial;
|
|
1554
|
+
--_mp-flex-dir-extra-large: initial;
|
|
1555
|
+
--_mp-flex-wrap-compact: initial;
|
|
1556
|
+
--_mp-flex-wrap-medium: initial;
|
|
1557
|
+
--_mp-flex-wrap-expanded: initial;
|
|
1558
|
+
--_mp-flex-wrap-large: initial;
|
|
1559
|
+
--_mp-flex-wrap-extra-large: initial;
|
|
1560
|
+
--_mp-flex-justify-compact: initial;
|
|
1561
|
+
--_mp-flex-justify-medium: initial;
|
|
1562
|
+
--_mp-flex-justify-expanded: initial;
|
|
1563
|
+
--_mp-flex-justify-large: initial;
|
|
1564
|
+
--_mp-flex-justify-extra-large: initial;
|
|
1565
|
+
--_mp-flex-align-compact: initial;
|
|
1566
|
+
--_mp-flex-align-medium: initial;
|
|
1567
|
+
--_mp-flex-align-expanded: initial;
|
|
1568
|
+
--_mp-flex-align-large: initial;
|
|
1569
|
+
--_mp-flex-align-extra-large: initial;
|
|
1570
|
+
--_mp-flex-gap-compact: initial;
|
|
1571
|
+
--_mp-flex-gap-medium: initial;
|
|
1572
|
+
--_mp-flex-gap-expanded: initial;
|
|
1573
|
+
--_mp-flex-gap-large: initial;
|
|
1574
|
+
--_mp-flex-gap-extra-large: initial;
|
|
1575
|
+
|
|
1576
|
+
flex-direction: var(--_mp-flex-dir);
|
|
1577
|
+
flex-wrap: var(--_mp-flex-wrap);
|
|
1578
|
+
justify-content: var(--_mp-flex-justify);
|
|
1579
|
+
align-items: var(--_mp-flex-align);
|
|
1580
|
+
gap: var(--_mp-flex-gap);
|
|
1581
|
+
|
|
1582
|
+
@variant mp-medium {
|
|
1583
|
+
--_mp-flex-dir-1: var(--_mp-flex-dir-medium, var(--_mp-flex-dir-0));
|
|
1584
|
+
--_mp-flex-wrap-1: var(--_mp-flex-wrap-medium, var(--_mp-flex-wrap-0));
|
|
1585
|
+
--_mp-flex-justify-1: var(--_mp-flex-justify-medium, var(--_mp-flex-justify-0));
|
|
1586
|
+
--_mp-flex-align-1: var(--_mp-flex-align-medium, var(--_mp-flex-align-0));
|
|
1587
|
+
--_mp-flex-gap-1: var(--_mp-flex-gap-medium, var(--_mp-flex-gap-0));
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
@variant mp-expanded {
|
|
1591
|
+
--_mp-flex-dir-2: var(--_mp-flex-dir-expanded, var(--_mp-flex-dir-1));
|
|
1592
|
+
--_mp-flex-wrap-2: var(--_mp-flex-wrap-expanded, var(--_mp-flex-wrap-1));
|
|
1593
|
+
--_mp-flex-justify-2: var(--_mp-flex-justify-expanded, var(--_mp-flex-justify-1));
|
|
1594
|
+
--_mp-flex-align-2: var(--_mp-flex-align-expanded, var(--_mp-flex-align-1));
|
|
1595
|
+
--_mp-flex-gap-2: var(--_mp-flex-gap-expanded, var(--_mp-flex-gap-1));
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
@variant mp-large {
|
|
1599
|
+
--_mp-flex-dir-3: var(--_mp-flex-dir-large, var(--_mp-flex-dir-2));
|
|
1600
|
+
--_mp-flex-wrap-3: var(--_mp-flex-wrap-large, var(--_mp-flex-wrap-2));
|
|
1601
|
+
--_mp-flex-justify-3: var(--_mp-flex-justify-large, var(--_mp-flex-justify-2));
|
|
1602
|
+
--_mp-flex-align-3: var(--_mp-flex-align-large, var(--_mp-flex-align-2));
|
|
1603
|
+
--_mp-flex-gap-3: var(--_mp-flex-gap-large, var(--_mp-flex-gap-2));
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
@variant mp-extra-large {
|
|
1607
|
+
--_mp-flex-dir: var(--_mp-flex-dir-extra-large, var(--_mp-flex-dir-3));
|
|
1608
|
+
--_mp-flex-wrap: var(--_mp-flex-wrap-extra-large, var(--_mp-flex-wrap-3));
|
|
1609
|
+
--_mp-flex-justify: var(--_mp-flex-justify-extra-large, var(--_mp-flex-justify-3));
|
|
1610
|
+
--_mp-flex-align: var(--_mp-flex-align-extra-large, var(--_mp-flex-align-3));
|
|
1611
|
+
--_mp-flex-gap: var(--_mp-flex-gap-extra-large, var(--_mp-flex-gap-3));
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1212
1615
|
.mp-grid {
|
|
1213
|
-
--_mp-cols: var(--_mp-cols-compact, 12);
|
|
1214
|
-
--_mp-
|
|
1215
|
-
--_mp-
|
|
1616
|
+
--_mp-cols-0: var(--_mp-cols-compact, 12);
|
|
1617
|
+
--_mp-cols-1: var(--_mp-cols-0);
|
|
1618
|
+
--_mp-cols-2: var(--_mp-cols-1);
|
|
1619
|
+
--_mp-cols-3: var(--_mp-cols-2);
|
|
1620
|
+
--_mp-cols: var(--_mp-cols-3);
|
|
1621
|
+
|
|
1622
|
+
--_mp-gap-x-0: var(--_mp-gap-x-compact, 0px);
|
|
1623
|
+
--_mp-gap-x-1: var(--_mp-gap-x-0);
|
|
1624
|
+
--_mp-gap-x-2: var(--_mp-gap-x-1);
|
|
1625
|
+
--_mp-gap-x-3: var(--_mp-gap-x-2);
|
|
1626
|
+
--_mp-gap-x: var(--_mp-gap-x-3);
|
|
1627
|
+
|
|
1628
|
+
--_mp-gap-y-0: var(--_mp-gap-y-compact, 0px);
|
|
1629
|
+
--_mp-gap-y-1: var(--_mp-gap-y-0);
|
|
1630
|
+
--_mp-gap-y-2: var(--_mp-gap-y-1);
|
|
1631
|
+
--_mp-gap-y-3: var(--_mp-gap-y-2);
|
|
1632
|
+
--_mp-gap-y: var(--_mp-gap-y-3);
|
|
1633
|
+
|
|
1634
|
+
/* The boundary, and the reason it has to exist.
|
|
1635
|
+
*
|
|
1636
|
+
* The slots are inline custom properties, and a custom property *inherits*. So
|
|
1637
|
+
* a grid nested inside an item — which is how nesting is spelled — sits inside
|
|
1638
|
+
* that item's `--_mp-span-large`, and an inner item that only declared
|
|
1639
|
+
* `--_mp-span-compact` resolves the outer one at every class above compact:
|
|
1640
|
+
* `span={12}` comes out a sixth of the row it is actually in, and the card
|
|
1641
|
+
* whose title it holds wraps a letter at a time.
|
|
1642
|
+
*
|
|
1643
|
+
* A grid is where a span stops meaning anything, so a grid is where the slots
|
|
1644
|
+
* are put back to nothing. `initial` on a custom property is the guaranteed-
|
|
1645
|
+
* invalid value, which is what makes the `var()` fallbacks above take over
|
|
1646
|
+
* rather than a number from two levels up. Thirty declarations, once per grid,
|
|
1647
|
+
* and the arithmetic under them is the same as it was.
|
|
1648
|
+
*
|
|
1649
|
+
* The grid's own three are here for the same reason the item's three are, and
|
|
1650
|
+
* were missing: a responsive prop writes only the classes the caller named, so
|
|
1651
|
+
* `columns={6}` on an inner grid is one slot — and an outer
|
|
1652
|
+
* `columns={{ compact: 4, medium: 12 }}` was still being resolved by the inner
|
|
1653
|
+
* grid at every class above compact. Six columns on a phone and twelve on a
|
|
1654
|
+
* laptop, from a grid that was told six.
|
|
1655
|
+
*
|
|
1656
|
+
* Written on `.mp-grid` rather than on `.mp-grid-item` because an item that
|
|
1657
|
+
* reset its own slots would be resetting the ones it had just been given. The
|
|
1658
|
+
* grid resetting its own is not the same thing: the value it goes on to use
|
|
1659
|
+
* arrives in the `style` attribute, which beats a class either way. */
|
|
1660
|
+
--_mp-cols-compact: initial;
|
|
1661
|
+
--_mp-cols-medium: initial;
|
|
1662
|
+
--_mp-cols-expanded: initial;
|
|
1663
|
+
--_mp-cols-large: initial;
|
|
1664
|
+
--_mp-cols-extra-large: initial;
|
|
1665
|
+
--_mp-gap-x-compact: initial;
|
|
1666
|
+
--_mp-gap-x-medium: initial;
|
|
1667
|
+
--_mp-gap-x-expanded: initial;
|
|
1668
|
+
--_mp-gap-x-large: initial;
|
|
1669
|
+
--_mp-gap-x-extra-large: initial;
|
|
1670
|
+
--_mp-gap-y-compact: initial;
|
|
1671
|
+
--_mp-gap-y-medium: initial;
|
|
1672
|
+
--_mp-gap-y-expanded: initial;
|
|
1673
|
+
--_mp-gap-y-large: initial;
|
|
1674
|
+
--_mp-gap-y-extra-large: initial;
|
|
1675
|
+
--_mp-span-compact: initial;
|
|
1676
|
+
--_mp-span-medium: initial;
|
|
1677
|
+
--_mp-span-expanded: initial;
|
|
1678
|
+
--_mp-span-large: initial;
|
|
1679
|
+
--_mp-span-extra-large: initial;
|
|
1680
|
+
--_mp-offset-compact: initial;
|
|
1681
|
+
--_mp-offset-medium: initial;
|
|
1682
|
+
--_mp-offset-expanded: initial;
|
|
1683
|
+
--_mp-offset-large: initial;
|
|
1684
|
+
--_mp-offset-extra-large: initial;
|
|
1685
|
+
--_mp-grow-compact: initial;
|
|
1686
|
+
--_mp-grow-medium: initial;
|
|
1687
|
+
--_mp-grow-expanded: initial;
|
|
1688
|
+
--_mp-grow-large: initial;
|
|
1689
|
+
--_mp-grow-extra-large: initial;
|
|
1690
|
+
|
|
1691
|
+
@variant mp-medium {
|
|
1692
|
+
--_mp-cols-1: var(--_mp-cols-medium, var(--_mp-cols-0));
|
|
1693
|
+
--_mp-gap-x-1: var(--_mp-gap-x-medium, var(--_mp-gap-x-0));
|
|
1694
|
+
--_mp-gap-y-1: var(--_mp-gap-y-medium, var(--_mp-gap-y-0));
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
@variant mp-expanded {
|
|
1698
|
+
--_mp-cols-2: var(--_mp-cols-expanded, var(--_mp-cols-1));
|
|
1699
|
+
--_mp-gap-x-2: var(--_mp-gap-x-expanded, var(--_mp-gap-x-1));
|
|
1700
|
+
--_mp-gap-y-2: var(--_mp-gap-y-expanded, var(--_mp-gap-y-1));
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
@variant mp-large {
|
|
1704
|
+
--_mp-cols-3: var(--_mp-cols-large, var(--_mp-cols-2));
|
|
1705
|
+
--_mp-gap-x-3: var(--_mp-gap-x-large, var(--_mp-gap-x-2));
|
|
1706
|
+
--_mp-gap-y-3: var(--_mp-gap-y-large, var(--_mp-gap-y-2));
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
@variant mp-extra-large {
|
|
1710
|
+
--_mp-cols: var(--_mp-cols-extra-large, var(--_mp-cols-3));
|
|
1711
|
+
--_mp-gap-x: var(--_mp-gap-x-extra-large, var(--_mp-gap-x-3));
|
|
1712
|
+
--_mp-gap-y: var(--_mp-gap-y-extra-large, var(--_mp-gap-y-3));
|
|
1713
|
+
}
|
|
1216
1714
|
}
|
|
1217
1715
|
|
|
1218
1716
|
.mp-grid-item {
|
|
1219
|
-
--_mp-span: var(--_mp-span-compact, var(--_mp-cols, 12));
|
|
1220
|
-
--_mp-
|
|
1717
|
+
--_mp-span-0: var(--_mp-span-compact, var(--_mp-cols, 12));
|
|
1718
|
+
--_mp-span-1: var(--_mp-span-0);
|
|
1719
|
+
--_mp-span-2: var(--_mp-span-1);
|
|
1720
|
+
--_mp-span-3: var(--_mp-span-2);
|
|
1721
|
+
--_mp-span: var(--_mp-span-3);
|
|
1722
|
+
|
|
1723
|
+
--_mp-offset-0: var(--_mp-offset-compact, 0);
|
|
1724
|
+
--_mp-offset-1: var(--_mp-offset-0);
|
|
1725
|
+
--_mp-offset-2: var(--_mp-offset-1);
|
|
1726
|
+
--_mp-offset-3: var(--_mp-offset-2);
|
|
1727
|
+
--_mp-offset: var(--_mp-offset-3);
|
|
1728
|
+
|
|
1729
|
+
--_mp-grow-0: var(--_mp-grow-compact, 0);
|
|
1730
|
+
--_mp-grow-1: var(--_mp-grow-0);
|
|
1731
|
+
--_mp-grow-2: var(--_mp-grow-1);
|
|
1732
|
+
--_mp-grow-3: var(--_mp-grow-2);
|
|
1733
|
+
--_mp-grow: var(--_mp-grow-3);
|
|
1221
1734
|
|
|
1222
1735
|
/* One column plus one gutter. `--_mp-cols` and `--_mp-gap-x` are inherited
|
|
1223
1736
|
from the grid, so this re-resolves on its own at every window class. */
|
|
1224
1737
|
--_mp-track: calc((100% + var(--_mp-gap-x, 0px)) / var(--_mp-cols, 12));
|
|
1225
1738
|
|
|
1226
|
-
/* Inseparable from the width under them: `flex`
|
|
1227
|
-
item, `min-width` stops a long unbroken word doing the
|
|
1228
|
-
`box-sizing` is what makes the percentage mean the whole item.
|
|
1739
|
+
/* Inseparable from the width under them: the three `flex` longhands stop the
|
|
1740
|
+
row resizing the item, `min-width` stops a long unbroken word doing the
|
|
1741
|
+
same, and `box-sizing` is what makes the percentage mean the whole item.
|
|
1742
|
+
|
|
1743
|
+
Longhands rather than `flex: 0 0 auto` because `--_mp-grow` is the one part
|
|
1744
|
+
of the shorthand that varies, and a shorthand cannot be half a variable. */
|
|
1229
1745
|
box-sizing: border-box;
|
|
1230
|
-
flex:
|
|
1746
|
+
flex-grow: var(--_mp-grow);
|
|
1747
|
+
flex-shrink: 0;
|
|
1748
|
+
flex-basis: auto;
|
|
1231
1749
|
min-width: 0;
|
|
1232
|
-
width: calc(var(--_mp-track) * min(var(--_mp-span), var(--_mp-cols, 12)) - var(--_mp-gap-x, 0px));
|
|
1233
|
-
margin-inline-start: calc(var(--_mp-track) * min(var(--_mp-offset), var(--_mp-cols, 12)));
|
|
1234
|
-
}
|
|
1235
1750
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1751
|
+
/* `1 - grow` is the switch, and it is arithmetic rather than a second
|
|
1752
|
+
declaration because a custom property cannot choose between two rules.
|
|
1753
|
+
A growing item measures nought and is then handed the row's remainder by
|
|
1754
|
+
`flex-grow`, which is the only place that remainder is known; every other
|
|
1755
|
+
item multiplies its column count by one and is the width it always was. */
|
|
1756
|
+
width: calc(
|
|
1757
|
+
(1 - var(--_mp-grow)) *
|
|
1758
|
+
(var(--_mp-track) * min(var(--_mp-span), var(--_mp-cols, 12)) - var(--_mp-gap-x, 0px))
|
|
1759
|
+
);
|
|
1760
|
+
|
|
1761
|
+
@variant mp-medium {
|
|
1762
|
+
--_mp-span-1: var(--_mp-span-medium, var(--_mp-span-0));
|
|
1763
|
+
--_mp-offset-1: var(--_mp-offset-medium, var(--_mp-offset-0));
|
|
1764
|
+
--_mp-grow-1: var(--_mp-grow-medium, var(--_mp-grow-0));
|
|
1241
1765
|
}
|
|
1242
1766
|
|
|
1243
|
-
|
|
1244
|
-
--_mp-span: var(--_mp-span-
|
|
1245
|
-
--_mp-offset: var(--_mp-offset-
|
|
1767
|
+
@variant mp-expanded {
|
|
1768
|
+
--_mp-span-2: var(--_mp-span-expanded, var(--_mp-span-1));
|
|
1769
|
+
--_mp-offset-2: var(--_mp-offset-expanded, var(--_mp-offset-1));
|
|
1770
|
+
--_mp-grow-2: var(--_mp-grow-expanded, var(--_mp-grow-1));
|
|
1246
1771
|
}
|
|
1247
|
-
}
|
|
1248
1772
|
|
|
1249
|
-
@
|
|
1250
|
-
|
|
1251
|
-
--_mp-
|
|
1252
|
-
--_mp-
|
|
1253
|
-
--_mp-gap-y: var(--_mp-gap-y-expanded, var(--_mp-gap-y-medium, var(--_mp-gap-y-compact, 0px)));
|
|
1773
|
+
@variant mp-large {
|
|
1774
|
+
--_mp-span-3: var(--_mp-span-large, var(--_mp-span-2));
|
|
1775
|
+
--_mp-offset-3: var(--_mp-offset-large, var(--_mp-offset-2));
|
|
1776
|
+
--_mp-grow-3: var(--_mp-grow-large, var(--_mp-grow-2));
|
|
1254
1777
|
}
|
|
1255
1778
|
|
|
1256
|
-
|
|
1257
|
-
--_mp-span: var(
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
);
|
|
1261
|
-
--_mp-offset: var(
|
|
1262
|
-
--_mp-offset-expanded,
|
|
1263
|
-
var(--_mp-offset-medium, var(--_mp-offset-compact, 0))
|
|
1264
|
-
);
|
|
1779
|
+
@variant mp-extra-large {
|
|
1780
|
+
--_mp-span: var(--_mp-span-extra-large, var(--_mp-span-3));
|
|
1781
|
+
--_mp-offset: var(--_mp-offset-extra-large, var(--_mp-offset-3));
|
|
1782
|
+
--_mp-grow: var(--_mp-grow-extra-large, var(--_mp-grow-3));
|
|
1265
1783
|
}
|
|
1266
1784
|
}
|
|
1267
1785
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1786
|
+
/* The offset, on the items that asked for one and no others.
|
|
1787
|
+
`MPGridItem` writes the attribute when an `offset` was passed at all, an
|
|
1788
|
+
explicit `0` included.
|
|
1789
|
+
|
|
1790
|
+
Written unconditionally on `.mp-grid-item` this resolved to `0px` for
|
|
1791
|
+
everybody else — and a declaration of nought is still a declaration. These
|
|
1792
|
+
rules are unlayered, so it beat a caller's own `m-6`, on the inline-start side
|
|
1793
|
+
and on that side alone. Three quarters of a margin is about the hardest thing
|
|
1794
|
+
there is to look at and see. */
|
|
1795
|
+
.mp-grid-item[data-mp-offset] {
|
|
1796
|
+
margin-inline-start: calc(var(--_mp-track) * min(var(--_mp-offset), var(--_mp-cols, 12)));
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/* ---------------------------------------------------------------------------
|
|
1800
|
+
* The measure
|
|
1801
|
+
*
|
|
1802
|
+
* How wide content is allowed to get, on `MPContainer`, `MPHeader` and
|
|
1803
|
+
* `MPFooter`. The same rungs the grid uses and for the same two reasons: the
|
|
1804
|
+
* value is a length a caller picks at runtime, which Tailwind cannot generate a
|
|
1805
|
+
* class for, and it changes at a window size class, which a media query resolves
|
|
1806
|
+
* without anything re-rendering.
|
|
1807
|
+
*
|
|
1808
|
+
* `none` is the base fallback rather than a width, so an element carrying this
|
|
1809
|
+
* class with nothing set is unbounded — which is what `max-width: none` means
|
|
1810
|
+
* and what a container with no `maxWidth` has always been.
|
|
1811
|
+
*
|
|
1812
|
+
* The slots are reset here for the reason `.mp-grid` resets its own: a container
|
|
1813
|
+
* inside a container, or a header inside either, is the ordinary shape of a page
|
|
1814
|
+
* and the slots inherit. An inner `maxWidth="sm"` writes one declaration, and
|
|
1815
|
+
* without the reset it would resolve the outer element's at every class above
|
|
1816
|
+
* compact — a card that is 600px wide on a phone and 1200 on a laptop, from a
|
|
1817
|
+
* component that was told 600.
|
|
1818
|
+
* ------------------------------------------------------------------------- */
|
|
1819
|
+
|
|
1820
|
+
.mp-measure {
|
|
1821
|
+
--_mp-measure-0: var(--_mp-measure-compact, none);
|
|
1822
|
+
--_mp-measure-1: var(--_mp-measure-0);
|
|
1823
|
+
--_mp-measure-2: var(--_mp-measure-1);
|
|
1824
|
+
--_mp-measure-3: var(--_mp-measure-2);
|
|
1825
|
+
--_mp-measure: var(--_mp-measure-3);
|
|
1826
|
+
|
|
1827
|
+
--_mp-measure-compact: initial;
|
|
1828
|
+
--_mp-measure-medium: initial;
|
|
1829
|
+
--_mp-measure-expanded: initial;
|
|
1830
|
+
--_mp-measure-large: initial;
|
|
1831
|
+
--_mp-measure-extra-large: initial;
|
|
1832
|
+
|
|
1833
|
+
max-width: var(--_mp-measure);
|
|
1834
|
+
|
|
1835
|
+
@variant mp-medium {
|
|
1836
|
+
--_mp-measure-1: var(--_mp-measure-medium, var(--_mp-measure-0));
|
|
1282
1837
|
}
|
|
1283
1838
|
|
|
1284
|
-
|
|
1285
|
-
--_mp-
|
|
1286
|
-
--_mp-span-large,
|
|
1287
|
-
var(--_mp-span-expanded, var(--_mp-span-medium, var(--_mp-span-compact, var(--_mp-cols, 12))))
|
|
1288
|
-
);
|
|
1289
|
-
--_mp-offset: var(
|
|
1290
|
-
--_mp-offset-large,
|
|
1291
|
-
var(--_mp-offset-expanded, var(--_mp-offset-medium, var(--_mp-offset-compact, 0)))
|
|
1292
|
-
);
|
|
1839
|
+
@variant mp-expanded {
|
|
1840
|
+
--_mp-measure-2: var(--_mp-measure-expanded, var(--_mp-measure-1));
|
|
1293
1841
|
}
|
|
1294
|
-
}
|
|
1295
1842
|
|
|
1296
|
-
@
|
|
1297
|
-
|
|
1298
|
-
--_mp-cols: var(
|
|
1299
|
-
--_mp-cols-extra-large,
|
|
1300
|
-
var(
|
|
1301
|
-
--_mp-cols-large,
|
|
1302
|
-
var(--_mp-cols-expanded, var(--_mp-cols-medium, var(--_mp-cols-compact, 12)))
|
|
1303
|
-
)
|
|
1304
|
-
);
|
|
1305
|
-
--_mp-gap-x: var(
|
|
1306
|
-
--_mp-gap-x-extra-large,
|
|
1307
|
-
var(
|
|
1308
|
-
--_mp-gap-x-large,
|
|
1309
|
-
var(--_mp-gap-x-expanded, var(--_mp-gap-x-medium, var(--_mp-gap-x-compact, 0px)))
|
|
1310
|
-
)
|
|
1311
|
-
);
|
|
1312
|
-
--_mp-gap-y: var(
|
|
1313
|
-
--_mp-gap-y-extra-large,
|
|
1314
|
-
var(
|
|
1315
|
-
--_mp-gap-y-large,
|
|
1316
|
-
var(--_mp-gap-y-expanded, var(--_mp-gap-y-medium, var(--_mp-gap-y-compact, 0px)))
|
|
1317
|
-
)
|
|
1318
|
-
);
|
|
1843
|
+
@variant mp-large {
|
|
1844
|
+
--_mp-measure-3: var(--_mp-measure-large, var(--_mp-measure-2));
|
|
1319
1845
|
}
|
|
1320
1846
|
|
|
1321
|
-
|
|
1322
|
-
--_mp-
|
|
1323
|
-
--_mp-span-extra-large,
|
|
1324
|
-
var(
|
|
1325
|
-
--_mp-span-large,
|
|
1326
|
-
var(
|
|
1327
|
-
--_mp-span-expanded,
|
|
1328
|
-
var(--_mp-span-medium, var(--_mp-span-compact, var(--_mp-cols, 12)))
|
|
1329
|
-
)
|
|
1330
|
-
)
|
|
1331
|
-
);
|
|
1332
|
-
--_mp-offset: var(
|
|
1333
|
-
--_mp-offset-extra-large,
|
|
1334
|
-
var(
|
|
1335
|
-
--_mp-offset-large,
|
|
1336
|
-
var(--_mp-offset-expanded, var(--_mp-offset-medium, var(--_mp-offset-compact, 0)))
|
|
1337
|
-
)
|
|
1338
|
-
);
|
|
1847
|
+
@variant mp-extra-large {
|
|
1848
|
+
--_mp-measure: var(--_mp-measure-extra-large, var(--_mp-measure-3));
|
|
1339
1849
|
}
|
|
1340
1850
|
}
|
|
1341
1851
|
|
|
1852
|
+
/* ---------------------------------------------------------------------------
|
|
1853
|
+
* Showing at some widths and not others
|
|
1854
|
+
*
|
|
1855
|
+
* The hiding itself is Tailwind's own `hidden` under the variants registered
|
|
1856
|
+
* above — `mp-below-medium:hidden` and its mirror — so there is nothing to write
|
|
1857
|
+
* here for it. `internal/visibility.ts` holds the ten class names, `MPShow` puts
|
|
1858
|
+
* them on, and a consumer can spell the same ones on an element of their own.
|
|
1859
|
+
*
|
|
1860
|
+
* What does need a rule is the wrapper, and only so that there is not one. An
|
|
1861
|
+
* `MPShow` has to be an element — a media query needs something to apply to —
|
|
1862
|
+
* and an element in the middle of a flex row is a flex item that its children
|
|
1863
|
+
* are not. `display: contents` is that element taking no part in the layout: the
|
|
1864
|
+
* children become the items, exactly as if the wrapper were not written.
|
|
1865
|
+
*
|
|
1866
|
+
* `:where()` is the whole of why this is safe to do. The declaration lands at
|
|
1867
|
+
* zero specificity, so a `className` of the caller's own that sets a display —
|
|
1868
|
+
* `flex`, `block`, anything — beats it without a fight, while `hidden`, which is
|
|
1869
|
+
* a real class, still beats both. A wrapper that insisted on `contents` would be
|
|
1870
|
+
* a component that quietly refused to be a box.
|
|
1871
|
+
* ------------------------------------------------------------------------- */
|
|
1872
|
+
|
|
1873
|
+
:where(.mp-show) {
|
|
1874
|
+
display: contents;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1342
1877
|
/* ---------------------------------------------------------------------------
|
|
1343
1878
|
* Keyframes
|
|
1344
1879
|
*
|
|
@@ -1570,6 +2105,218 @@
|
|
|
1570
2105
|
}
|
|
1571
2106
|
}
|
|
1572
2107
|
|
|
2108
|
+
/* ---------------------------------------------------------------------------
|
|
2109
|
+
* A row arriving in a list
|
|
2110
|
+
*
|
|
2111
|
+
* Two components put rows into a list the reader is already looking at.
|
|
2112
|
+
* `MPTransfer` moves them between its two panels; `MPFilePicker` adds them as
|
|
2113
|
+
* files are chosen or dropped. In both the row simply existed in the next
|
|
2114
|
+
* frame, which on a list of near-identical lines is the one change hardest to
|
|
2115
|
+
* see — a reader who dropped four files onto a list that already had six had
|
|
2116
|
+
* nothing telling them which four were new.
|
|
2117
|
+
*
|
|
2118
|
+
* A keyframe rather than a transition, for the reason the calendar's page turn
|
|
2119
|
+
* above is one: there are no two states to interpolate between. The row was not
|
|
2120
|
+
* there, and a transition needs something that was.
|
|
2121
|
+
*
|
|
2122
|
+
* ## It needs no bookkeeping to run once
|
|
2123
|
+
*
|
|
2124
|
+
* A CSS animation runs when the element it is on is inserted, so a class on
|
|
2125
|
+
* every row animates only the rows the browser has just created. What each
|
|
2126
|
+
* component still has to decide is which rows *count* as arriving: adding the
|
|
2127
|
+
* class to a row that is already on the page starts the animation on it, so a
|
|
2128
|
+
* class written unconditionally would replay the whole list the first time the
|
|
2129
|
+
* set changed. Both components keep the set of values that just landed and put
|
|
2130
|
+
* the class on those.
|
|
2131
|
+
*
|
|
2132
|
+
* ## Why it does not say which way the row came
|
|
2133
|
+
*
|
|
2134
|
+
* `MPTransfer`'s rows arrive from a panel that is physically to one side, and a
|
|
2135
|
+
* slide from that side would say so — the argument the calendar's page turn
|
|
2136
|
+
* makes about direction. It is not worth what it costs here: `translate` is
|
|
2137
|
+
* physical, so the sign has to be flipped under RTL by reading the computed
|
|
2138
|
+
* direction off the element, and it would be a slot `MPFilePicker` has no
|
|
2139
|
+
* answer for. A rise settles a row into a list in either writing direction and
|
|
2140
|
+
* says the one thing both components need said.
|
|
2141
|
+
*
|
|
2142
|
+
* Unlayered, like the keyframes above, and switched off for a reader who asked
|
|
2143
|
+
* for less motion. What is left then is the row appearing, which is where this
|
|
2144
|
+
* started.
|
|
2145
|
+
* ------------------------------------------------------------------------- */
|
|
2146
|
+
|
|
2147
|
+
@keyframes mp-row-arrive {
|
|
2148
|
+
from {
|
|
2149
|
+
opacity: 0;
|
|
2150
|
+
translate: 0 0.25rem;
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
.mp-row-arrive {
|
|
2155
|
+
animation: mp-row-arrive var(--mp-sys-motion-duration-short4)
|
|
2156
|
+
var(--mp-sys-motion-easing-emphasized-decelerate);
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2160
|
+
.mp-row-arrive {
|
|
2161
|
+
animation: none;
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/* ---------------------------------------------------------------------------
|
|
2166
|
+
* A field's supporting line
|
|
2167
|
+
*
|
|
2168
|
+
* The line under a control is drawn only when there is something to say, so a
|
|
2169
|
+
* field that turned invalid grew by a line of text between one frame and the
|
|
2170
|
+
* next — and everything under it on the page moved down by that much. On a form
|
|
2171
|
+
* validated on blur that is the whole page stepping as the reader tabs through
|
|
2172
|
+
* it, which is the layout shift a reader notices most and the one a component
|
|
2173
|
+
* library is in the best position to prevent.
|
|
2174
|
+
*
|
|
2175
|
+
* ## The row rather than a height
|
|
2176
|
+
*
|
|
2177
|
+
* A message is one line or three, depending on what it says and how wide the
|
|
2178
|
+
* field is, and neither this stylesheet nor the component knows which. `1fr` of
|
|
2179
|
+
* a single-row grid is exactly what the message needs and `0fr` is nothing at
|
|
2180
|
+
* all, so the two ends are the real heights rather than a guess big enough to
|
|
2181
|
+
* cover them — the same move `MPFloatingActionButton` makes across its label
|
|
2182
|
+
* and `MPAlert` makes on its way out.
|
|
2183
|
+
*
|
|
2184
|
+
* `overflow: hidden` because the row is smaller than its content for the whole
|
|
2185
|
+
* of the opening, and a message that spilled out of a zero-height row would be
|
|
2186
|
+
* drawn over the control it belongs to.
|
|
2187
|
+
*
|
|
2188
|
+
* ## Two keyframes, because there are two things that happen here
|
|
2189
|
+
*
|
|
2190
|
+
* A field with nothing to say and one with something to say differ by a line of
|
|
2191
|
+
* layout, and that is what `open` is for. A field whose description has been
|
|
2192
|
+
* replaced by an error differs by the words, and the space is already there —
|
|
2193
|
+
* so `swap` is a fade and nothing else. Opening a row that is already open
|
|
2194
|
+
* would collapse the line and re-open it, which is a flinch rather than a
|
|
2195
|
+
* change of message.
|
|
2196
|
+
*
|
|
2197
|
+
* ## Why an attribute rather than a class that is simply always on
|
|
2198
|
+
*
|
|
2199
|
+
* Because a page load is not a change. Every rule here is written against
|
|
2200
|
+
* `data-mp-reveal`, which `internal/SupportingText.tsx` sets only when it has
|
|
2201
|
+
* watched the message change — otherwise a server-rendered form would grow six
|
|
2202
|
+
* description lines out of nothing the moment it hydrated, which is a page
|
|
2203
|
+
* assembling itself in front of a reader who asked for a form.
|
|
2204
|
+
*
|
|
2205
|
+
* That is the same bargain `.mp-calendar__page[data-mp-paged]` makes, and the
|
|
2206
|
+
* component restarts these the same way: there is no rewinding a CSS animation
|
|
2207
|
+
* from React, so `animation-name` is cleared and put back.
|
|
2208
|
+
*
|
|
2209
|
+
* Unlayered, like the keyframes above, and switched off for a reader who asked
|
|
2210
|
+
* for less motion.
|
|
2211
|
+
* ------------------------------------------------------------------------- */
|
|
2212
|
+
|
|
2213
|
+
@keyframes mp-supporting-text-open {
|
|
2214
|
+
from {
|
|
2215
|
+
grid-template-rows: 0fr;
|
|
2216
|
+
opacity: 0;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
@keyframes mp-supporting-text-swap {
|
|
2221
|
+
from {
|
|
2222
|
+
opacity: 0;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
.mp-supporting-text__reveal {
|
|
2227
|
+
display: grid;
|
|
2228
|
+
grid-template-rows: 1fr;
|
|
2229
|
+
overflow: hidden;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
.mp-supporting-text__reveal[data-mp-reveal='open'] {
|
|
2233
|
+
animation: mp-supporting-text-open var(--mp-sys-motion-duration-short4)
|
|
2234
|
+
var(--mp-sys-motion-easing-emphasized-decelerate);
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
.mp-supporting-text__reveal[data-mp-reveal='swap'] {
|
|
2238
|
+
animation: mp-supporting-text-swap var(--mp-sys-motion-duration-short4)
|
|
2239
|
+
var(--mp-sys-motion-easing-standard);
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2243
|
+
.mp-supporting-text__reveal[data-mp-reveal] {
|
|
2244
|
+
animation: none;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
/* ---------------------------------------------------------------------------
|
|
2249
|
+
* The tab bar's ends
|
|
2250
|
+
*
|
|
2251
|
+
* A bar with more tabs than room has always scrolled — MD3's scrollable tabs,
|
|
2252
|
+
* and `overflow-x: auto` is the whole of it. What it had no way of saying was
|
|
2253
|
+
* that it was scrolling. macOS draws an overlay scrollbar that is not there
|
|
2254
|
+
* until it is used, so a bar with four tabs off the edge and a bar with none
|
|
2255
|
+
* are the same picture; Windows draws a real one, which is a signal and also
|
|
2256
|
+
* fifteen pixels of furniture under the tabs. `MPTabs` hides it on both and
|
|
2257
|
+
* fades the ends instead, which is one answer rather than two halves.
|
|
2258
|
+
*
|
|
2259
|
+
* Hand-written rather than a utility for the reason the grid arithmetic above
|
|
2260
|
+
* is: the gradient reads a value that only exists at run time, and Tailwind
|
|
2261
|
+
* generates classes from strings it can find in the source.
|
|
2262
|
+
*
|
|
2263
|
+
* ## Which end
|
|
2264
|
+
*
|
|
2265
|
+
* `data-mp-overflow` is written by the component from a measurement, and is
|
|
2266
|
+
* absent when everything fits — so a bar that does not overflow carries no mask
|
|
2267
|
+
* at all. Fading an end a reader has already reached would be a lie about
|
|
2268
|
+
* there being more that way, which is the same failure as saying nothing.
|
|
2269
|
+
*
|
|
2270
|
+
* ## Why there are two mask layers
|
|
2271
|
+
*
|
|
2272
|
+
* The divider is the bar's bottom border, and a mask applies to an element's
|
|
2273
|
+
* whole rendering — so a single horizontal gradient fades the hairline out at
|
|
2274
|
+
* both ends along with the tabs. The tabs running on is a fact about the bar;
|
|
2275
|
+
* the divider is the boundary between the bar and the panel under it, and it
|
|
2276
|
+
* runs the full width whatever the bar is doing.
|
|
2277
|
+
*
|
|
2278
|
+
* So the fade is sized to everything *above* the last pixel, and a second,
|
|
2279
|
+
* fully opaque layer covers that pixel. Multiple mask layers composite as
|
|
2280
|
+
* `add` by default, which is what makes this two declarations rather than a
|
|
2281
|
+
* `mask-composite` nobody would guess was load-bearing. `no-repeat` is not
|
|
2282
|
+
* optional: a 1px layer left to tile would run the opaque strip up the whole
|
|
2283
|
+
* bar and there would be no fade at all.
|
|
2284
|
+
* ------------------------------------------------------------------------- */
|
|
2285
|
+
|
|
2286
|
+
.mp-tabs__list[data-mp-overflow] {
|
|
2287
|
+
/* A tab's own inline padding at `md`, so the fade is about one glyph wide —
|
|
2288
|
+
enough to read as an edge that continues, and not so much that the label it
|
|
2289
|
+
runs over stops being a word. */
|
|
2290
|
+
--_mp-tabs-fade: 1.5rem;
|
|
2291
|
+
|
|
2292
|
+
mask-image:
|
|
2293
|
+
linear-gradient(
|
|
2294
|
+
to right,
|
|
2295
|
+
transparent 0,
|
|
2296
|
+
#000 var(--_mp-tabs-fade-left, 0px),
|
|
2297
|
+
#000 calc(100% - var(--_mp-tabs-fade-right, 0px)),
|
|
2298
|
+
transparent 100%
|
|
2299
|
+
),
|
|
2300
|
+
linear-gradient(#000, #000);
|
|
2301
|
+
mask-size:
|
|
2302
|
+
100% calc(100% - 1px),
|
|
2303
|
+
100% 1px;
|
|
2304
|
+
mask-position:
|
|
2305
|
+
top left,
|
|
2306
|
+
bottom left;
|
|
2307
|
+
mask-repeat: no-repeat;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
.mp-tabs__list[data-mp-overflow='left'],
|
|
2311
|
+
.mp-tabs__list[data-mp-overflow='both'] {
|
|
2312
|
+
--_mp-tabs-fade-left: var(--_mp-tabs-fade);
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
.mp-tabs__list[data-mp-overflow='right'],
|
|
2316
|
+
.mp-tabs__list[data-mp-overflow='both'] {
|
|
2317
|
+
--_mp-tabs-fade-right: var(--_mp-tabs-fade);
|
|
2318
|
+
}
|
|
2319
|
+
|
|
1573
2320
|
/* ---------------------------------------------------------------------------
|
|
1574
2321
|
* Animation
|
|
1575
2322
|
*
|
|
@@ -1618,6 +2365,31 @@
|
|
|
1618
2365
|
animation-play-state: var(--_mp-anim-state, running);
|
|
1619
2366
|
}
|
|
1620
2367
|
|
|
2368
|
+
/*
|
|
2369
|
+
* And the same effects, driven by the reader instead of by a clock.
|
|
2370
|
+
*
|
|
2371
|
+
* Two declarations, and every keyframe below gains a scroll-driven mode. That
|
|
2372
|
+
* is the whole of `timeline="view"`: there is no second set of keyframes and no
|
|
2373
|
+
* component of its own, because a fade tied to a scroll position is not a
|
|
2374
|
+
* different effect from a fade — it is the same one on a different clock.
|
|
2375
|
+
*
|
|
2376
|
+
* The slots are filled only when a caller asks for `view`. `auto` and `normal`
|
|
2377
|
+
* are what this rule already says, so writing them out per instance would be a
|
|
2378
|
+
* hundred and thirty components each carrying the answer nobody changed.
|
|
2379
|
+
*
|
|
2380
|
+
* `@supports` is not optional, and the reason is not the browsers that have
|
|
2381
|
+
* none of this. It is that `animation-timeline` and `animation-range` are two
|
|
2382
|
+
* properties: a browser that took the first and not the second would give an
|
|
2383
|
+
* animation a timeline and no range to run over. Asking for `view()` itself is
|
|
2384
|
+
* asking for the pair.
|
|
2385
|
+
*/
|
|
2386
|
+
@supports (animation-timeline: view()) {
|
|
2387
|
+
.mp-anim {
|
|
2388
|
+
animation-timeline: var(--_mp-anim-timeline, auto);
|
|
2389
|
+
animation-range: var(--_mp-anim-range, normal);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
|
|
1621
2393
|
@keyframes mp-anim-fade {
|
|
1622
2394
|
from {
|
|
1623
2395
|
opacity: var(--_mp-anim-opacity, 0);
|
|
@@ -1684,6 +2456,42 @@
|
|
|
1684
2456
|
animation-name: mp-anim-rotate;
|
|
1685
2457
|
}
|
|
1686
2458
|
|
|
2459
|
+
/*
|
|
2460
|
+
* Reveal: the content disclosed rather than brought in.
|
|
2461
|
+
*
|
|
2462
|
+
* The only entrance in the set where nothing moves and no colour changes. The
|
|
2463
|
+
* element is where it will be from the first frame and at the ink it will end
|
|
2464
|
+
* at; what changes is how much of it has been uncovered. That is what a title,
|
|
2465
|
+
* a rule or a chart's plot area needs, because for those the *position* is part
|
|
2466
|
+
* of what is being said and an entrance that travels says something else.
|
|
2467
|
+
*
|
|
2468
|
+
* `clip-path` rather than a mask, and rather than a wrapper with `overflow`.
|
|
2469
|
+
* A mask needs a gradient per direction and a second one to undo itself; a
|
|
2470
|
+
* wrapper puts an element into the layout that was not there before, which for
|
|
2471
|
+
* something inside a grid or a flex row changes what it is a child of.
|
|
2472
|
+
* `inset(0)` is already the spelling of "nothing is clipped", so the to-state
|
|
2473
|
+
* needs no slot at all.
|
|
2474
|
+
*
|
|
2475
|
+
* The opacity slot defaults to 1 rather than to 0. A reveal is not a fade, and
|
|
2476
|
+
* the two together read as a much weaker version of either; the components that
|
|
2477
|
+
* want both lower it deliberately.
|
|
2478
|
+
*/
|
|
2479
|
+
@keyframes mp-anim-reveal {
|
|
2480
|
+
from {
|
|
2481
|
+
opacity: var(--_mp-anim-opacity, 1);
|
|
2482
|
+
clip-path: var(--_mp-anim-clip, inset(0 100% 0 0));
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
to {
|
|
2486
|
+
opacity: 1;
|
|
2487
|
+
clip-path: inset(0);
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
.mp-anim-reveal {
|
|
2492
|
+
animation-name: mp-anim-reveal;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
1687
2495
|
/* Symmetric on purpose: a blink that ended anywhere but where it started would
|
|
1688
2496
|
leave the element half drawn whenever the count ran out. */
|
|
1689
2497
|
@keyframes mp-anim-blink {
|
|
@@ -1701,6 +2509,131 @@
|
|
|
1701
2509
|
animation-name: mp-anim-blink;
|
|
1702
2510
|
}
|
|
1703
2511
|
|
|
2512
|
+
/*
|
|
2513
|
+
* Float: the two effects that are not arrivals, and keep their keyframes here
|
|
2514
|
+
* rather than in the shared table.
|
|
2515
|
+
*
|
|
2516
|
+
* `MPAnimation` is what everything with an *entrance* shares, and a shared
|
|
2517
|
+
* lookup table is a tax on everything that imports it — an object literal is
|
|
2518
|
+
* not tree-shaken key by key, so a component reading one pays for the rows it
|
|
2519
|
+
* will never use. Neither of the two below is an arrival: a drift has no
|
|
2520
|
+
* destination and a refusal is an answer rather than a state, so they borrow
|
|
2521
|
+
* the machinery and bring their own frames.
|
|
2522
|
+
*
|
|
2523
|
+
* A drift is four points around the origin rather than one axis, because one
|
|
2524
|
+
* axis is a bob and a bob is a loading indicator. Every keyframe returns
|
|
2525
|
+
* through nothing at 0% and 100%, so an interrupted float leaves the element
|
|
2526
|
+
* where the page put it.
|
|
2527
|
+
*/
|
|
2528
|
+
@keyframes mp-anim-float {
|
|
2529
|
+
0%,
|
|
2530
|
+
100% {
|
|
2531
|
+
translate: 0 0;
|
|
2532
|
+
rotate: 0deg;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
25% {
|
|
2536
|
+
translate: var(--_mp-anim-x, 0.375rem) calc(-1 * var(--_mp-anim-y, 0.625rem));
|
|
2537
|
+
rotate: var(--_mp-anim-angle, 0deg);
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
50% {
|
|
2541
|
+
translate: 0 calc(-1.5 * var(--_mp-anim-y, 0.625rem));
|
|
2542
|
+
rotate: 0deg;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
75% {
|
|
2546
|
+
translate: calc(-1 * var(--_mp-anim-x, 0.375rem)) calc(-1 * var(--_mp-anim-y, 0.625rem));
|
|
2547
|
+
rotate: calc(-1 * var(--_mp-anim-angle, 0deg));
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
.mp-anim-float {
|
|
2552
|
+
animation-name: mp-anim-float;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/*
|
|
2556
|
+
* Shake: the answer to something that did not work.
|
|
2557
|
+
*
|
|
2558
|
+
* The library's rule is that a **control** never moves, and it holds — but that
|
|
2559
|
+
* rule is about a control's resting states, where movement is a stand-in for
|
|
2560
|
+
* something colour says better. This is not a state. It is a one-off answer to
|
|
2561
|
+
* what the reader just did, it is over in four hundred milliseconds, and there
|
|
2562
|
+
* is no colour that says *that was refused* as plainly.
|
|
2563
|
+
*
|
|
2564
|
+
* Two details it lives or dies by. **Nought and a hundred are home**, so an
|
|
2565
|
+
* interrupted shake does not leave the element sitting to one side of where it
|
|
2566
|
+
* belongs. And the **second half is smaller than the first** — 55% of the
|
|
2567
|
+
* amplitude — because a shake that ends as hard as it started reads as a loop
|
|
2568
|
+
* that was cut off rather than as an answer that finished.
|
|
2569
|
+
*/
|
|
2570
|
+
@keyframes mp-anim-shake {
|
|
2571
|
+
0%,
|
|
2572
|
+
100% {
|
|
2573
|
+
translate: 0 0;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
20% {
|
|
2577
|
+
translate: calc(-1 * var(--_mp-anim-x, 0.5rem)) 0;
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
40% {
|
|
2581
|
+
translate: var(--_mp-anim-x, 0.5rem) 0;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
60% {
|
|
2585
|
+
translate: calc(-0.55 * var(--_mp-anim-x, 0.5rem)) 0;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
80% {
|
|
2589
|
+
translate: calc(0.55 * var(--_mp-anim-x, 0.5rem)) 0;
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
.mp-anim-shake {
|
|
2594
|
+
animation-name: mp-anim-shake;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
/*
|
|
2598
|
+
* Counter: a number, animated by CSS and only *read* by JavaScript.
|
|
2599
|
+
*
|
|
2600
|
+
* A count up cannot be a keyframe on its own, because text is not an animatable
|
|
2601
|
+
* property — every frame needs a fresh interpolation put through a formatter.
|
|
2602
|
+
* The obvious answer is a `requestAnimationFrame` loop with its own clock, its
|
|
2603
|
+
* own easing and its own idea of what "paused" means, which is three things
|
|
2604
|
+
* that have to be kept in step with the six effects above and will not be.
|
|
2605
|
+
*
|
|
2606
|
+
* So the animation is a real CSS animation over a **registered custom
|
|
2607
|
+
* property**, and the component's rAF loop does nothing but read the value and
|
|
2608
|
+
* format it. The duration, the delay, the easing token, the play state, the
|
|
2609
|
+
* trigger, `prefers-reduced-motion` and `timeline="view"` are then all the same
|
|
2610
|
+
* machinery every other effect uses, rather than a second implementation of
|
|
2611
|
+
* each — and the untriggered state is the first frame for free, because a
|
|
2612
|
+
* paused animation with `fill-mode: both` is sitting on `from`.
|
|
2613
|
+
*
|
|
2614
|
+
* `@property` is what makes it interpolate at all: without a registered syntax
|
|
2615
|
+
* a custom property is a string, and a string animates by swapping at 50%.
|
|
2616
|
+
*/
|
|
2617
|
+
@property --mp-count {
|
|
2618
|
+
syntax: '<number>';
|
|
2619
|
+
initial-value: 0;
|
|
2620
|
+
inherits: false;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
@keyframes mp-anim-count {
|
|
2624
|
+
from {
|
|
2625
|
+
--mp-count: var(--_mp-anim-from, 0);
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
to {
|
|
2629
|
+
--mp-count: var(--_mp-anim-to, 0);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
.mp-anim-count {
|
|
2634
|
+
animation-name: mp-anim-count;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
1704
2637
|
@media (prefers-reduced-motion: reduce) {
|
|
1705
2638
|
/*
|
|
1706
2639
|
* The Animate components go the other way from the indicators above, and the
|
|
@@ -1962,3 +2895,379 @@
|
|
|
1962
2895
|
animation: none;
|
|
1963
2896
|
}
|
|
1964
2897
|
}
|
|
2898
|
+
|
|
2899
|
+
/* ---------------------------------------------------------------------------
|
|
2900
|
+
* Code blocks
|
|
2901
|
+
*
|
|
2902
|
+
* An MPCodeBlock is the one surface in this library that does **not** take the
|
|
2903
|
+
* page's colour roles, and that is a decision rather than an oversight. Code is
|
|
2904
|
+
* read against a ground chosen for code, and the twelve hues it needs to keep a
|
|
2905
|
+
* keyword apart from a string apart from a number are not the four accent
|
|
2906
|
+
* families MD3 has. A block dyed with `primary` would be a block whose colours
|
|
2907
|
+
* carry no information.
|
|
2908
|
+
*
|
|
2909
|
+
* So the sheet carries slots of its own, `theme` picks which set fills them,
|
|
2910
|
+
* and `auto` — the default — is the one that follows the page's light and dark
|
|
2911
|
+
* the way every other surface here does.
|
|
2912
|
+
*
|
|
2913
|
+
* They are custom properties on the block rather than a stylesheet per theme,
|
|
2914
|
+
* for the reason `internal/animate-core.ts` gives about the effect tables:
|
|
2915
|
+
* nothing here is generated, the component only fills slots, and a fifth theme
|
|
2916
|
+
* is a block of declarations rather than a second copy of the map below. That
|
|
2917
|
+
* is also why `theme` accepts any string — a consumer who writes
|
|
2918
|
+
* `[data-mp-code-theme='ours']` in their own CSS has a theme, with nothing to
|
|
2919
|
+
* register and nothing to import.
|
|
2920
|
+
*
|
|
2921
|
+
* **Five of the slots are derived and are never written per theme.** `dim`,
|
|
2922
|
+
* `rule` and `hover` are a fixed mix of the ground and the ink, and `mark` and
|
|
2923
|
+
* `mark-edge` are the same for a marked line. A custom property resolves its
|
|
2924
|
+
* `var()`s on the element that declares it, and every theme below declares its
|
|
2925
|
+
* `fg` and `bg` on that same element — so the derived five follow whichever
|
|
2926
|
+
* theme won without being restated five times.
|
|
2927
|
+
*
|
|
2928
|
+
* The dark palette is written twice on purpose: once for the pinned `dark`
|
|
2929
|
+
* theme together with `auto` under an explicitly dark page, and once for `auto`
|
|
2930
|
+
* under `prefers-color-scheme`. A media query and a selector list cannot be
|
|
2931
|
+
* folded into one rule, which is the same repetition the scheme block at the
|
|
2932
|
+
* top of this file makes and says so about.
|
|
2933
|
+
*
|
|
2934
|
+
* Every hue is solved against its own ground rather than flipped: the light set
|
|
2935
|
+
* runs dark and saturated on near-white, the dark set light and desaturated on
|
|
2936
|
+
* near-black. The pairs held furthest apart are the ones that sit next to each
|
|
2937
|
+
* other in real code — a string beside a number, a type beside a function name.
|
|
2938
|
+
*
|
|
2939
|
+
* No third-party palettes ship here. One Dark, Dracula, Nord and the rest are
|
|
2940
|
+
* other projects' published work under their own licences, and porting them
|
|
2941
|
+
* into this package would be shipping somebody else's design under this one's
|
|
2942
|
+
* name. The open string above is how to bring the one you read in all day.
|
|
2943
|
+
* ------------------------------------------------------------------------- */
|
|
2944
|
+
|
|
2945
|
+
.mp-code {
|
|
2946
|
+
/* The light set, which is also where `auto` starts. */
|
|
2947
|
+
--mp-code-bg: oklch(98.4% 0.003 262);
|
|
2948
|
+
--mp-code-fg: oklch(30% 0.016 262);
|
|
2949
|
+
|
|
2950
|
+
--mp-code-comment: oklch(58% 0.022 262);
|
|
2951
|
+
--mp-code-keyword: oklch(48% 0.19 322);
|
|
2952
|
+
--mp-code-string: oklch(46% 0.12 148);
|
|
2953
|
+
--mp-code-number: oklch(50% 0.14 48);
|
|
2954
|
+
--mp-code-function: oklch(48% 0.17 264);
|
|
2955
|
+
--mp-code-type: oklch(45% 0.1 214);
|
|
2956
|
+
--mp-code-variable: oklch(45% 0.12 28);
|
|
2957
|
+
--mp-code-tag: oklch(48% 0.18 22);
|
|
2958
|
+
--mp-code-attr: oklch(47% 0.13 82);
|
|
2959
|
+
--mp-code-meta: oklch(52% 0.05 262);
|
|
2960
|
+
--mp-code-add: oklch(45% 0.14 152);
|
|
2961
|
+
--mp-code-del: oklch(48% 0.18 25);
|
|
2962
|
+
|
|
2963
|
+
/* The derived five. Declared once here and never in a theme: they are a mix
|
|
2964
|
+
of that theme's own ground and ink, which resolves on this element. */
|
|
2965
|
+
--mp-code-dim: color-mix(in oklab, var(--mp-code-fg) 58%, var(--mp-code-bg));
|
|
2966
|
+
--mp-code-rule: color-mix(in oklab, var(--mp-code-fg) 14%, transparent);
|
|
2967
|
+
--mp-code-hover: color-mix(in oklab, var(--mp-code-fg) 9%, transparent);
|
|
2968
|
+
|
|
2969
|
+
/* A marked line is neutral rather than dyed with the page's accent family:
|
|
2970
|
+
the block has deliberately refused the page's palette, and a primary wash
|
|
2971
|
+
over it would be the one colour on it that nobody chose. Mixed from the
|
|
2972
|
+
theme's own ink, it is legible on all of them. */
|
|
2973
|
+
--mp-code-mark: color-mix(in oklab, var(--mp-code-fg) 10%, transparent);
|
|
2974
|
+
--mp-code-mark-edge: color-mix(in oklab, var(--mp-code-fg) 45%, transparent);
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
.mp-code[data-mp-code-theme='dark'],
|
|
2978
|
+
:where([data-mp-scheme='dark'], .dark) .mp-code[data-mp-code-theme='auto'] {
|
|
2979
|
+
--mp-code-bg: oklch(19.5% 0.014 262);
|
|
2980
|
+
--mp-code-fg: oklch(90% 0.012 262);
|
|
2981
|
+
|
|
2982
|
+
--mp-code-comment: oklch(60% 0.024 262);
|
|
2983
|
+
--mp-code-keyword: oklch(76% 0.13 324);
|
|
2984
|
+
--mp-code-string: oklch(80% 0.13 148);
|
|
2985
|
+
--mp-code-number: oklch(81% 0.12 62);
|
|
2986
|
+
--mp-code-function: oklch(78% 0.12 258);
|
|
2987
|
+
--mp-code-type: oklch(82% 0.1 210);
|
|
2988
|
+
--mp-code-variable: oklch(82% 0.09 32);
|
|
2989
|
+
--mp-code-tag: oklch(77% 0.13 22);
|
|
2990
|
+
--mp-code-attr: oklch(85% 0.11 92);
|
|
2991
|
+
--mp-code-meta: oklch(70% 0.05 262);
|
|
2992
|
+
--mp-code-add: oklch(80% 0.14 152);
|
|
2993
|
+
--mp-code-del: oklch(75% 0.15 25);
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2996
|
+
@media (prefers-color-scheme: dark) {
|
|
2997
|
+
:root:not([data-mp-scheme='light']) .mp-code[data-mp-code-theme='auto'] {
|
|
2998
|
+
--mp-code-bg: oklch(19.5% 0.014 262);
|
|
2999
|
+
--mp-code-fg: oklch(90% 0.012 262);
|
|
3000
|
+
|
|
3001
|
+
--mp-code-comment: oklch(60% 0.024 262);
|
|
3002
|
+
--mp-code-keyword: oklch(76% 0.13 324);
|
|
3003
|
+
--mp-code-string: oklch(80% 0.13 148);
|
|
3004
|
+
--mp-code-number: oklch(81% 0.12 62);
|
|
3005
|
+
--mp-code-function: oklch(78% 0.12 258);
|
|
3006
|
+
--mp-code-type: oklch(82% 0.1 210);
|
|
3007
|
+
--mp-code-variable: oklch(82% 0.09 32);
|
|
3008
|
+
--mp-code-tag: oklch(77% 0.13 22);
|
|
3009
|
+
--mp-code-attr: oklch(85% 0.11 92);
|
|
3010
|
+
--mp-code-meta: oklch(70% 0.05 262);
|
|
3011
|
+
--mp-code-add: oklch(80% 0.14 152);
|
|
3012
|
+
--mp-code-del: oklch(75% 0.15 25);
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
/*
|
|
3017
|
+
* `mono` is the one theme built out of the page's own colours, and the only one
|
|
3018
|
+
* with no hue in it at all: the structure is carried by weight and by how far a
|
|
3019
|
+
* run is muted. It is what a block printed on paper, or read by somebody who
|
|
3020
|
+
* cannot separate the hues above, is left with — so it has to stand on its own
|
|
3021
|
+
* rather than read as a degraded copy of a colour theme.
|
|
3022
|
+
*/
|
|
3023
|
+
/*
|
|
3024
|
+
* The `--_mp-color-*` indirections rather than the `--mp-sys-color-*` roles a
|
|
3025
|
+
* consumer sets. The roles are the *input* — undefined unless somebody wrote
|
|
3026
|
+
* one — and the indirections are what the sheet derives from the source colour
|
|
3027
|
+
* when nobody did. A rule that read the role directly would draw nothing at all
|
|
3028
|
+
* on a page that had not overridden it, which is most pages.
|
|
3029
|
+
*/
|
|
3030
|
+
.mp-code[data-mp-code-theme='mono'] {
|
|
3031
|
+
--mp-code-bg: var(--_mp-color-surface-container);
|
|
3032
|
+
--mp-code-fg: var(--_mp-color-on-surface);
|
|
3033
|
+
|
|
3034
|
+
--mp-code-comment: var(--_mp-color-on-surface-variant);
|
|
3035
|
+
--mp-code-keyword: var(--_mp-color-on-surface);
|
|
3036
|
+
--mp-code-string: var(--_mp-color-on-surface-variant);
|
|
3037
|
+
--mp-code-number: var(--_mp-color-on-surface-variant);
|
|
3038
|
+
--mp-code-function: var(--_mp-color-on-surface);
|
|
3039
|
+
--mp-code-type: var(--_mp-color-on-surface);
|
|
3040
|
+
--mp-code-variable: var(--_mp-color-on-surface);
|
|
3041
|
+
--mp-code-tag: var(--_mp-color-on-surface);
|
|
3042
|
+
--mp-code-attr: var(--_mp-color-on-surface-variant);
|
|
3043
|
+
--mp-code-meta: var(--_mp-color-on-surface-variant);
|
|
3044
|
+
--mp-code-add: var(--_mp-color-on-surface);
|
|
3045
|
+
--mp-code-del: var(--_mp-color-on-surface-variant);
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-keyword,
|
|
3049
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-selector-tag,
|
|
3050
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-title,
|
|
3051
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-tag,
|
|
3052
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-type,
|
|
3053
|
+
.mp-code[data-mp-code-theme='mono'] .hljs-built_in {
|
|
3054
|
+
font-weight: 600;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
/*
|
|
3058
|
+
* One line.
|
|
3059
|
+
*
|
|
3060
|
+
* A flex row rather than a block, because the number and the prompt are
|
|
3061
|
+
* pseudo-elements that have to sit *before* the code and hold their own width.
|
|
3062
|
+
* `order` is what lets one of them come before the other and both before the
|
|
3063
|
+
* code, since `::after` would otherwise draw last.
|
|
3064
|
+
*
|
|
3065
|
+
* `min-height` keeps a blank line a line high. A flex row with nothing in it is
|
|
3066
|
+
* zero pixels tall, and a block that closed up its own paragraph breaks would
|
|
3067
|
+
* be reflowing the reader's file.
|
|
3068
|
+
*/
|
|
3069
|
+
.mp-code-line {
|
|
3070
|
+
display: flex;
|
|
3071
|
+
min-height: 1.5em;
|
|
3072
|
+
min-height: 1lh;
|
|
3073
|
+
/* Transparent on every line, coloured on a marked one. A border rather than
|
|
3074
|
+
an inset `box-shadow` because `box-shadow` has no logical form and this one
|
|
3075
|
+
has to sit on the *start* edge in both writing directions; drawn on all of
|
|
3076
|
+
them so marking a line does not shift its text two pixels sideways. */
|
|
3077
|
+
border-inline-start: 2px solid transparent;
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
/*
|
|
3081
|
+
* A marked line, and the reason the horizontal padding is on the line rather
|
|
3082
|
+
* than on the box that scrolls it.
|
|
3083
|
+
*
|
|
3084
|
+
* A tint that stopped at the padding would be a stripe floating inside the
|
|
3085
|
+
* block instead of a marked row. With the padding here the line box *is* the
|
|
3086
|
+
* row, so it reaches both edges — and because the lines sit in a
|
|
3087
|
+
* `w-max min-w-full` block, every one of them reaches the same edge whether the
|
|
3088
|
+
* code is narrower than the block or scrolled sideways within it.
|
|
3089
|
+
*/
|
|
3090
|
+
.mp-code-line[data-mark] {
|
|
3091
|
+
background: var(--mp-code-mark);
|
|
3092
|
+
border-inline-start-color: var(--mp-code-mark-edge);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.mp-code-line[data-line]::before {
|
|
3096
|
+
content: attr(data-line);
|
|
3097
|
+
order: 0;
|
|
3098
|
+
flex: none;
|
|
3099
|
+
width: var(--mp-code-gutter, 2ch);
|
|
3100
|
+
margin-inline-end: 1.25em;
|
|
3101
|
+
text-align: end;
|
|
3102
|
+
color: var(--mp-code-dim);
|
|
3103
|
+
-webkit-user-select: none;
|
|
3104
|
+
user-select: none;
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
.mp-code-line[data-prompt]::after {
|
|
3108
|
+
content: attr(data-prompt);
|
|
3109
|
+
order: 1;
|
|
3110
|
+
flex: none;
|
|
3111
|
+
margin-inline-end: 0.75em;
|
|
3112
|
+
color: var(--mp-code-dim);
|
|
3113
|
+
-webkit-user-select: none;
|
|
3114
|
+
user-select: none;
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
.mp-code-line > code {
|
|
3118
|
+
order: 2;
|
|
3119
|
+
min-width: 0;
|
|
3120
|
+
font: inherit;
|
|
3121
|
+
background: none;
|
|
3122
|
+
padding: 0;
|
|
3123
|
+
white-space: pre;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
.mp-code[data-mp-code-wrap='true'] .mp-code-line > code {
|
|
3127
|
+
white-space: pre-wrap;
|
|
3128
|
+
overflow-wrap: anywhere;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
/*
|
|
3132
|
+
* highlight.js's scopes, mapped onto the twelve slots.
|
|
3133
|
+
*
|
|
3134
|
+
* Grouped by what a run *is* rather than by what highlight.js calls it, because
|
|
3135
|
+
* those names are the union of a hundred and ninety grammars and half of them
|
|
3136
|
+
* are one language's word for another language's idea — `selector-tag`, `tag`
|
|
3137
|
+
* and `name` are all "the thing being declared". The point of the mapping is
|
|
3138
|
+
* that the same idea gets the same colour whatever file it turns up in.
|
|
3139
|
+
*/
|
|
3140
|
+
.mp-code .hljs-comment,
|
|
3141
|
+
.mp-code .hljs-quote {
|
|
3142
|
+
color: var(--mp-code-comment);
|
|
3143
|
+
font-style: italic;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
.mp-code .hljs-keyword,
|
|
3147
|
+
.mp-code .hljs-literal,
|
|
3148
|
+
.mp-code .hljs-selector-tag,
|
|
3149
|
+
.mp-code .hljs-operator,
|
|
3150
|
+
.mp-code .hljs-doctag,
|
|
3151
|
+
.mp-code .hljs-formula {
|
|
3152
|
+
color: var(--mp-code-keyword);
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
.mp-code .hljs-string,
|
|
3156
|
+
.mp-code .hljs-regexp,
|
|
3157
|
+
.mp-code .hljs-char,
|
|
3158
|
+
.mp-code .hljs-link {
|
|
3159
|
+
color: var(--mp-code-string);
|
|
3160
|
+
}
|
|
3161
|
+
|
|
3162
|
+
.mp-code .hljs-number,
|
|
3163
|
+
.mp-code .hljs-symbol,
|
|
3164
|
+
.mp-code .hljs-bullet {
|
|
3165
|
+
color: var(--mp-code-number);
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
.mp-code .hljs-title,
|
|
3169
|
+
.mp-code .hljs-section,
|
|
3170
|
+
.mp-code .hljs-name,
|
|
3171
|
+
.mp-code .hljs-selector-id,
|
|
3172
|
+
.mp-code .hljs-selector-class {
|
|
3173
|
+
color: var(--mp-code-function);
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3176
|
+
.mp-code .hljs-type,
|
|
3177
|
+
.mp-code .hljs-built_in,
|
|
3178
|
+
.mp-code .hljs-class {
|
|
3179
|
+
color: var(--mp-code-type);
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
.mp-code .hljs-variable,
|
|
3183
|
+
.mp-code .hljs-template-variable,
|
|
3184
|
+
.mp-code .hljs-params,
|
|
3185
|
+
.mp-code .hljs-subst {
|
|
3186
|
+
color: var(--mp-code-variable);
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
.mp-code .hljs-tag,
|
|
3190
|
+
.mp-code .hljs-template-tag {
|
|
3191
|
+
color: var(--mp-code-tag);
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3194
|
+
.mp-code .hljs-attr,
|
|
3195
|
+
.mp-code .hljs-attribute,
|
|
3196
|
+
.mp-code .hljs-property,
|
|
3197
|
+
.mp-code .hljs-selector-attr,
|
|
3198
|
+
.mp-code .hljs-selector-pseudo {
|
|
3199
|
+
color: var(--mp-code-attr);
|
|
3200
|
+
}
|
|
3201
|
+
|
|
3202
|
+
.mp-code .hljs-meta,
|
|
3203
|
+
.mp-code .hljs-punctuation {
|
|
3204
|
+
color: var(--mp-code-meta);
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
.mp-code .hljs-addition {
|
|
3208
|
+
color: var(--mp-code-add);
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
.mp-code .hljs-deletion {
|
|
3212
|
+
color: var(--mp-code-del);
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
.mp-code .hljs-emphasis {
|
|
3216
|
+
font-style: italic;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
.mp-code .hljs-strong {
|
|
3220
|
+
font-weight: 700;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
/* ---------------------------------------------------------------------------
|
|
3224
|
+
* The tree's guide lines
|
|
3225
|
+
*
|
|
3226
|
+
* A rail down each level and, in `folder`, an elbow into each row. Real CSS
|
|
3227
|
+
* rather than utilities for the reason the grid's breakpoints are: a rail is a
|
|
3228
|
+
* pseudo-element positioned half an indent *outside* the row it belongs to, and
|
|
3229
|
+
* the rail under a last child is a different height from the rest.
|
|
3230
|
+
* `[&:last-child]:[&::before]:…` is expressible and nobody would want to read
|
|
3231
|
+
* it.
|
|
3232
|
+
*
|
|
3233
|
+
* The two lengths come from the component as custom properties, because both
|
|
3234
|
+
* are on a ladder: the rail sits half an indent out, and the elbow crosses at
|
|
3235
|
+
* half a row's height. Written as numbers here they would be right at one rung
|
|
3236
|
+
* and wrong at the other four.
|
|
3237
|
+
*
|
|
3238
|
+
* `lines="none"` needs no rule at all, which is why there is no class for it.
|
|
3239
|
+
* ------------------------------------------------------------------------- */
|
|
3240
|
+
|
|
3241
|
+
.mp-tree--simple ul[role='group'] > li,
|
|
3242
|
+
.mp-tree--folder ul[role='group'] > li {
|
|
3243
|
+
position: relative;
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
.mp-tree--simple ul[role='group'] > li::before,
|
|
3247
|
+
.mp-tree--folder ul[role='group'] > li::before {
|
|
3248
|
+
content: '';
|
|
3249
|
+
position: absolute;
|
|
3250
|
+
inset-block: 0;
|
|
3251
|
+
inset-inline-start: calc(var(--_mp-tree-indent) / -2);
|
|
3252
|
+
border-inline-start: 1px solid var(--_mp-color-outline-variant);
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
/*
|
|
3256
|
+
* The rail under a last child stops at the row it points at rather than running
|
|
3257
|
+
* on into nothing. That is the whole difference between the two drawings: a
|
|
3258
|
+
* `simple` rail says "this level continues", and a `folder` one says where it
|
|
3259
|
+
* ends.
|
|
3260
|
+
*/
|
|
3261
|
+
.mp-tree--folder ul[role='group'] > li:last-child::before {
|
|
3262
|
+
inset-block-end: auto;
|
|
3263
|
+
block-size: calc(var(--_mp-tree-row) / 2);
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
.mp-tree--folder ul[role='group'] > li::after {
|
|
3267
|
+
content: '';
|
|
3268
|
+
position: absolute;
|
|
3269
|
+
inset-block-start: calc(var(--_mp-tree-row) / 2);
|
|
3270
|
+
inset-inline-start: calc(var(--_mp-tree-indent) / -2);
|
|
3271
|
+
inline-size: calc(var(--_mp-tree-indent) / 2 - 2px);
|
|
3272
|
+
border-block-start: 1px solid var(--_mp-color-outline-variant);
|
|
3273
|
+
}
|