From 3210882086fc3bbc7099331a6ec672794a9b3bfa Mon Sep 17 00:00:00 2001 From: aluarius Date: Fri, 13 Jan 2023 15:37:10 +0700 Subject: [PATCH 01/14] wip --- packages/ui/src/components/index.ts | 1 + .../va-aspect-ratio/VaAspectRatio.vue | 40 +++ .../va-aspect-ratio/_variables.scss | 4 + .../src/components/va-aspect-ratio/index.ts | 4 + .../src/components/va-carousel/VaCarousel.vue | 2 +- .../src/components/va-image/VaImage.demo.vue | 303 ++++++++---------- .../ui/src/components/va-image/VaImage.vue | 216 +++++++++---- .../src/components/va-image/_variables.scss | 5 +- .../va-image/hooks/useNativeImgAttributes.ts | 49 +++ .../ui/src/services/vue-plugin/components.ts | 1 + 10 files changed, 381 insertions(+), 244 deletions(-) create mode 100644 packages/ui/src/components/va-aspect-ratio/VaAspectRatio.vue create mode 100644 packages/ui/src/components/va-aspect-ratio/_variables.scss create mode 100644 packages/ui/src/components/va-aspect-ratio/index.ts create mode 100644 packages/ui/src/components/va-image/hooks/useNativeImgAttributes.ts diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 34e9c9198a..fff5670cc1 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -13,6 +13,7 @@ export * from './va-accordion' export * from './va-affix' export * from './va-alert' export * from './va-app-bar' +export * from './va-aspect-ratio' export * from './va-avatar' export * from './va-avatar-group' export * from './va-backtop' diff --git a/packages/ui/src/components/va-aspect-ratio/VaAspectRatio.vue b/packages/ui/src/components/va-aspect-ratio/VaAspectRatio.vue new file mode 100644 index 0000000000..70bbbbec71 --- /dev/null +++ b/packages/ui/src/components/va-aspect-ratio/VaAspectRatio.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/packages/ui/src/components/va-aspect-ratio/_variables.scss b/packages/ui/src/components/va-aspect-ratio/_variables.scss new file mode 100644 index 0000000000..068cb4e486 --- /dev/null +++ b/packages/ui/src/components/va-aspect-ratio/_variables.scss @@ -0,0 +1,4 @@ +:root { + --va-aspect-ratio-position: relative; + --va-aspect-ratio-overflow: hidden; +} diff --git a/packages/ui/src/components/va-aspect-ratio/index.ts b/packages/ui/src/components/va-aspect-ratio/index.ts new file mode 100644 index 0000000000..686e93fc1d --- /dev/null +++ b/packages/ui/src/components/va-aspect-ratio/index.ts @@ -0,0 +1,4 @@ +import withConfigTransport from '../../services/config-transport/withConfigTransport' +import _VaAspectRatio from './VaAspectRatio.vue' + +export const VaAspectRatio = withConfigTransport(_VaAspectRatio) diff --git a/packages/ui/src/components/va-carousel/VaCarousel.vue b/packages/ui/src/components/va-carousel/VaCarousel.vue index 1dc8a476ca..dd75f887f9 100644 --- a/packages/ui/src/components/va-carousel/VaCarousel.vue +++ b/packages/ui/src/components/va-carousel/VaCarousel.vue @@ -336,7 +336,7 @@ export default defineComponent({ } } - .va-image { + .va-aspect-ratio { height: 100%; width: 100%; } diff --git a/packages/ui/src/components/va-image/VaImage.demo.vue b/packages/ui/src/components/va-image/VaImage.demo.vue index af182eaf33..83549b0470 100644 --- a/packages/ui/src/components/va-image/VaImage.demo.vue +++ b/packages/ui/src/components/va-image/VaImage.demo.vue @@ -1,217 +1,174 @@ - diff --git a/packages/ui/src/components/va-image/VaImage.vue b/packages/ui/src/components/va-image/VaImage.vue index 340d7eb91e..92cff2c54d 100644 --- a/packages/ui/src/components/va-image/VaImage.vue +++ b/packages/ui/src/components/va-image/VaImage.vue @@ -1,122 +1,206 @@ diff --git a/packages/ui/src/components/va-image/_variables.scss b/packages/ui/src/components/va-image/_variables.scss index 2e1a9fcc47..f6e3009fb6 100644 --- a/packages/ui/src/components/va-image/_variables.scss +++ b/packages/ui/src/components/va-image/_variables.scss @@ -1,6 +1,3 @@ :root { - --va-image-overflow: hidden; - --va-image-position: relative; - --va-image-img-background-position: 50% 50%; - --va-image-img-background-repeat: no-repeat; + --va-image-object-position: 50% 50%; } diff --git a/packages/ui/src/components/va-image/hooks/useNativeImgAttributes.ts b/packages/ui/src/components/va-image/hooks/useNativeImgAttributes.ts new file mode 100644 index 0000000000..7b2a382a48 --- /dev/null +++ b/packages/ui/src/components/va-image/hooks/useNativeImgAttributes.ts @@ -0,0 +1,49 @@ +import { computed, type ExtractPropTypes, type PropType } from 'vue' +import pick from 'lodash/pick' + +const referrerPolicyOptions = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const +const loadingOptions = ['lazy', 'eager'] as const +const crossoriginOptions = ['anonymous', 'use-credentials'] as const +const decodingOptions = ['auto', 'sync', 'async'] as const +const fetchpriorityOptions = ['auto', 'high', 'low'] as const + +export const validateProp = (v: string, arr: Readonly) => arr.includes(v) + +export const useNativeImgAttributesProps = { + src: { type: String, required: true }, + alt: { type: String, default: '' }, + title: { type: String, default: '' }, + sizes: { type: String, default: '' }, + scrset: { type: String, default: '' }, + lazy: { type: Boolean, default: false }, + notDraggable: { type: Boolean, default: false }, + loading: { + type: String as PropType, + default: 'lazy', + validator: (v: string) => validateProp(v, loadingOptions), + }, + crossorigin: { + type: String as PropType, + validator: (v: string) => validateProp(v, crossoriginOptions), + }, + decoding: { + type: String as PropType, + validator: (v: string) => validateProp(v, decodingOptions), + }, + fetchpriority: { + type: String as PropType, + default: 'auto', + validator: (v: string) => validateProp(v, fetchpriorityOptions), + }, + referrerpolicy: { + type: String as PropType, + validator: (v: string) => validateProp(v, referrerPolicyOptions), + }, +} + +export const useNativeImgAttributes = (props: ExtractPropTypes) => { + return computed(() => ({ + ...pick(props, ['src', 'alt', 'title', 'sizes', 'scrset', 'lazy', 'loading', 'referrerpolicy', 'fetchpriority', 'decoding', 'crossorigin']), + draggable: !props.notDraggable, + })) +} diff --git a/packages/ui/src/services/vue-plugin/components.ts b/packages/ui/src/services/vue-plugin/components.ts index 85375b347d..e82a278f65 100644 --- a/packages/ui/src/services/vue-plugin/components.ts +++ b/packages/ui/src/services/vue-plugin/components.ts @@ -3,6 +3,7 @@ export { VaAffix, VaAlert, VaAppBar, + VaAspectRatio, VaAvatar, VaAvatarGroup, VaBacktop, From 00dbafd049d246b0bdeb61d77146a9db00789285 Mon Sep 17 00:00:00 2001 From: aluarius Date: Fri, 13 Jan 2023 15:40:00 +0700 Subject: [PATCH 02/14] merge --- packages/docs/.gitignore | 2 + packages/docs/package.json | 8 +- packages/docs/postcss.config.js | 6 + packages/docs/src/assets/main.scss | 1 + packages/docs/src/assets/tailwind.scss | 3 + packages/docs/src/components/DocsContent.vue | 2 +- .../header/components/LanguageDropdown.vue | 7 +- .../src/components/landing/LandingFooter.vue | 2 +- .../docs/src/helpers/CodeSandboxExample.ts | 6 +- packages/docs/src/layouts/default.vue | 2 +- packages/docs/src/locales/en/en.json | 14 +- packages/docs/src/locales/ru/ru.json | 6 +- .../tree-shaking/page-config.ts | 2 +- .../roadmap/components/roadmap.vue | 2 +- .../colors-config/examples/change-colors.vue | 2 +- .../colors-config/examples/css-variable.vue | 4 +- .../services/colors-config/page-config.ts | 16 +- .../components-config/examples/button.vue | 2 +- .../components-config/examples/presets.vue | 2 +- .../components-config/examples/priority.vue | 2 +- .../icons-config/components/playground.vue | 5 +- .../components/component-examples.vue | 4 +- .../styles/css-variables/examples/profile.vue | 4 +- .../styles/grid/examples/AlignContent.vue | 30 +- .../styles/grid/examples/AlignDefault.vue | 8 +- .../styles/grid/examples/AlignJustify.vue | 36 +- .../styles/grid/examples/AlignSelf.vue | 8 +- .../styles/grid/examples/Breakpoints.vue | 12 +- .../styles/grid/examples/Default.vue | 2 +- .../styles/grid/examples/Gutters.vue | 8 +- .../styles/grid/examples/Offsets.vue | 12 +- .../styles/smart-helpers/examples/Gutters.vue | 10 +- .../styles/smart-helpers/examples/Spacing.vue | 12 +- .../ui-elements/alert/examples/Border.vue | 10 +- .../ui-elements/alert/examples/Center.vue | 4 +- .../ui-elements/alert/examples/Closeable.vue | 10 +- .../ui-elements/alert/examples/Color.vue | 14 +- .../ui-elements/alert/examples/Default.vue | 2 +- .../ui-elements/alert/examples/Dense.vue | 6 +- .../ui-elements/alert/examples/Icon.vue | 4 +- .../ui-elements/alert/examples/Styles.vue | 6 +- .../ui-elements/alert/examples/Title.vue | 4 +- .../ui-elements/avatar/examples/Color.vue | 12 +- .../ui-elements/avatar/examples/Default.vue | 2 +- .../ui-elements/avatar/examples/Fallback.vue | 2 +- .../ui-elements/avatar/examples/Size.vue | 6 +- .../ui-elements/avatar/examples/Square.vue | 2 +- .../ui-elements/avatar/examples/WithIcon.vue | 2 +- .../ui-elements/avatar/examples/WithImage.vue | 2 +- .../ui-elements/backtop/examples/Default.vue | 2 +- .../ui-elements/badge/examples/Color.vue | 8 +- .../ui-elements/badge/examples/Default.vue | 2 +- .../ui-elements/badge/examples/Dot.vue | 2 +- .../ui-elements/badge/examples/Overlap.vue | 2 +- .../ui-elements/badge/examples/Position.vue | 4 +- .../badge/examples/Transparent.vue | 2 +- .../badge/examples/WithOtherComponents.vue | 6 +- .../breadcrumbs/examples/Separator.vue | 6 +- .../button-dropdown/examples/ClickInside.vue | 2 +- .../button-group/examples/Colors.vue | 6 +- .../button-group/examples/Gradient.vue | 6 +- .../button-group/examples/Icons.vue | 4 +- .../button-group/examples/Sizes.vue | 4 +- .../button-group/examples/Styles.vue | 14 +- .../button-toggle/examples/Colors.vue | 4 +- .../button-toggle/examples/Disabled.vue | 2 +- .../button-toggle/examples/Gradient.vue | 6 +- .../button-toggle/examples/Icons.vue | 2 +- .../button-toggle/examples/Sizes.vue | 2 +- .../button-toggle/examples/Styles.vue | 8 +- .../ui-elements/button/examples/Behavior.vue | 4 +- .../ui-elements/button/examples/Disabled.vue | 10 +- .../ui-elements/button/examples/Presets.vue | 8 +- .../ui-elements/button/examples/Tag.vue | 4 +- .../ui-elements/button/examples/WithColor.vue | 6 +- .../button/examples/WithGradient.vue | 6 +- .../button/examples/WithLoading.vue | 6 +- .../button/examples/WithOutline.vue | 4 +- .../ui-elements/button/examples/WithRound.vue | 6 +- .../ui-elements/button/examples/WithSize.vue | 6 +- .../ui-elements/card/examples/Actions.vue | 4 +- .../card/examples/BorderAndShape.vue | 4 +- .../card/examples/ColorAndGradient.vue | 2 +- .../ui-elements/card/examples/Default.vue | 2 +- .../ui-elements/card/examples/Disabled.vue | 2 +- .../ui-elements/card/examples/Horizontal.vue | 6 +- .../ui-elements/card/examples/Image.vue | 2 +- .../ui-elements/card/examples/Link.vue | 2 +- .../ui-elements/card/examples/Stripe.vue | 2 +- .../ui-elements/card/examples/Tag.vue | 2 +- .../ui-elements/checkbox/examples/Array.vue | 10 +- .../checkbox/examples/Coloring.vue | 4 +- .../ui-elements/checkbox/examples/Label.vue | 6 +- .../ui-elements/chip/examples/Color.vue | 2 +- .../ui-elements/chip/examples/Icon.vue | 4 +- .../ui-elements/chip/examples/Size.vue | 2 +- .../ui-elements/collapse/examples/Color.vue | 8 +- .../ui-elements/counter/examples/Buttons.vue | 6 +- .../counter/examples/ButtonsStyle.vue | 8 +- .../ui-elements/counter/examples/Default.vue | 6 +- .../ui-elements/counter/examples/Hint.vue | 4 +- .../counter/examples/IconsColors.vue | 6 +- .../counter/examples/MaxMinStep.vue | 4 +- .../ui-elements/counter/examples/Slots.vue | 6 +- .../ui-elements/counter/examples/State.vue | 8 +- .../ui-elements/counter/examples/Style.vue | 6 +- .../ui-elements/counter/examples/Width.vue | 4 +- .../data-table/examples/Binding.vue | 6 +- .../ui-elements/data-table/examples/CRUD.vue | 4 +- .../data-table/examples/Filtering.vue | 4 +- .../ui-elements/data-table/examples/Other.vue | 6 +- .../data-table/examples/Pagination.vue | 6 +- .../data-table/examples/Selection.vue | 6 +- .../data-table/examples/Sorting.vue | 4 +- .../data-table/examples/Styling.vue | 22 +- .../ui-elements/date-input/examples/View.vue | 8 +- .../date-input/examples/inputProps.vue | 14 +- .../ui-elements/date-input/examples/mode.vue | 6 +- .../date-input/examples/resetOnClose.vue | 4 +- .../date-input/examples/validation.vue | 4 +- .../date-picker/examples/Color.vue | 6 +- .../date-picker/examples/Disabled.vue | 6 +- .../date-picker/examples/DisabledDates.vue | 6 +- .../date-picker/examples/FirstWeekday.vue | 4 +- .../ui-elements/date-picker/examples/Mode.vue | 6 +- .../date-picker/examples/Readonly.vue | 6 +- .../date-picker/examples/Stateful.vue | 6 +- .../ui-elements/date-picker/examples/Type.vue | 6 +- .../ui-elements/date-picker/examples/View.vue | 6 +- .../date-picker/examples/Weekends.vue | 4 +- .../divider/examples/CustomContent.vue | 10 +- .../ui-elements/divider/examples/Dashed.vue | 8 +- .../ui-elements/divider/examples/Default.vue | 2 +- .../ui-elements/divider/examples/Inset.vue | 2 +- .../ui-elements/divider/examples/Vertical.vue | 8 +- .../ui-elements/divider/examples/WithList.vue | 12 +- .../dropdown/examples/PlacementAndOffset.vue | 2 +- .../ui-elements/file-upload/examples/Undo.vue | 8 +- .../ui-elements/form/examples/WithInputs.vue | 2 +- .../ui-elements/icon/examples/Rotation.vue | 4 +- .../ui-elements/image/examples/Contain.vue | 4 +- .../ui-elements/image/examples/Default.vue | 2 +- .../image/examples/DefaultSlot.vue | 2 +- .../ui-elements/image/examples/ErrorSlot.vue | 2 +- .../ui-elements/image/examples/LoaderSlot.vue | 2 +- .../ui-elements/image/examples/Ratio.vue | 4 +- .../infinite-scroll/examples/CustomTarget.vue | 4 +- .../infinite-scroll/examples/Default.vue | 2 +- .../infinite-scroll/examples/Disabled.vue | 2 +- .../infinite-scroll/examples/Reverse.vue | 2 +- .../ui-elements/input/examples/Default.vue | 6 +- .../input/examples/ExtendedDefault.vue | 14 +- .../ui-elements/input/examples/Hint.vue | 4 +- .../ui-elements/input/examples/Mask.vue | 12 +- .../ui-elements/input/examples/Slots.vue | 8 +- .../ui-elements/input/examples/Styles.vue | 20 +- .../ui-elements/input/examples/Textarea.vue | 8 +- .../ui-elements/input/examples/Types.vue | 12 +- .../ui-elements/input/examples/Validate.vue | 10 +- .../ui-elements/modal/examples/Anchor.vue | 4 +- .../ui-elements/modal/examples/Create.vue | 4 +- .../modal/examples/HidingOverlay.vue | 4 +- .../modal/examples/ModalSizing.vue | 4 +- .../modal/examples/NestedModals.vue | 2 +- .../modal/examples/ScrollingLongContent.vue | 4 +- .../modal/examples/ToggleVisibility.vue | 4 +- .../ui-elements/navbar/examples/Height.vue | 2 +- .../pagination/examples/ActiveColor.vue | 4 +- .../pagination/examples/Bordered.vue | 4 +- .../pagination/examples/Colors.vue | 2 +- .../pagination/examples/Gapped.vue | 4 +- .../pagination/examples/Presets.vue | 4 +- .../pagination/examples/Rounded.vue | 4 +- .../ui-elements/pagination/examples/Sizes.vue | 4 +- .../ui-elements/parallax/examples/Slot.vue | 8 +- .../progress-bar/examples/Buffer.vue | 4 +- .../progress-bar/examples/Coloring.vue | 2 +- .../progress-bar/examples/Default.vue | 2 +- .../progress-bar/examples/Indeterminate.vue | 2 +- .../ui-elements/progress-bar/examples/Max.vue | 2 +- .../progress-bar/examples/Sizing.vue | 2 +- .../progress-bar/examples/Slots.vue | 6 +- .../progress-circle/examples/Coloring.vue | 2 +- .../progress-circle/examples/Default.vue | 2 +- .../examples/Indeterminate.vue | 2 +- .../progress-circle/examples/Sizing.vue | 2 +- .../progress-circle/examples/Slots.vue | 2 +- .../progress-circle/examples/Thickness.vue | 2 +- .../ui-elements/rating/examples/Numbers.vue | 2 +- .../select/examples/AllowCreate.vue | 6 +- .../select/examples/Decorators.vue | 24 +- .../select/examples/ObjectOptions.vue | 10 +- .../ui-elements/select/examples/Slots.vue | 12 +- .../ui-elements/select/examples/State.vue | 12 +- .../ui-elements/select/examples/Styles.vue | 10 +- .../ui-elements/select/examples/Tagging.vue | 2 +- .../ui-elements/select/examples/TrackBy.vue | 4 +- .../select/examples/Variations.vue | 4 +- .../ui-elements/sidebar/examples/Color.vue | 8 +- .../ui-elements/sidebar/examples/Gradient.vue | 2 +- .../slider/examples/TrackLabel.vue | 6 +- .../ui-elements/slider/examples/Vertical.vue | 6 +- .../split/examples/CustomGrabber.vue | 4 +- .../split/examples/CustomLimits.vue | 4 +- .../ui-elements/split/examples/Disabled.vue | 4 +- .../split/examples/Maximization.vue | 4 +- .../ui-elements/split/examples/Nested.vue | 15 +- .../ui-elements/split/examples/Snapping.vue | 4 +- .../ui-elements/split/examples/Vertical.vue | 4 +- .../ui-elements/switch/examples/Color.vue | 8 +- .../ui-elements/switch/examples/Error.vue | 6 +- .../switch/examples/InnerLabel.vue | 4 +- .../ui-elements/switch/examples/Label.vue | 18 +- .../ui-elements/switch/examples/Size.vue | 6 +- .../ui-elements/switch/examples/State.vue | 4 +- .../time-input/examples/validation.vue | 2 +- .../tree-view/examples/Selectable.vue | 23 +- .../tree-view/examples/SelectableColored.vue | 81 + .../ui-elements/tree-view/page-config.ts | 2 + .../examples/DifferentContent.vue | 2 +- packages/docs/tailwind.config.js | 8 + packages/docs/tsconfig.json | 2 + packages/sandbox/.gitignore | 5 +- packages/sandbox/README.md | 8 +- packages/sandbox/analysis/.keep | 0 .../sandbox/configs/vite/common-config.ts | 8 +- packages/sandbox/package.json | 7 +- packages/sandbox/scripts/bundle-analysis.ts | 52 +- packages/sandbox/src/app.vue | 2 +- packages/sandbox/test/tree-shaking.test.ts | 1 - .../va-avatar-group/VaAvatarGroup.demo.vue | 6 +- .../components/va-avatar/VaAvatar.demo.vue | 12 +- .../va-breadcrumbs/VaBreadcrumbs.vue | 6 +- .../va-button/hooks/useButtonTextColor.ts | 57 +- .../ui/src/components/va-card/VaCard.demo.vue | 14 +- .../src/components/va-checkbox/VaCheckbox.vue | 8 +- .../src/components/va-counter/VaCounter.vue | 6 +- .../va-date-input/VaDateInput.demo.vue | 44 +- .../va-date-picker/VaDatePicker.demo.vue | 28 +- .../va-file-upload/VaFileUpload.demo.vue | 2 +- .../src/components/va-input/VaInput.demo.vue | 14 +- .../ui/src/components/va-input/VaInput.vue | 10 +- .../src/components/va-input/_variables.scss | 1 - .../VaInputWrapper/VaInputWrapper.vue | 7 +- .../src/components/va-modal/VaModal.demo.vue | 4 +- .../components/va-navbar/VaNavbar.demo.vue | 2 +- .../ui/src/components/va-navbar/VaNavbar.vue | 26 +- .../src/components/va-navbar/_variables.scss | 4 +- .../components/va-popover/VaPopover.demo.vue | 22 +- .../va-progress-bar/VaProgressBar.vue | 4 +- .../va-progress-circle/VaProgressCircle.vue | 4 +- .../components/va-select/VaSelect.demo.vue | 128 +- .../ui/src/components/va-slider/VaSlider.vue | 4 +- .../ui/src/components/va-switch/VaSwitch.vue | 6 +- .../components/va-time-input/VaTimeInput.vue | 10 +- .../va-time-picker/VaTimePicker.demo.vue | 4 +- .../VaTreeViewKeyboardNavigation.demo.vue | 188 ++ .../components/VaTreeNode/VaTreeNode.vue | 48 +- .../va-tree-view/hooks/useTreeHelpers.ts | 6 +- .../hooks/useTreeKeyboardNavigation.ts | 170 ++ .../va-tree-view/hooks/useTreeView.ts | 24 +- .../ui/src/components/va-tree-view/types.ts | 10 +- .../VaVirtualScroller.demo.vue | 2 +- .../color/ColorCSSVariablesUpdater.demo.vue | 2 +- .../src/styles/global/color-themes.demo.vue | 10 +- .../src/styles/grid/_grid-global-styles.scss | 65 +- packages/ui/src/styles/grid/_grid-mixins.scss | 8 - .../ui/src/styles/grid/_grid-spacing.scss | 103 +- packages/ui/src/vue-book/book-main.scss | 1 + yarn.lock | 2188 ++++++++++++++--- 270 files changed, 3343 insertions(+), 1339 deletions(-) create mode 100644 packages/docs/postcss.config.js create mode 100644 packages/docs/src/assets/tailwind.scss create mode 100644 packages/docs/src/page-configs/ui-elements/tree-view/examples/SelectableColored.vue create mode 100644 packages/docs/tailwind.config.js create mode 100644 packages/sandbox/analysis/.keep create mode 100644 packages/ui/src/components/va-tree-view/VaTreeViewKeyboardNavigation.demo.vue create mode 100644 packages/ui/src/components/va-tree-view/hooks/useTreeKeyboardNavigation.ts diff --git a/packages/docs/.gitignore b/packages/docs/.gitignore index 403adbc1e5..0d4d40fc09 100644 --- a/packages/docs/.gitignore +++ b/packages/docs/.gitignore @@ -21,3 +21,5 @@ pnpm-debug.log* *.njsproj *.sln *.sw? + +tree-shaking.md diff --git a/packages/docs/package.json b/packages/docs/package.json index 73e2cb69a6..6af176bb87 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -3,10 +3,10 @@ "version": "0.0.0", "private": true, "scripts": { - "serve": "yarn build:analysis && vue-cli-service serve", + "serve": "yarn build:analysis --use-cache && vue-cli-service serve", "build": "yarn build:analysis && vue-cli-service build", "build:ci": "yarn build:analysis && vue-cli-service build", - "build:analysis": "npx lerna run build:bundle-analysis --scope=sandbox", + "build:analysis": "yarn workspace sandbox build:analysis ../docs/src/page-configs/getting-started/tree-shaking", "lint": "vue-cli-service lint", "lint:style": "stylelint '**/*.{vue,html,css,scss}' --fix", "test:unit": "vue-cli-service test:unit", @@ -40,6 +40,7 @@ "vue-router": "^4.0.3" }, "devDependencies": { + "@tailwindcss/postcss7-compat": "^2.2.17", "@types/dedent": "^0.7.0", "@types/jest": "^26.0.20", "@types/lodash": "^4.14.168", @@ -57,6 +58,7 @@ "@vue/compiler-sfc": "^3.0.5", "@vue/eslint-config-standard": "^6.0.0", "@vue/eslint-config-typescript": "^7.0.0", + "autoprefixer": "^9", "eslint": "^7.19.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", @@ -66,9 +68,11 @@ "i18n-unused": "^0.4.2", "lint-staged": "^11.1.2", "plop": "^2.7.0", + "postcss": "^7", "sass-loader": "^10.1.1", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", + "tailwindcss": "npm:@tailwindcss/postcss7-compat", "ts-jest": "^26.5.4", "ts-node": "^10.9.1", "typescript": "^4.2.4", diff --git a/packages/docs/postcss.config.js b/packages/docs/postcss.config.js new file mode 100644 index 0000000000..33ad091d26 --- /dev/null +++ b/packages/docs/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/packages/docs/src/assets/main.scss b/packages/docs/src/assets/main.scss index 719e146e61..27b0cc0007 100644 --- a/packages/docs/src/assets/main.scss +++ b/packages/docs/src/assets/main.scss @@ -3,3 +3,4 @@ @import "./smart-grid.scss"; @import "./colors.scss"; @import "./fonts.scss"; +@import "./tailwind.scss"; diff --git a/packages/docs/src/assets/tailwind.scss b/packages/docs/src/assets/tailwind.scss new file mode 100644 index 0000000000..52ac7366df --- /dev/null +++ b/packages/docs/src/assets/tailwind.scss @@ -0,0 +1,3 @@ +//@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/packages/docs/src/components/DocsContent.vue b/packages/docs/src/components/DocsContent.vue index 94ba58e688..0e4a534a68 100644 --- a/packages/docs/src/components/DocsContent.vue +++ b/packages/docs/src/components/DocsContent.vue @@ -89,7 +89,7 @@ :header="block.header" solid > -
+
diff --git a/packages/docs/src/components/header/components/LanguageDropdown.vue b/packages/docs/src/components/header/components/LanguageDropdown.vue index ddaf613749..ad9c97b989 100644 --- a/packages/docs/src/components/header/components/LanguageDropdown.vue +++ b/packages/docs/src/components/header/components/LanguageDropdown.vue @@ -10,7 +10,7 @@ @@ -19,7 +19,7 @@ @@ -70,7 +70,8 @@ export default defineComponent({ } &__item { - padding-bottom: 0.625rem; + @apply py-1.5; + cursor: pointer; flex-wrap: nowrap; font-weight: 600; diff --git a/packages/docs/src/components/landing/LandingFooter.vue b/packages/docs/src/components/landing/LandingFooter.vue index 9b9c043954..1fd9e57bf0 100644 --- a/packages/docs/src/components/landing/LandingFooter.vue +++ b/packages/docs/src/components/landing/LandingFooter.vue @@ -2,7 +2,7 @@