diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a4422081d..ca030f09c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: directory: "/" schedule: interval: "weekly" - day: "friday" + day: "wednesday" time: "00:00" groups: babel: @@ -20,7 +20,7 @@ updates: directory: "/" schedule: interval: "weekly" - day: "friday" + day: "wednesday" time: "00:00" groups: github: diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 000000000..1e2558f89 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,19 @@ +name: Publish (pre)release to npm + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '10.x' + registry-url: 'https://registry.npmjs.org' + - run: npm publish + env: + # NPM_API_TOKEN is an organization-level secret + NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4da679bb8..b050b52d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Changelog is rather internal in nature. See release notes for the public overview and guidelines. Releases are recorded as git tags in the [Github releases](https://github.com/learningequality/kolibri-design-system/releases) page. -## Upcoming version +## Upcoming version 5.x.x (`develop` branch) - [#555] - **Description:** Add action to notify us on Slack about GH issues comments from contributors community @@ -12,8 +12,91 @@ Changelog is rather internal in nature. See release notes for the public overvie - **Breaking:** - - **Impacts a11y:** - - **Guidance:** - + +[#555]: https://github.com/learningequality/kolibri-design-system/pull/555 + +## Version 4.x.x (`release-v4` branch) + +- [#560] + - **Description:** Configure dependabot to run on Wednesday + - **Products impact:** - + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#560]: https://github.com/learningequality/kolibri-design-system/pull/560 + +- [#558] + - **Description:** Move `useKResponsiveWindow` from `/lib` to `/lib/composables` + - **Products impact:** Location update + - **Addresses:** - + - **Components:** `useKResponsiveWindow` + - **Breaking:** yes + - **Impacts a11y:** - + - **Guidance:** Update `import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';` from `import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';` + +[#558]: https://github.com/learningequality/kolibri-design-system/pull/558 + +- [#558] + - **Description:** Remove deprecated `KResponsiveWindow's` mixin documentation page in favor of a new `useKResponsiveWindow` page + - **Products impact:** none + - **Addresses:** - + - **Components:** `KResponsiveWindow` + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#558]: https://github.com/learningequality/kolibri-design-system/pull/558 + +- [#558] + - **Description:** Adds engines and browserlist to package.json. Pins dependencies to exact version. + - **Products impact:** Dependencies + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#558]: https://github.com/learningequality/kolibri-design-system/pull/558 + +- [#558] + - **Description:** Internal maintenance tasks: extract common logic to utils, move private composables to `/lib/composables` and indicate that they are private by `_` prefix in their filename. dev docs updates. + - **Products impact:** none + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - +<<<<<<< HEAD [#555]: https://github.com/learningequality/kolibri-design-system/pull/555 +======= + +[#558]: https://github.com/learningequality/kolibri-design-system/pull/558 + +- [#551] + - **Description:** Updates `brand` colors, `palette` colors, and `token`s. + - Breaking changes: + - Removed `palette` colors: `purple`, `deeppurple`, `indigo`, `brown`, `cyan`, `teal`, `lightgreen`, `lime`, `amber`, `deeporange`, `bluegrey` + - Removed `palette.grey` scales: `v_300`, `v_500`, `v_700`, `v_900` + - Removed `brand` and `palette` scales (except `palette.grey`): `v_50`,`v_100`, `v_300`, `v_500`, `v_700`, `v_900` + - Removed content-related tokens: `exercise`, `video`, `audio`, `document`, `html5`, `slideshow` + - Removed other tokens: `appBarFullscreen`, `appBarFullscreenDark`, `linkDark` + - Other changes: + - Some existing `palette` colors look differently + - Adds new tokens and palette + - Global styles: `
` background color changed from `grey.v_100` to lighter `grey.v_50` + - **Products impact:** new API, updated API, deleted API + - **Addresses:** - https://github.com/learningequality/kolibri-design-system/issues/545 + - **Components:** - + - **Breaking:** - yes + - **Impacts a11y:** - no + - **Guidance:** - Address all breaking changes by searching for removed palette colors, scales, and tokens. Study the updated "Colors" KDS documentation page and replace them by relevant colors/scales/tokens. Also search for any hardcoded hex,rgb(a),hsl(a), or named colors (such as 'white') and theme them instead. Visually check places that use existing palette and adjust scale (you may need to increase it as many colors are lighter). You may also see if there are any minor useful updates to in regards to new tokens (e.g. replacing a `palette` color with a new `token` that describes function of the color better). If you use `generateGlobalStyles` that generates background color for `` and use grey.`v_100` in some components to match the background color, you may need to update it to `grey.v_50`. + +[#551]: https://github.com/learningequality/kolibri-design-system/pull/551 +>>>>>>> develop - [#531] - **Description:** Remove unused `keen-ui` dependency @@ -26,7 +109,106 @@ Changelog is rather internal in nature. See release notes for the public overvie [#531]: https://github.com/learningequality/kolibri-design-system/pull/531 -## Version 3.0.0 +## Version 3.x.x (`release-v3` branch) + +- [#552] + - **Description:** New `KListWithOverflow` component. + - **Products impact:** new API. + - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/556, https://github.com/learningequality/studio/issues/3423, https://github.com/learningequality/kolibri/issues/11923. + - **Components:** KListWithOverflow. + - **Breaking:** no. + - **Impacts a11y:** no. + - **Guidance:** -. + +[#552]: https://github.com/learningequality/kolibri-design-system/pull/552 + +- [#552] + - **Description:** New `useKResponsiveElement` private composable, `KResponsiveElementMixin` translated to this composable. + - **Products impact:** -. + - **Addresses:** -. + - **Components:** -. + - **Breaking:** no. + - **Impacts a11y:** no. + - **Guidance:** -. + +[#552]: https://github.com/learningequality/kolibri-design-system/pull/552 + +- [#538] + - **Description:** Complete KImg implementation + - **Products impact:** new API + - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/368 + - **Components:** KImg + - **Breaking:** no + - **Impacts a11y:** yes + - **Guidance:** One of the benefits of using KImg is that it throws a11y related warnings + +[#538]: https://github.com/learningequality/kolibri-design-system/pull/538 + +- [#557] + - **Description:** Updates development documentation in regards to linking products development servers to local KDS + - **Products impact:** - + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#557]: https://github.com/learningequality/kolibri-design-system/pull/557 + +- [#542] + - **Description:** Adds a new `sort` icon + - **Products impact:** New icon + - **Addresses:** https://github.com/learningequality/studio/issues/4426 + - **Components:** - + - **Breaking:** no + - **Impacts a11y:** - + - **Guidance:** - + +[#542]: https://github.com/learningequality/kolibri-design-system/pull/542 + +- [#542] + - **Description:** Updates documentation for icons to the new process, adds clear guidelines + - **Products impact:** None + - **Addresses:** - + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#542]: (https://github.com/learningequality/kolibri-design-system/pull/542 + +- [#543] + - **Description:** Added new Icons to support Studio Usability Enhancements + - **Products impact:** new API + - **Addresses:** https://github.com/learningequality/studio/issues/3425 + - **Components:** KIcon + - **Breaking:** no + - **Impacts a11y:** no + - **Guidance:** Consumers can now access these icons: activities, attribution, audience, categories, levels, rename + +[#543]: https://github.com/learningequality/kolibri-design-system/pull/543 + +- [#541] + - **Description:** Add a GitHub Actions workflow to publish a new release on npm + - **Products impact:** none + - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/532 + - **Components:** - + - **Breaking:** - + - **Impacts a11y:** - + - **Guidance:** - + +[#541]: https://github.com/learningequality/kolibri-design-system/pull/541 + +- [#535] + - **Description:** Added text prop in the KToolTip component as an alternative to the slot + - **Products impact:** Choose from - bugfix + - **Addresses:** #221 + - **Components:** KToolTip + - **Breaking:** no + - **Impacts a11y:** no + - **Guidance:** - + +[#535]: https://github.com/learningequality/kolibri-design-system/pull/535 - [#522] - **Description:** Upgrades github-actions/cache dependency diff --git a/README.md b/README.md index 0b119ee2e..462376f2c 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,7 @@ For the latest (not yet released) version, visit the design system website built ### Component library -The component library is a node package hosted on GitHub. It contains front-end components, utilities, and style definitions supporting the Kolibri Design System and used in Kolibri products. - -To add a particular pinned version to a project using `yarn`, for example `v1.0.1`, run: - -```bash -yarn add https://github.com/learningequality/kolibri-design-system#v1.0.1 -``` +The component library is [a npm package](https://www.npmjs.com/package/kolibri-design-system). It contains front-end components, utilities, and style definitions supporting the Kolibri Design System and used in Kolibri products. Components and utilities will be accessible under the `lib` path. For example: diff --git a/custom-icons/activities.svg b/custom-icons/activities.svg new file mode 100644 index 000000000..40e480836 --- /dev/null +++ b/custom-icons/activities.svg @@ -0,0 +1,6 @@ + diff --git a/custom-icons/categories.svg b/custom-icons/categories.svg new file mode 100644 index 000000000..4383b2762 --- /dev/null +++ b/custom-icons/categories.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-icons/levels.svg b/custom-icons/levels.svg new file mode 100644 index 000000000..c6556c8df --- /dev/null +++ b/custom-icons/levels.svg @@ -0,0 +1,3 @@ + diff --git a/custom-icons/rename.svg b/custom-icons/rename.svg new file mode 100644 index 000000000..f6c6fad18 --- /dev/null +++ b/custom-icons/rename.svg @@ -0,0 +1,3 @@ + diff --git a/custom-icons/sort.svg b/custom-icons/sort.svg new file mode 100644 index 000000000..ff53467a9 --- /dev/null +++ b/custom-icons/sort.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dev_docs/03_how_to_update_library.md b/dev_docs/03_how_to_update_library.md index f7b19d28a..f76f7b65d 100644 --- a/dev_docs/03_how_to_update_library.md +++ b/dev_docs/03_how_to_update_library.md @@ -51,14 +51,18 @@ When creating a new component, it is recommended to add a new documentation page ### (2) Preview updates in a product -To see local Kolibri Design System updates reflected in a product that is using it (such as [Kolibri Learning Platform](https://github.com/learningequality/kolibri) or [Kolibri Studio](https://github.com/learningequality/studio)): +You can test local Kolibri Design System updates reflected in a product that is using it, such as [Kolibri Learning Platform](https://github.com/learningequality/kolibri) or [Kolibri Studio](https://github.com/learningequality/studio). + +For Kolibri Learning Platform, we recommend `devserver-with-kds` command. See ["Running Kolibri with local Kolibri Design System"](https://kolibri-dev.readthedocs.io/en/develop/howtos/development_with_kds.html) guide. + +In other products, you can use `yarn link`: 1. While in the root of your local `kolibri-design-system` repository, run `yarn link`. -2. In the root of the product where you intend to use `kolibri-design-system` run `yarn link kolibri-design-system` and then `yarn install`. +2. In the root of a product where you intend to use `kolibri-design-system` run `yarn link kolibri-design-system` and then `yarn install`. Now, when you run the product your changes in `kolibri-design-system` will be updated live when running the product's development server. -For example, to test Kolibri Design System in Kolibri Learning Platform (local `kolibri` repository): +For example, to test Kolibri Design System in Kolibri Studio (local `studio` repository): ```bash # change to the Kolibri Design System repository and add it to yarn's local package registry @@ -66,16 +70,14 @@ cd ./kolibri-design-system yarn link # change to the Kolibri repository and link it to the local Kolibri Design System package -cd ../kolibri +cd ../studio yarn link kolibri-design-system -# re-install Kolibri dependencies +# re-install Studio dependencies yarn install -# run the Kolibri development server +# run the Studio development server yarn run devserver ``` -Note that to be able to run the Kolibri development server, at first you need to have it set up as described in [Kolibri developer documentation](https://kolibri-dev.readthedocs.io/en/develop/getting_started.html). - -Now you're all set to see your changes to the Kolibri Design System working live in Kolibri! +Now you're all set to see your changes to the Kolibri Design System working live in Studio! diff --git a/dev_docs/05_icons.md b/dev_docs/05_icons.md index 4953a1bcf..0415ecb2b 100644 --- a/dev_docs/05_icons.md +++ b/dev_docs/05_icons.md @@ -1,48 +1,35 @@ # Icons -This page is all about Kolibri Design System icons. It includes information on our icon sources and provides guidelines on related workflows. +Here, you can find all about icons - where to get them, how to add them, etc. -## Sources and regenerating Vue components +## Introduction -There are three sources of icons: +Source icon files are stored as svg files in [`custom-icons`](../custom-icons/). -- [Google Material Design Icons](https://github.com/material-icons/material-icons) (version pinned in [yarn.lock](yarn.lock)) -- [Material Design Icons](https://github.com/Templarian/MaterialDesign-SVG) (version pinned in [yarn.lock](yarn.lock)) -- [Custom Learning Equality icons]([custom-icons](../custom-icons/)) +### Icons as Vue components -Icons from these sources are then converted to Vue components by our custom precompilation script. After updating any of these sources, we need to regenerate the Vue components by running: +Source svg files are converted to Vue components by our precompilation script. The resulting Vue components are made public via [the icons definitions file `lib/KIcon/iconDefinitions.js`](../lib/KIcon/iconDefinitions.js). The documentation website contains automatically generated [list of available icons](https://design-system.learningequality.org/icons/#icons) that can be used via Vue components, such as `KIcon`. -```bash -yarn run precompile-svgs -``` +### Icons for reStructuredText -You can also regenerate just the custom icons which is faster: +In order to use icons on some Learning Equality's documentation pages written in reStructuredText, we also have a script to generate a set of reStructuredText replacement strings to [`docs/rstIconReplacements.txt`](../docs/rstIconReplacements.txt) which can be used in docs based on Sphinx. The file is available for download from https://design-system.learningequality.org/icons/#rst. -```bash -yarn run precompile-custom-svgs -``` +## How to add a new icon -One of these commands should be run after any icon changes. +1. **Paste a svg file** to [`custom-icons`](../custom-icons/) +2. **Run `yarn run precompile-custom-svgs` to generate a corresponding Vue component.** The generated component will be saved to [`lib/KIcon/precompiled-icons/le`](../lib/KIcon/precompiled-icons/le) +3. **Add a new entry for the generated component to [the icons definitions file](../lib/KIcon/iconDefinitions.js).** As a key name, choose a unique alias that describes the purpose of the icon in our products well. Set the following attributes: + - `icon`: A Vue component which renders the icon (generated in the previous step) + - (optional) `rtlFlip`: When `true`, the icon will be flipped for right-to-left lanauges + - (optional) `defaultColor`: A color for the icon. If not defined, icons are `themeTokens.text` colored + - (optional) `fixedColor`: When `true`, the icon has a fixed color and `KIcon`'s `color` prop will be ignored +4. **Run `yarn run pregenerate` to update icons for reStructuredText documents.** Note that it's important to run this step **after** updating the icons definitions file, otherwise it won't be detected. -We don't expose all icons in our KDS public API. Only icons defined in [the icons definitions file](lib/KIcon/iconDefinitions.js) are exposed, and we use our custom aliases for them. +To **check that the new icon is successfully added**: +- Run the development server +- See that the new icon is present in the icons list: http://localhost:4000/icons#icons +- See that there is a new entry for the icon in the reStructuredText replacement strings file: http://localhost:4000/icons#rst -In order to use icons in documentation we also output a set of reStructuredText replacement strings. These are added the file `docs/rstIconReplacements.txt` which can be used in docs based on Sphinx. The file is available for download from https://design-system.learningequality.org/icons/#rst +## How to update an existing icon -This command should be run after any icon ID changes. - -```bash -yarn run pregenerate -``` - -### Example: Upgrading Google Material Design Icons - -It is advised to commit changes at each step to make reviewing files other than those in *precompiled-icons/* easier, especially in case of large updates. - -1. Run `yarn upgrade @material-icons/svg` -2. Run `yarn run precompile-svgs` -3. Review updates of all public icons defined in [the icons definitions file](lib/KIcon/iconDefinitions.js) - -Large upgrades can result in a colossal git diff which makes reviewing changes of selected public icons in detail difficult. To make such upgrades smoother, in addition to visually reviewing [icons in KDS documentation](https://design-system.learningequality.org/icons/#icons), you can use a report that is printed in a terminal as soon as the precompilation process ends. It contains all exposed icons aliases together with information about whether an icon has been updated or no. If it's been updated, git diff will be printed. - -4. Run `yarn run pregenerate` -5. Write down notes to the changelog about any public updates like visual changes of icons, updates of their aliases, and updates of reStructuredText replacement strings +The update process is similar to creating a new icon. After every update, run `yarn run precompile-custom-svgs` and `yarn run pregenerate`. diff --git a/docs/assets/hummingbird CC BY-SA 4.0.jpg b/docs/assets/hummingbird CC BY-SA 4.0.jpg new file mode 100644 index 000000000..967146ca4 Binary files /dev/null and b/docs/assets/hummingbird CC BY-SA 4.0.jpg differ diff --git a/docs/assets/img_sample_for_kimg.png b/docs/assets/img_sample_for_kimg.png deleted file mode 100644 index f06c72c46..000000000 Binary files a/docs/assets/img_sample_for_kimg.png and /dev/null differ diff --git a/docs/pages/colors.vue b/docs/pages/colors.vue index db6ecc511..312829331 100644 --- a/docs/pages/colors.vue +++ b/docs/pages/colors.vue @@ -17,8 +17,8 @@
@@ -117,11 +117,37 @@
$themeTokens.surface
color)
$themeTokens.primary
)
- A color scale – sometimes called a color ramp – is an evenly-spaced ramp of shades for a particular color hue. In the Kolibri Design System, we follow v_50
, v_100
, v_20
, … v_800
, v_900
:
+ A color scale – sometimes called a color ramp – is an evenly-spaced ramp of shades for a particular color hue. In the Kolibri Design System, we follow v_200
, v_400
, v_600
, … v_1000
, v_1100
:
…
-
Due to the inconsistent way that humans perceive color and light, computing these scales is
Brand colors are chosen to reflect the mood, identity, or trademark of an application or an organization. The design system defines primary (dominant) and secondary (accent) branded color hues.
-- The Kolibri Design System has what we call "Kolibri Purple" as its primary and "Kolibri Teal" as its secondary, available across the full brightness scale: -
KImg
displays an image and provides functionality to manipulate it such as setting its dimensions, aspect ratio, scaling, letterboxing, and more.
Unless you set fixed dimensions, KImg
is responsive by default.
+ Note that the majority of settings are applied to the image container rather than the image itself. If you need to apply dimensions, aspect ratio, etc. directly to the image, you can use 'fitXY'
+ Depending on the scale type and other settings, the image may be letterboxed. When an image is letterboxed, backgroundColor
+
This is in more detail illustrated in the examples below, where the original image dimensions are 200×114 px.
+ +When rendered within an inline element, the image preserves its original dimensions by default.
+ +
+ When rendered within a block element, the image container fills the parent block element and the image scales with the 'centerInside'
px
,
- em
, vh
).
+
+ You can apply the most common dimensions to the image container via props such as width
+ maxHeight
+ %, cm, em, ex, ch, in, lh, mm, px, rem, rlh, vh, vw
. If you don't provide a unit, px
will be used by default.
+
+ Unless an image is altText
+
+ If it's meant to be decorative, indicate it by using isDecorative
+
+ The
'centerInside'
scale typeScales an image uniformly and maintains its original aspect ratio. Both its width and height are equal to or less than the width and height of the image container. An image can be letterboxed. It's the safest mode as it never distorts an image or impairs its quality.
+ +'contain'
scale typeBehaves similarly to 'centerInside'
except it ensures that at least one axis of an image fits the image container exactly. The original aspect ratio is maintained. An image can be letterboxed. This mode may impair an image's quality by enlarging it above its original size.
isDecorative
is true
. In that case, any alt text provided will be overwritten to an
- empty string.
+ 'fitXY'
scale typeScales X and Y axis of an image independently, so that the image matches the container exactly. An image is never letterboxed. This mode may impair an image's quality by enlarging it above its original size, or distort its aspect ratio.
-
+ You can set the aspect ratio of the image container with
+ aspectRatio
+
Note that the ratio styles calculations need to have the width information, therefore it needs to be available in some way. For example, you can set the width directly on KImg
. Alternatively, you could ensure that KImg
's parent element has width by setting it explicitly or by using a block element.
width
prop specifies the width of the image to be 100%
, the appearanceOverrides
prop overrides it and sets the width to 50%
.
-
+ The placeholder area is displayed when an image is not available. The area respects the dimensions set on the image container and is gray by default. You can change the area color via backgroundColor
+ #placeholder
+
+ Use #topLeft
+ #topRight
+ #bottomLeft
+ #bottomRight
+
+ The KListWithOverflow
component is useful when we want a horizontal list that is responsive and adaptable to the container size. The list only shows the items that fit on the container element. When items exceed the available space, the component seamlessly integrates a "see more" button to show additional items.
+
+ When a number of items fit within the screen boundaries, the list will be displayed without any changes. For example, since there are only 3 items here, we can see the entire list without problems. +
++ But if the list becomes very long, and does not fit within the screen, then the overflowed items will be cut, and an element will be placed to show more. For example, here are 12 items in the list. +
++ The following is a code example to render the above examples: +
+
+ You can also use dividers within the list by passing a { type: "divider" }
object, and set a #divider slot.
+ Note that the visible list will not end with a divider. And a divider object will not be passed as a first overflowed item.
+
+ To use dividers, you can include a divider object in the items list, and add a #divider slot. +
+- Once added to a component it provides the following reactive window's size information: -
- -windowIsSmall
, windowIsMedium
, and windowIsLarge
true
when the window width fits the small, medium, or large breakpoint respectively as defined in windowHeight
windowWidth
windowBreakpoint
Provided reactive properties are typically used to dynamically drive the layout of components by adjusting inline styles, CSS classes, component visibility, or even swapping out one component for a completely different one.
- -It can be imported as KResponsiveWindowMixin
. As with any other mixin, you need to register it in the script part of a component file:
- Provided reactive properties can then be accessed on the component instance via this
.
-
It can be imported as useKResponsiveWindow
. Register it in the script part of a component file:
useKResponsiveWindow()
returns an object of reactive properties, that you could destruture.
Mixins come with several drawbacks including namespace collision, tight coupling, and dificulties associated with developer debugging. It is recommended that composables are used instead as they attemp to resolve these drawbacks. Benefits among others, include better logic reusability and better code organization.
-- Consider a Vue file with this in its template and script: -
- - -- This results in two boxes that stack vertically on small screens and otherwise display side-by-side: -
-- Try adjusting your browser window size to see the example in action. -
-- Consider a Vue file with this in its template and script: -
- - -- This results in two boxes that stack vertically on small screens and otherwise display side-by-side: -
-- Try adjusting your browser window size to see the example in action. -
-Value: {{ exampleData }}
diff --git a/docs/pages/kswitch.vue b/docs/pages/kswitch.vue index e00313b63..7787bf918 100644 --- a/docs/pages/kswitch.vue +++ b/docs/pages/kswitch.vue @@ -33,19 +33,19 @@Provides the following reactive window's size information:
+ +windowIsSmall
, windowIsMedium
, and windowIsLarge
true
when the window width fits the small, medium, or large breakpoint respectively as defined in windowHeight
windowWidth
windowBreakpoint
Provided reactive properties are typically used to dynamically drive the layout of components by adjusting inline styles, CSS classes, component visibility, or even swapping out one component for a completely different one.
++ Consider a Vue file with the following template and script: +
+ + ++ This results in two boxes that stack vertically on small screens and otherwise display side-by-side: +
++ Try adjusting your browser window size to see the example in action. +
+