diff --git a/docs/assets/main.scss b/docs/assets/main.scss
index b5a0fa5ca..541c1a37e 100644
--- a/docs/assets/main.scss
+++ b/docs/assets/main.scss
@@ -75,3 +75,11 @@ html {
*::after {
box-sizing: inherit;
}
+
+dt {
+ margin-top: 16px;
+}
+
+dd {
+ margin-left: 20px;
+}
diff --git a/docs/pages/kresponsiveelement.vue b/docs/pages/kresponsiveelement.vue
new file mode 100644
index 000000000..615af2a81
--- /dev/null
+++ b/docs/pages/kresponsiveelement.vue
@@ -0,0 +1,62 @@
+
+
+
+ Once added to a component it provides the following reactive component's size information:
+ When compared to It can be imported as
+ Provided reactive properties can then be accessed on the component instance via
+ Once added to a component it provides the following reactive window's size information:
+ 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
+ Provided reactive properties can then be accessed on the component instance via
+ 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.
+
+
+
+ elementHeight
$el
height in pixels (integer)elementWidth
$el
width in pixels (integer)KResponsiveElement
can be suitable when it's the available space determined by the layout which should influence reponsive behavior of a child component rather than relying on the overall window size.As mixin
+ KResponsiveElementMixin
. As with any other mixin, you need to register it in the script part of a component file:this
.
+
+
+ KResponsiveElement
in larger numbers on one page is currently discouraged
+
+
+
+
+ windowIsSmall
, windowIsMedium
, and windowIsLarge
true
when the window width fits the small, medium, or large breakpoint respectively as defined in windowHeight
windowWidth
windowBreakpoint
As mixin
+ KResponsiveWindowMixin
. As with any other mixin, you need to register it in the script part of a component file:this
.
+
+
+
>= 1600px
- Responsive layouts in the design system are built using reactive javascript state in Vue components rather than CSS media queries. This is done using the KResponsiveWindowMixin
Vue mixin. Once added to a component it provides the following reactive window state information:
+ Responsive layouts in the design system are built using reactive JavaScript state in Vue components rather than CSS media queries. This is done using
windowIsSmall
: booleanwindowIsMedium
: booleanwindowIsLarge
: booleanwindowHeight
: integer height in pixelswindowWidth
: integer width in pixelswindowBreakpoint
: integer breakpoint level- These reactive properties are 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. -
-- For example, 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. -
- -