@natachah/vanilla-frontend 0.4.0 → 1.0.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/.gitlab-ci.yml +22 -13
- package/LICENSE.md +1 -1
- package/docs/.vitepress/config.mts +101 -0
- package/docs/base/layout.md +77 -0
- package/docs/base/media.md +146 -0
- package/docs/base/reset.md +33 -0
- package/docs/base/typography.md +296 -0
- package/docs/classes/badge.md +146 -0
- package/docs/classes/breadcrumb.md +54 -0
- package/docs/classes/card.md +171 -0
- package/docs/classes/dropdown.md +180 -0
- package/docs/classes/grid.md +230 -0
- package/docs/classes/list.md +90 -0
- package/docs/components/button.md +254 -0
- package/docs/components/dialog.md +223 -0
- package/docs/components/disclosure.md +169 -0
- package/docs/components/form.md +514 -0
- package/docs/components/loading.md +53 -0
- package/docs/components/popover.md +270 -0
- package/docs/components/progress.md +33 -0
- package/docs/components/table.md +175 -0
- package/docs/index.md +27 -0
- package/docs/javascript/autofill.md +155 -0
- package/docs/javascript/check.md +53 -0
- package/docs/javascript/comfort.md +125 -0
- package/docs/javascript/consent.md +89 -0
- package/docs/javascript/cookie.md +33 -0
- package/docs/javascript/drawer.md +99 -0
- package/docs/javascript/form.md +130 -0
- package/docs/javascript/scroll.md +104 -0
- package/docs/javascript/slider.md +130 -0
- package/docs/javascript/sortable.md +127 -0
- package/docs/javascript/tabpanel.md +72 -0
- package/docs/javascript/toggle.md +182 -0
- package/docs/javascript/trap.md +33 -0
- package/docs/javascript/tree.md +220 -0
- package/docs/prologue/conventions.md +92 -0
- package/docs/prologue/release.md +44 -0
- package/docs/prologue/upgrade.md +21 -0
- package/docs/{pages/demo/layout.html → public/demo/demo.html} +1 -2
- package/docs/start/customization.md +184 -0
- package/docs/start/install.md +80 -0
- package/docs/start/mixin.md +203 -0
- package/docs/vuejs/ComponentPreview.vue +99 -0
- package/js/_slider.js +17 -1
- package/js/vanilla-frontend-doc.js +105 -0
- package/natachah-vanilla-frontend-1.0.0.tgz +0 -0
- package/package.json +11 -14
- package/public/404.html +22 -0
- package/public/assets/app.DsgDPRSA.js +1 -0
- package/public/assets/base_layout.md.CTGv6rTn.js +13 -0
- package/public/assets/base_layout.md.CTGv6rTn.lean.js +1 -0
- package/public/assets/base_media.md.CcuDUcF-.js +24 -0
- package/public/assets/base_media.md.CcuDUcF-.lean.js +1 -0
- package/public/assets/base_reset.md.DqIdqFRJ.js +3 -0
- package/public/assets/base_reset.md.DqIdqFRJ.lean.js +1 -0
- package/public/assets/base_typography.md.DV-ikqGZ.js +87 -0
- package/public/assets/base_typography.md.DV-ikqGZ.lean.js +1 -0
- package/public/assets/chunks/ComponentPreview.BW2s4ay5.js +27 -0
- package/public/assets/chunks/framework.CaiDwmc7.js +4 -0
- package/public/assets/chunks/theme.DL_11MHV.js +1 -0
- package/public/assets/classes_badge.md.BCGzPr6f.js +24 -0
- package/public/assets/classes_badge.md.BCGzPr6f.lean.js +1 -0
- package/public/assets/classes_breadcrumb.md.vU6jlo36.js +15 -0
- package/public/assets/classes_breadcrumb.md.vU6jlo36.lean.js +1 -0
- package/public/assets/classes_card.md.BZEh2l_B.js +41 -0
- package/public/assets/classes_card.md.BZEh2l_B.lean.js +1 -0
- package/public/assets/classes_dropdown.md.BLVw_xQY.js +70 -0
- package/public/assets/classes_dropdown.md.BLVw_xQY.lean.js +1 -0
- package/public/assets/classes_grid.md.47v-Ybqe.js +45 -0
- package/public/assets/classes_grid.md.47v-Ybqe.lean.js +1 -0
- package/public/assets/classes_list.md.BW9PWZV1.js +36 -0
- package/public/assets/classes_list.md.BW9PWZV1.lean.js +1 -0
- package/public/assets/components_button.md.vx3HzdpN.js +45 -0
- package/public/assets/components_button.md.vx3HzdpN.lean.js +1 -0
- package/public/assets/components_dialog.md.C-0gJGus.js +76 -0
- package/public/assets/components_dialog.md.C-0gJGus.lean.js +1 -0
- package/public/assets/components_disclosure.md.DeSRu9_P.js +53 -0
- package/public/assets/components_disclosure.md.DeSRu9_P.lean.js +1 -0
- package/public/assets/components_form.md.Be8d5WFv.js +122 -0
- package/public/assets/components_form.md.Be8d5WFv.lean.js +1 -0
- package/public/assets/components_loading.md.CKDG7z5x.js +4 -0
- package/public/assets/components_loading.md.CKDG7z5x.lean.js +1 -0
- package/public/assets/components_popover.md.CwgNttNc.js +102 -0
- package/public/assets/components_popover.md.CwgNttNc.lean.js +1 -0
- package/public/assets/components_progress.md.CNC7rJiC.js +6 -0
- package/public/assets/components_progress.md.CNC7rJiC.lean.js +1 -0
- package/public/assets/components_table.md.LyBkIDkF.js +75 -0
- package/public/assets/components_table.md.LyBkIDkF.lean.js +1 -0
- package/public/assets/index.md.CJiHmjB7.js +1 -0
- package/public/assets/index.md.CJiHmjB7.lean.js +1 -0
- package/public/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/public/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/public/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/public/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/public/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/public/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/public/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/public/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/public/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/public/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/public/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/public/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/public/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/public/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/public/assets/javascript_autofill.md.BewVUo4H.js +49 -0
- package/public/assets/javascript_autofill.md.BewVUo4H.lean.js +1 -0
- package/public/assets/javascript_check.md.B6ajE66i.js +13 -0
- package/public/assets/javascript_check.md.B6ajE66i.lean.js +1 -0
- package/public/assets/javascript_comfort.md.BRci3j7V.js +20 -0
- package/public/assets/javascript_comfort.md.BRci3j7V.lean.js +1 -0
- package/public/assets/javascript_consent.md.Bjv8ZDS6.js +29 -0
- package/public/assets/javascript_consent.md.Bjv8ZDS6.lean.js +1 -0
- package/public/assets/javascript_cookie.md.Dlhyk4Ha.js +2 -0
- package/public/assets/javascript_cookie.md.Dlhyk4Ha.lean.js +1 -0
- package/public/assets/javascript_drawer.md.BCJX3fL-.js +32 -0
- package/public/assets/javascript_drawer.md.BCJX3fL-.lean.js +1 -0
- package/public/assets/javascript_form.md.Cwf_gxLI.js +40 -0
- package/public/assets/javascript_form.md.Cwf_gxLI.lean.js +2 -0
- package/public/assets/javascript_scroll.md.BrJijWbF.js +30 -0
- package/public/assets/javascript_scroll.md.BrJijWbF.lean.js +1 -0
- package/public/assets/javascript_slider.md.DDO8wC4u.js +27 -0
- package/public/assets/javascript_slider.md.DDO8wC4u.lean.js +1 -0
- package/public/assets/javascript_sortable.md.BKyem7yw.js +35 -0
- package/public/assets/javascript_sortable.md.BKyem7yw.lean.js +1 -0
- package/public/assets/javascript_tabpanel.md.D9M-_xE0.js +19 -0
- package/public/assets/javascript_tabpanel.md.D9M-_xE0.lean.js +1 -0
- package/public/assets/javascript_toggle.md.C8582WNC.js +46 -0
- package/public/assets/javascript_toggle.md.C8582WNC.lean.js +1 -0
- package/public/assets/javascript_trap.md.Bc59YUng.js +2 -0
- package/public/assets/javascript_trap.md.Bc59YUng.lean.js +1 -0
- package/public/assets/javascript_tree.md.uc1UUsFV.js +72 -0
- package/public/assets/javascript_tree.md.uc1UUsFV.lean.js +1 -0
- package/public/assets/prologue_conventions.md.D8nVwlRS.js +34 -0
- package/public/assets/prologue_conventions.md.D8nVwlRS.lean.js +1 -0
- package/public/assets/prologue_release.md.CG6nuFnt.js +1 -0
- package/public/assets/prologue_release.md.CG6nuFnt.lean.js +1 -0
- package/public/assets/prologue_upgrade.md.CFxokaBG.js +1 -0
- package/public/assets/prologue_upgrade.md.CFxokaBG.lean.js +1 -0
- package/public/assets/start_customization.md.t-ze_NoQ.js +141 -0
- package/public/assets/start_customization.md.t-ze_NoQ.lean.js +1 -0
- package/public/assets/start_install.md.OluH7l11.js +46 -0
- package/public/assets/start_install.md.OluH7l11.lean.js +1 -0
- package/public/assets/start_mixin.md.D76cLRSX.js +85 -0
- package/public/assets/start_mixin.md.D76cLRSX.lean.js +1 -0
- package/public/assets/style.zIeGMibA.css +1 -0
- package/public/base/layout.html +37 -0
- package/public/base/media.html +179 -0
- package/public/base/reset.html +27 -0
- package/public/base/typography.html +320 -0
- package/public/bundles/vanilla-frontend-doc.css +1 -0
- package/public/bundles/vanilla-frontend-doc.js +1 -0
- package/public/bundles/vanilla-frontend.css +1 -0
- package/public/classes/badge.html +205 -0
- package/public/classes/breadcrumb.html +66 -0
- package/public/classes/card.html +222 -0
- package/public/classes/dropdown.html +147 -0
- package/public/classes/grid.html +278 -0
- package/public/classes/list.html +113 -0
- package/public/components/button.html +304 -0
- package/public/components/dialog.html +205 -0
- package/public/components/disclosure.html +130 -0
- package/public/components/form.html +589 -0
- package/public/components/loading.html +107 -0
- package/public/components/popover.html +257 -0
- package/public/components/progress.html +57 -0
- package/public/components/table.html +152 -0
- package/public/demo/demo.html +84 -0
- package/public/hashmap.json +1 -0
- package/public/index.html +25 -0
- package/public/javascript/autofill.html +152 -0
- package/public/javascript/check.html +64 -0
- package/public/javascript/comfort.html +123 -0
- package/public/javascript/consent.html +80 -0
- package/public/javascript/cookie.html +26 -0
- package/public/javascript/drawer.html +83 -0
- package/public/javascript/form.html +117 -0
- package/public/javascript/scroll.html +81 -0
- package/public/javascript/slider.html +78 -0
- package/public/javascript/sortable.html +112 -0
- package/public/javascript/tabpanel.html +70 -0
- package/public/javascript/toggle.html +201 -0
- package/public/javascript/trap.html +26 -0
- package/public/javascript/tree.html +175 -0
- package/public/prologue/conventions.html +58 -0
- package/public/prologue/release.html +25 -0
- package/public/prologue/upgrade.html +25 -0
- package/public/start/customization.html +165 -0
- package/public/start/install.html +70 -0
- package/public/start/mixin.html +109 -0
- package/public/vp-icons.css +0 -0
- package/sandbox/index.html +27 -0
- package/sandbox/js/sandbox-header.js +57 -0
- package/sandbox/js/sandbox-test.js +91 -0
- package/sandbox/pages/base/layout.html +80 -0
- package/sandbox/pages/base/media.html +52 -0
- package/sandbox/pages/base/typography.html +132 -0
- package/sandbox/pages/components/button.html +70 -0
- package/sandbox/pages/components/dialog.html +72 -0
- package/sandbox/pages/components/disclosure.html +77 -0
- package/sandbox/pages/components/form.html +164 -0
- package/sandbox/pages/components/loading.html +32 -0
- package/sandbox/pages/components/popover.html +119 -0
- package/sandbox/pages/components/progress.html +28 -0
- package/sandbox/pages/components/table.html +80 -0
- package/sandbox/pages/customs/badge.html +59 -0
- package/sandbox/pages/customs/breadcrumb.html +34 -0
- package/sandbox/pages/customs/card.html +71 -0
- package/sandbox/pages/customs/dropdown.html +70 -0
- package/sandbox/pages/customs/grid.html +109 -0
- package/sandbox/pages/customs/list.html +43 -0
- package/sandbox/pages/javascript/autofill.html +39 -0
- package/sandbox/pages/javascript/checkall.html +37 -0
- package/sandbox/pages/javascript/comfort.html +41 -0
- package/sandbox/pages/javascript/consent.html +45 -0
- package/sandbox/pages/javascript/form.html +50 -0
- package/sandbox/pages/javascript/scroll.html +44 -0
- package/sandbox/pages/javascript/slider.html +44 -0
- package/sandbox/pages/javascript/sortable.html +56 -0
- package/sandbox/pages/javascript/tabpanel.html +39 -0
- package/sandbox/pages/javascript/toggle.html +72 -0
- package/sandbox/pages/javascript/tree.html +96 -0
- package/sandbox/sandbox.js +26 -0
- package/sandbox/scss/sandbox-header.scss +93 -0
- package/scss/base/_reset.scss +2 -0
- package/scss/components/_badge.scss +2 -1
- package/scss/components/_dropdown.scss +2 -2
- package/scss/components/_group.scss +8 -4
- package/scss/components/_popover.scss +74 -0
- package/scss/components/index.scss +1 -0
- package/scss/themes/_root.scss +3 -0
- package/scss/vanilla-frontend-doc.scss +46 -1
- package/scss/vanilla-frontend-sandbox.scss +34 -0
- package/vite.config.js +30 -0
- package/docs/index.html +0 -36
- package/docs/main-demo.js +0 -2
- package/docs/main.js +0 -34
- package/docs/pages/base/layout.html +0 -131
- package/docs/pages/base/media.html +0 -142
- package/docs/pages/base/reset.html +0 -53
- package/docs/pages/base/typography.html +0 -334
- package/docs/pages/components/button.html +0 -202
- package/docs/pages/components/dialog.html +0 -336
- package/docs/pages/components/disclosure.html +0 -174
- package/docs/pages/components/form.html +0 -427
- package/docs/pages/components/loading.html +0 -58
- package/docs/pages/components/progress.html +0 -47
- package/docs/pages/components/table.html +0 -168
- package/docs/pages/customs/badge.html +0 -150
- package/docs/pages/customs/breadcrumb.html +0 -67
- package/docs/pages/customs/card.html +0 -185
- package/docs/pages/customs/drawer.html +0 -149
- package/docs/pages/customs/dropdown.html +0 -270
- package/docs/pages/customs/grid.html +0 -185
- package/docs/pages/customs/list.html +0 -112
- package/docs/pages/customs/slider.html +0 -273
- package/docs/pages/javascript/autofill.html +0 -170
- package/docs/pages/javascript/checkall.html +0 -59
- package/docs/pages/javascript/comfort.html +0 -146
- package/docs/pages/javascript/consent.html +0 -112
- package/docs/pages/javascript/cookie.html +0 -81
- package/docs/pages/javascript/form.html +0 -199
- package/docs/pages/javascript/scroll.html +0 -209
- package/docs/pages/javascript/sortable.html +0 -167
- package/docs/pages/javascript/tabpanel.html +0 -89
- package/docs/pages/javascript/toggle.html +0 -193
- package/docs/pages/javascript/trap.html +0 -89
- package/docs/pages/javascript/tree.html +0 -256
- package/docs/pages/quick-start/conventions.html +0 -112
- package/docs/pages/quick-start/customization.html +0 -184
- package/docs/pages/quick-start/installation.html +0 -97
- package/docs/pages/quick-start/mixins.html +0 -214
- package/docs/src/js/demo.js +0 -110
- package/docs/src/js/doc-code.js +0 -102
- package/docs/src/js/doc-demo.js +0 -14
- package/docs/src/js/doc-layout.js +0 -117
- package/docs/src/scss/demo.scss +0 -77
- package/docs/src/scss/layout.scss +0 -83
- package/docs/src/scss/style.scss +0 -278
- package/docs/vite.config.mjs +0 -23
- package/esbuild.mjs +0 -25
- package/natachah-vanilla-frontend-0.4.0.tgz +0 -0
- package/vitest.config.js +0 -8
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# SCSS Mixins
|
|
2
|
+
|
|
3
|
+
The framework comes with some helpful SCSS mixins to re-use.
|
|
4
|
+
|
|
5
|
+
To use them, import this file:
|
|
6
|
+
```SCSS
|
|
7
|
+
@use '@natachah/vanilla-frontend/scss/abstracts/mixins';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Create an item
|
|
11
|
+
|
|
12
|
+
This mixin creates an element as an item with some default style properties:
|
|
13
|
+
|
|
14
|
+
- Color
|
|
15
|
+
- Background
|
|
16
|
+
- Border
|
|
17
|
+
- Border radius
|
|
18
|
+
- Padding
|
|
19
|
+
- State :hover, :focus, :active and :disabled
|
|
20
|
+
|
|
21
|
+
```SCSS
|
|
22
|
+
|
|
23
|
+
/// Create a basic item that can be interactive or not
|
|
24
|
+
///
|
|
25
|
+
/// @param {string} $name - Name of the component
|
|
26
|
+
/// @param {array} $states - List of interactions (can be: focus, hover, active, disabled)
|
|
27
|
+
/// @param {array} $properties - List of default properties (check in /variables/_setting.scss)
|
|
28
|
+
/// @access public
|
|
29
|
+
///
|
|
30
|
+
|
|
31
|
+
@include as-item($name, $states: (), $properties: default.$item-properties)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The default properties are set inside the `default.$item-properties` variable of the file `./scss/variables/_setting.scss`
|
|
35
|
+
|
|
36
|
+
In case that you want to customize the default:
|
|
37
|
+
|
|
38
|
+
```scss
|
|
39
|
+
@use "sass:map";
|
|
40
|
+
@use "@natachah/vanilla-frontend/scss/abstracts/default";
|
|
41
|
+
@use '@natachah/vanilla-frontend/scss/abstracts/mixins' as *;
|
|
42
|
+
|
|
43
|
+
// Change default properties
|
|
44
|
+
$submenuProperties: map.merge(default.$item-properties, (background: var(--color-body)));
|
|
45
|
+
|
|
46
|
+
#submenu {
|
|
47
|
+
@include as-list('submenu', ('focus', 'hover', 'active', 'disabled'), $submenuProperties);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Create a list
|
|
53
|
+
|
|
54
|
+
This mixin transforms a `<ul/ol/div>` into a group list with all children as items.
|
|
55
|
+
|
|
56
|
+
```SCSS
|
|
57
|
+
/// Create a basic list group that can be interactive
|
|
58
|
+
///
|
|
59
|
+
/// @require {mixin} as-item
|
|
60
|
+
/// @param {string} $name - Name of the component
|
|
61
|
+
/// @param {array} $states - List of interactions (can be: focus, hover, active, disabled)
|
|
62
|
+
/// @param {array} $properties - List of default properties (check in /variables/_setting.scss)
|
|
63
|
+
/// @access public
|
|
64
|
+
///
|
|
65
|
+
|
|
66
|
+
@include as-list($name, $states: (), $properties: default.$item-properties)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
::: info
|
|
70
|
+
This mixin is used for the list and dropdown components.
|
|
71
|
+
:::
|
|
72
|
+
|
|
73
|
+
## Add header and footer to an item
|
|
74
|
+
|
|
75
|
+
This mixin will create a `<header>` and a `<footer>` with negative margin, some padding, and a divider border.
|
|
76
|
+
|
|
77
|
+
```SCSS
|
|
78
|
+
/// Create a basic item with an header and a footer style
|
|
79
|
+
///
|
|
80
|
+
/// @param {string} $name - Name of the component
|
|
81
|
+
/// @param {array} $properties - List of default properties (check in /variables/_setting.scss)
|
|
82
|
+
/// @access public
|
|
83
|
+
///
|
|
84
|
+
@mixin with-header-and-footer($name, $properties: default.$item-properties)
|
|
85
|
+
```
|
|
86
|
+
::: info
|
|
87
|
+
This mixin is used in Dialog components.
|
|
88
|
+
:::
|
|
89
|
+
|
|
90
|
+
## Create a outline variation
|
|
91
|
+
|
|
92
|
+
This mixin will create the `.outline` class to transform an item to the outline variation.
|
|
93
|
+
|
|
94
|
+
```SCSS
|
|
95
|
+
|
|
96
|
+
/// Create a outline variation
|
|
97
|
+
///
|
|
98
|
+
/// @param {string} $name - Name of the component
|
|
99
|
+
/// @param {array} $states - List of interactions
|
|
100
|
+
/// @param {string} $color - The color of the item
|
|
101
|
+
/// @param {string} $contrast - The color contrast of the item
|
|
102
|
+
/// @access public
|
|
103
|
+
///
|
|
104
|
+
|
|
105
|
+
@include with-outline-variation($name, $states: (), $color: var(--color-font), $contrast: var(--color-body))
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Create some color variations
|
|
109
|
+
|
|
110
|
+
This mixin will create the .COLOR classes to transform an item into multiple color variations.
|
|
111
|
+
|
|
112
|
+
```SCSS
|
|
113
|
+
|
|
114
|
+
/// Create some color variations
|
|
115
|
+
///
|
|
116
|
+
/// @param {string} $name - Name of the component
|
|
117
|
+
/// @param {array} $states - List of interactions
|
|
118
|
+
/// @param {array} $colors - List of colors
|
|
119
|
+
/// @param {boolean} $withOutline - Thit outline colored version
|
|
120
|
+
/// @access public
|
|
121
|
+
///
|
|
122
|
+
|
|
123
|
+
@include with-color-variations($name, $states: (), $colors: (), $withOutline: false)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Transform table to be responsive
|
|
127
|
+
|
|
128
|
+
This mixin will transform a `<table>` into a more responsive view. You must use this mixin inside a `@media` or a `@container`.
|
|
129
|
+
|
|
130
|
+
It also requires adding the attribute `data-label="Name of the column"` on each `<td>`.
|
|
131
|
+
|
|
132
|
+
By default the grid is set on 2 columns (15 characters and auto).
|
|
133
|
+
|
|
134
|
+
::: code-group
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<table>
|
|
138
|
+
<thead>
|
|
139
|
+
<tr>
|
|
140
|
+
<th>Header A</th>
|
|
141
|
+
<th>Header B</th>
|
|
142
|
+
<th>Header C</th>
|
|
143
|
+
</tr>
|
|
144
|
+
</thead>
|
|
145
|
+
<tbody>
|
|
146
|
+
<tr>
|
|
147
|
+
<td data-label="Header A">Cell</td>
|
|
148
|
+
<td data-label="Header B">Cell</td>
|
|
149
|
+
<td data-label="Header C">Cell</td>
|
|
150
|
+
</tr>
|
|
151
|
+
</tbody>
|
|
152
|
+
</table>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```scss
|
|
156
|
+
@container (max-width:800px) {
|
|
157
|
+
table {
|
|
158
|
+
@include as-responsive-table()
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
--table-grid-template: 15ch 1fr;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
:::
|
|
168
|
+
|
|
169
|
+
## Flex grid utilities
|
|
170
|
+
|
|
171
|
+
There two mixins to make it easier to change the offset and the width of a specific column when used with the **grid** component.
|
|
172
|
+
|
|
173
|
+
By default the `flex-grid-wider-column` parameter is **2**, to have the width equal of two columns width.
|
|
174
|
+
|
|
175
|
+
By default the `flex-grid-offset-column` parameter is **1** to take the place of one column width.
|
|
176
|
+
|
|
177
|
+
::: code-group
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<div class="flex-grid">
|
|
181
|
+
<div>Flex 1</div>
|
|
182
|
+
<div>Flex 2</div>
|
|
183
|
+
<div>Flex 3</div>
|
|
184
|
+
<div id="wider">Wider of 3</div>
|
|
185
|
+
<div id="offset">Offset of 2</div>
|
|
186
|
+
</div>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```scss
|
|
190
|
+
#wider {
|
|
191
|
+
@include flex-grid-wider-column(3)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
#offset {
|
|
195
|
+
@include flex-grid-offset-column(2)
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
:::
|
|
200
|
+
|
|
201
|
+
::: warning
|
|
202
|
+
This mixins only work with `.flex-grid`
|
|
203
|
+
:::
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<iframe
|
|
4
|
+
ref="iframeRef"
|
|
5
|
+
:srcdoc="generateHTML"
|
|
6
|
+
@load="onIframeLoad"
|
|
7
|
+
class="iframe-content"
|
|
8
|
+
:style="dynamicStyle"
|
|
9
|
+
></iframe>
|
|
10
|
+
|
|
11
|
+
<div ref="slotSource" hidden>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ref, onMounted, computed } from 'vue'
|
|
19
|
+
|
|
20
|
+
// 1. Définition de la prop 'height'
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
height: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: null
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
console.log(props)
|
|
29
|
+
|
|
30
|
+
const slotSource = ref(null)
|
|
31
|
+
const rawHtml = ref('')
|
|
32
|
+
const iframeRef = ref(null)
|
|
33
|
+
|
|
34
|
+
// 2. Création d'un style dynamique
|
|
35
|
+
const dynamicStyle = computed(() => {
|
|
36
|
+
return props.height ? { height: props.height } : {}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// // On récupère le HTML brut à l'intérieur du slot
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
if (slotSource.value) {
|
|
42
|
+
rawHtml.value = slotSource.value.innerHTML.trim()
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const generateHTML = computed(() => {
|
|
47
|
+
return `
|
|
48
|
+
<!DOCTYPE html>
|
|
49
|
+
<html>
|
|
50
|
+
<head>
|
|
51
|
+
<meta charset="utf-8">
|
|
52
|
+
<link rel="stylesheet" href="/bundles/vanilla-frontend-doc.css">
|
|
53
|
+
<style>
|
|
54
|
+
html[data-theme=light] .demo-theme {
|
|
55
|
+
color: black;
|
|
56
|
+
background: white
|
|
57
|
+
}
|
|
58
|
+
html[data-theme=dark] .demo-theme {
|
|
59
|
+
color: white;
|
|
60
|
+
background: black
|
|
61
|
+
}
|
|
62
|
+
body {
|
|
63
|
+
padding:1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
</style>
|
|
67
|
+
</head>
|
|
68
|
+
<body>
|
|
69
|
+
${rawHtml.value}
|
|
70
|
+
<script src="/bundles/vanilla-frontend-doc.js"><\/script>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
73
|
+
`
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// On n'ajuste automatiquement la hauteur QUE si aucune prop height n'est fournie
|
|
77
|
+
const onIframeLoad = () => {
|
|
78
|
+
const iframe = iframeRef.value
|
|
79
|
+
if (!props.height && iframe && iframe.contentWindow) {
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
const height = iframe.contentWindow.document.documentElement.offsetHeight // scrollHeight
|
|
82
|
+
iframe.style.height = height + 5 + 'px'
|
|
83
|
+
}, 50)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style scoped>
|
|
89
|
+
|
|
90
|
+
.iframe-content {
|
|
91
|
+
width: 100%;
|
|
92
|
+
border: 1px solid var(--vp-c-divider);
|
|
93
|
+
border-radius: var(--docsearch-border-radius);
|
|
94
|
+
display: block;
|
|
95
|
+
transition: height 0.2s ease;
|
|
96
|
+
background: var(--vp-c-bg);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
</style>
|
package/js/_slider.js
CHANGED
|
@@ -54,7 +54,9 @@ export default class Slider extends BaseComponent {
|
|
|
54
54
|
this._buttons = {
|
|
55
55
|
prev: document.querySelector(`[aria-controls=${this._element.id}][data-slider-prev]`),
|
|
56
56
|
next: document.querySelector(`[aria-controls=${this._element.id}][data-slider-next]`),
|
|
57
|
-
tabs: document.querySelectorAll(`[aria-controls=${this._element.id}][role=tablist] [role=tab]`)
|
|
57
|
+
tabs: document.querySelectorAll(`[aria-controls=${this._element.id}][role=tablist] [role=tab]`),
|
|
58
|
+
play: document.querySelector(`[aria-controls=${this._element.id}][data-slider-play]`),
|
|
59
|
+
pause: document.querySelector(`[aria-controls=${this._element.id}][data-slider-pause]`),
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
this._current = 0
|
|
@@ -109,6 +111,20 @@ export default class Slider extends BaseComponent {
|
|
|
109
111
|
clearInterval(this._interval)
|
|
110
112
|
this._interval = setInterval(() => this.next(), this._options.autoplay)
|
|
111
113
|
})
|
|
114
|
+
|
|
115
|
+
// Add event listeners for pause
|
|
116
|
+
if (this._buttons.pause) {
|
|
117
|
+
this._buttons.pause.addEventListener('click', () => {
|
|
118
|
+
clearInterval(this._interval)
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Add event listeners for play
|
|
123
|
+
if (this._buttons.play) {
|
|
124
|
+
this._buttons.play.addEventListener('click', () => {
|
|
125
|
+
this._interval = setInterval(() => this.next(), this._options.autoplay)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
112
128
|
}
|
|
113
129
|
|
|
114
130
|
// Enable swipe functionality on touch devices.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// If you need to create some component, you can use this
|
|
2
|
+
import BaseComponent from "./utilities/_base-component"
|
|
3
|
+
import ErrorMessage from "./utilities/_error"
|
|
4
|
+
import Cookie from "./utilities/_cookie"
|
|
5
|
+
|
|
6
|
+
// Here the helpers
|
|
7
|
+
import FormHelper from "./utilities/_form-helper"
|
|
8
|
+
|
|
9
|
+
// Here the components
|
|
10
|
+
import Autofill from "./_autofill"
|
|
11
|
+
import CheckAll from "./_check-all"
|
|
12
|
+
import Comfort from "./_comfort"
|
|
13
|
+
import Consent from "./_consent"
|
|
14
|
+
import Dialog from "./_dialog"
|
|
15
|
+
import Dropdown from "./_dropdown"
|
|
16
|
+
import Drawer from "./_drawer"
|
|
17
|
+
import Scroll from "./_scroll"
|
|
18
|
+
import Slider from "./_slider"
|
|
19
|
+
import Sortable from "./_sortable"
|
|
20
|
+
import Tabpanel from "./_tabpanel"
|
|
21
|
+
import Toggle from "./_toggle"
|
|
22
|
+
import Tree from "./_tree"
|
|
23
|
+
|
|
24
|
+
// * Dialog
|
|
25
|
+
|
|
26
|
+
const myDialog = document.getElementById('myDialog')
|
|
27
|
+
if (myDialog) new Dialog(myDialog)
|
|
28
|
+
|
|
29
|
+
const layoutDialog = document.getElementById('layoutDialog')
|
|
30
|
+
if (layoutDialog) new Dialog(layoutDialog)
|
|
31
|
+
|
|
32
|
+
const formDialog = document.getElementById('formDialog')
|
|
33
|
+
if (formDialog) new Dialog(formDialog)
|
|
34
|
+
|
|
35
|
+
const jsDialog = document.getElementById('jsDialog')
|
|
36
|
+
if (jsDialog) {
|
|
37
|
+
new Dialog(jsDialog)
|
|
38
|
+
jsDialog.addEventListener('dialog:submited', (e) => {
|
|
39
|
+
const value = e.detail.form.querySelector('input').value
|
|
40
|
+
document.getElementById('favorite').innerText = value
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const drawer = document.getElementById('drawer')
|
|
45
|
+
if (drawer) new Drawer(drawer)
|
|
46
|
+
|
|
47
|
+
const dropdowns = document.querySelectorAll('.dropdown-js')
|
|
48
|
+
if (dropdowns) dropdowns.forEach(dropdown => new Dropdown(dropdown))
|
|
49
|
+
|
|
50
|
+
const slider = document.getElementById('slider')
|
|
51
|
+
if (slider) new Slider(slider, {
|
|
52
|
+
//behavior: 'instant',
|
|
53
|
+
loop: true,
|
|
54
|
+
//autoplay: 1500
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const autofills = document.querySelectorAll('.autofill-demo')
|
|
58
|
+
if (autofills) autofills.forEach(autofill => new Autofill(autofill))
|
|
59
|
+
|
|
60
|
+
const checkboxAll = document.getElementById('checkboxAll')
|
|
61
|
+
if (checkboxAll) new CheckAll(checkboxAll)
|
|
62
|
+
|
|
63
|
+
new Comfort('demo-confort')
|
|
64
|
+
|
|
65
|
+
if (document.getElementById('demoCookies')) {
|
|
66
|
+
new Consent('demo-consent', 'demoCookies', 'demoCookiesPreferences')
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const passwordButton = document.getElementById('demoPassword')
|
|
70
|
+
if (passwordButton) passwordButton.addEventListener('click', () => FormHelper.togglePassword(passwordButton))
|
|
71
|
+
|
|
72
|
+
const demoToggleFormButton = document.getElementById('toggleFormButton')
|
|
73
|
+
const demoToggleFormContent = document.getElementById('toggleFormContent')
|
|
74
|
+
|
|
75
|
+
if (demoToggleFormButton && demoToggleFormContent) {
|
|
76
|
+
const fields = demoToggleFormContent.querySelectorAll('input,select,textarea')
|
|
77
|
+
new Toggle(demoToggleFormButton)
|
|
78
|
+
demoToggleFormButton.addEventListener('toggle:changed', (e) => {
|
|
79
|
+
FormHelper.toggleAttributes(fields, !demoToggleFormContent.hidden, {
|
|
80
|
+
reset: true,
|
|
81
|
+
disabled: true,
|
|
82
|
+
required: ['test'],
|
|
83
|
+
unchanged: ['test']
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const scrollSpy = document.getElementById('demoScrollSpy')
|
|
89
|
+
if (scrollSpy) {
|
|
90
|
+
new Scroll(scrollSpy, {
|
|
91
|
+
navigation: 'demoScrollNav'
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const sortables = document.querySelectorAll('.demo-sortable')
|
|
96
|
+
if (sortables) sortables.forEach(sortable => new Sortable(sortable))
|
|
97
|
+
|
|
98
|
+
const tabpanel = document.getElementById('myPanel')
|
|
99
|
+
if (tabpanel) new Tabpanel(tabpanel)
|
|
100
|
+
|
|
101
|
+
const toggles = document.querySelectorAll('.demo-toggle')
|
|
102
|
+
if (toggles) toggles.forEach(toggle => new Toggle(toggle))
|
|
103
|
+
|
|
104
|
+
const trees = document.querySelectorAll('.demo-tree')
|
|
105
|
+
if (trees) trees.forEach(tree => new Tree(tree))
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@natachah/vanilla-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A vanilla frontend framework",
|
|
6
6
|
"keywords": [
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"test": "vitest --coverage",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"docs:
|
|
23
|
-
"docs:
|
|
20
|
+
"sandbox": "cd sandbox && vite",
|
|
21
|
+
"assets:build": "vite build",
|
|
22
|
+
"docs:dev": "vitepress dev docs",
|
|
23
|
+
"docs:build": "vitepress build docs",
|
|
24
|
+
"docs:preview": "vitepress preview docs"
|
|
24
25
|
},
|
|
25
26
|
"repository": {
|
|
26
27
|
"type": "git",
|
|
@@ -29,15 +30,11 @@
|
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@testing-library/dom": "^9.3.4",
|
|
31
32
|
"@vitest/coverage-v8": "^4.0.17",
|
|
32
|
-
"autoprefixer": "^10.4.
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"postcss": "^8.4.38",
|
|
38
|
-
"sass": "^1.77.5",
|
|
39
|
-
"shiki": "^1.7.0",
|
|
40
|
-
"vite": "^7.3.1",
|
|
33
|
+
"autoprefixer": "^10.4.23",
|
|
34
|
+
"happy-dom": "^20.3.4",
|
|
35
|
+
"postcss": "^8.5.6",
|
|
36
|
+
"sass": "^1.97.3",
|
|
37
|
+
"vitepress": "^2.0.0-alpha.15",
|
|
41
38
|
"vitest": "^4.0.17"
|
|
42
39
|
}
|
|
43
40
|
}
|
package/public/404.html
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-US" dir="ltr">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>404 | Vanilla Frontend</title>
|
|
7
|
+
<meta name="description" content="Not Found">
|
|
8
|
+
<meta name="generator" content="VitePress v2.0.0-alpha.16">
|
|
9
|
+
<link rel="preload stylesheet" href="/assets/style.zIeGMibA.css" as="style">
|
|
10
|
+
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
11
|
+
|
|
12
|
+
<script type="module" src="/assets/app.DsgDPRSA.js"></script>
|
|
13
|
+
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
|
14
|
+
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
15
|
+
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<div id="app"></div>
|
|
19
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"base_layout.md\":\"CTGv6rTn\",\"base_media.md\":\"CcuDUcF-\",\"base_reset.md\":\"DqIdqFRJ\",\"base_typography.md\":\"DV-ikqGZ\",\"classes_badge.md\":\"BCGzPr6f\",\"classes_breadcrumb.md\":\"vU6jlo36\",\"classes_card.md\":\"BZEh2l_B\",\"classes_dropdown.md\":\"BLVw_xQY\",\"classes_grid.md\":\"47v-Ybqe\",\"classes_list.md\":\"BW9PWZV1\",\"components_button.md\":\"vx3HzdpN\",\"components_dialog.md\":\"C-0gJGus\",\"components_disclosure.md\":\"DeSRu9_P\",\"components_form.md\":\"Be8d5WFv\",\"components_loading.md\":\"CKDG7z5x\",\"components_popover.md\":\"CwgNttNc\",\"components_progress.md\":\"CNC7rJiC\",\"components_table.md\":\"LyBkIDkF\",\"index.md\":\"CJiHmjB7\",\"javascript_autofill.md\":\"BewVUo4H\",\"javascript_check.md\":\"B6ajE66i\",\"javascript_comfort.md\":\"BRci3j7V\",\"javascript_consent.md\":\"Bjv8ZDS6\",\"javascript_cookie.md\":\"Dlhyk4Ha\",\"javascript_drawer.md\":\"BCJX3fL-\",\"javascript_form.md\":\"Cwf_gxLI\",\"javascript_scroll.md\":\"BrJijWbF\",\"javascript_slider.md\":\"DDO8wC4u\",\"javascript_sortable.md\":\"BKyem7yw\",\"javascript_tabpanel.md\":\"D9M-_xE0\",\"javascript_toggle.md\":\"C8582WNC\",\"javascript_trap.md\":\"Bc59YUng\",\"javascript_tree.md\":\"uc1UUsFV\",\"prologue_conventions.md\":\"D8nVwlRS\",\"prologue_release.md\":\"CG6nuFnt\",\"prologue_upgrade.md\":\"CFxokaBG\",\"start_customization.md\":\"t-ze_NoQ\",\"start_install.md\":\"OluH7l11\",\"start_mixin.md\":\"D76cLRSX\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Vanilla Frontend\",\"description\":\"Documentation of my package\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/\"}],\"sidebar\":[{\"text\":\"Prologue\",\"items\":[{\"text\":\"Release Notes\",\"link\":\"/prologue/release\"},{\"text\":\"Upgrade guide\",\"link\":\"/prologue/upgrade\"},{\"text\":\"Conventions\",\"link\":\"/prologue/conventions\"}]},{\"text\":\"Quick start\",\"items\":[{\"text\":\"Install\",\"link\":\"/start/install\"},{\"text\":\"Customization\",\"link\":\"/start/customization\"},{\"text\":\"SCSS mixin\",\"link\":\"/start/mixin\"}]},{\"text\":\"Base\",\"items\":[{\"text\":\"Reset\",\"link\":\"/base/reset\"},{\"text\":\"Layout\",\"link\":\"/base/layout\"},{\"text\":\"Typography\",\"link\":\"/base/typography\"},{\"text\":\"Media\",\"link\":\"/base/media\"}]},{\"text\":\"Components\",\"items\":[{\"text\":\"Button\",\"link\":\"/components/button\"},{\"text\":\"Dialog\",\"link\":\"/components/dialog\"},{\"text\":\"Disclosure\",\"link\":\"/components/disclosure\"},{\"text\":\"Form\",\"link\":\"/components/form\"},{\"text\":\"Loading\",\"link\":\"/components/loading\"},{\"text\":\"Popover\",\"link\":\"/components/popover\"},{\"text\":\"Progress\",\"link\":\"/components/progress\"},{\"text\":\"Table\",\"link\":\"/components/table\"}]},{\"text\":\"Class components\",\"items\":[{\"text\":\"Badge\",\"link\":\"/classes/badge\"},{\"text\":\"Breadcrumb\",\"link\":\"/classes/breadcrumb\"},{\"text\":\"Card\",\"link\":\"/classes/card\"},{\"text\":\"Dropdown\",\"link\":\"/classes/dropdown\"},{\"text\":\"Grid\",\"link\":\"/classes/grid\"},{\"text\":\"List\",\"link\":\"/classes/list\"}]},{\"text\":\"Javascript\",\"items\":[{\"text\":\"Autofill\",\"link\":\"/javascript/autofill\"},{\"text\":\"Check all\",\"link\":\"/javascript/check\"},{\"text\":\"Comfort\",\"link\":\"/javascript/comfort\"},{\"text\":\"Consent\",\"link\":\"/javascript/consent\"},{\"text\":\"Cookie\",\"link\":\"/javascript/cookie\"},{\"text\":\"Drawer\",\"link\":\"/javascript/drawer\"},{\"text\":\"Form helper\",\"link\":\"/javascript/form\"},{\"text\":\"Scroll\",\"link\":\"/javascript/scroll\"},{\"text\":\"Slider\",\"link\":\"/javascript/slider\"},{\"text\":\"Sortable\",\"link\":\"/javascript/sortable\"},{\"text\":\"Tabpanel\",\"link\":\"/javascript/tabpanel\"},{\"text\":\"Toggle\",\"link\":\"/javascript/toggle\"},{\"text\":\"Trap\",\"link\":\"/javascript/trap\"},{\"text\":\"Tree\",\"link\":\"/javascript/tree\"}]}],\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024-present <a href=\\\"https://natachaherth.ch\\\">Natacha Herth</a>\"},\"socialLinks\":[{\"icon\":{\"svg\":\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"16\\\" height=\\\"16\\\" fill=\\\"currentColor\\\" class=\\\"bi bi-gitlab\\\" viewBox=\\\"0 0 16 16\\\"><path d=\\\"m15.734 6.1-.022-.058L13.534.358a.57.57 0 0 0-.563-.356.6.6 0 0 0-.328.122.6.6 0 0 0-.193.294l-1.47 4.499H5.025l-1.47-4.5A.572.572 0 0 0 2.47.358L.289 6.04l-.022.057A4.044 4.044 0 0 0 1.61 10.77l.007.006.02.014 3.318 2.485 1.64 1.242 1 .755a.67.67 0 0 0 .814 0l1-.755 1.64-1.242 3.338-2.5.009-.007a4.05 4.05 0 0 0 1.34-4.668Z\\\" /></svg>\"},\"link\":\"https://gitlab.com/packages4913705/vanilla-frontend\",\"ariaLabel\":\"Gitlab\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false,\"additionalConfig\":{}}");</script>
|
|
20
|
+
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as p}from"./chunks/theme.DL_11MHV.js";import{B as o,a4 as i,a5 as u,a6 as c,a7 as l,a8 as f,a9 as d,aa as m,ab as h,ac as g,ad as A,d as v,u as y,p as C,x as P,ae as b,af as w,ag as E,ah as R}from"./chunks/framework.CaiDwmc7.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=y();return C(()=>{P(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&b(),w(),E(),n.setup&&n.setup(),()=>R(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function x(){return A(S)}function D(){let e=o;return h(a=>{let t=g(a),s=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),s=import(t)),o&&(e=!1),s},n.NotFound)}o&&T().then(({app:e,router:a,data:t})=>{a.go(location.href,{initialLoad:!0}).then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{_ as i,o as a,c as t,ai as e}from"./chunks/framework.CaiDwmc7.js";const c=JSON.parse('{"title":"Layout","description":"","frontmatter":{},"headers":[],"relativePath":"base/layout.md","filePath":"base/layout.md"}'),l={name:"base/layout.md"};function n(h,s,p,d,k,r){return a(),t("div",null,[...s[0]||(s[0]=[e(`<h1 id="layout" tabindex="-1">Layout <a class="header-anchor" href="#layout" aria-label="Permalink to “Layout”"></a></h1><p>The framework uses a CSS grid to create the default page layout on the body. It features default CSS variables that you can customize, such as the maximum content width, which is set at <strong>1280px</strong>. Since it uses a grid, it includes gaps and columns.</p><p>Also, the grid template as two content zone available as <strong>full</strong> and <strong>content</strong> that you can use as you wish.</p><p>But as every website can be different, these value can be changed !</p><div class="language-scss"><button title="Copy Code" class="copy"></button><span class="lang">scss</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">@use</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@natachah/vanilla-frontend/scss/base/layout'</span></span></code></pre></div><h2 id="device-breakpoint-viewport" tabindex="-1">Device Breakpoint Viewport <a class="header-anchor" href="#device-breakpoint-viewport" aria-label="Permalink to “Device Breakpoint Viewport”"></a></h2><table tabindex="0"><thead><tr><th>Device</th><th>Breakpoint</th><th>Columns</th><th>Max-width</th></tr></thead><tbody><tr><td>Mobile</td><td>< 720px</td><td>1</td><td>100%</td></tr><tr><td>Tablet</td><td>< 1024px</td><td>6</td><td>100%</td></tr><tr><td>Laptop</td><td>< 1440px</td><td>12</td><td>1280px</td></tr><tr><td>Desktop</td><td>> 1440px</td><td>12</td><td>1280px</td></tr></tbody></table><div class="vp-code-group"><div class="tabs"><input type="radio" name="group-92" id="tab-93" checked><label data-title="html" for="tab-93">html</label><input type="radio" name="group-92" id="tab-94"><label data-title="scss" for="tab-94">scss</label><input type="radio" name="group-92" id="tab-95"><label data-title="css properties" for="tab-95">css properties</label></div><div class="blocks"><div class="language-html active"><button title="Copy Code" class="copy"></button><span class="lang">html</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">body</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> data-preload</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">header</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">header</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
3
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">footer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">footer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">body</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><div class="language-scss"><button title="Copy Code" class="copy"></button><span class="lang">scss</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">@use</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@natachah/vanilla-frontend/scss/base/layout'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span></code></pre></div><div class="language-css"><button title="Copy Code" class="copy"></button><span class="lang">css</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--layout-width</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--layout-gap-block</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--layout-gap-inline</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--layout-columns</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--subgrid-gap-block</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--subgrid-gap-inline</span></span></code></pre></div></div></div><div class="tip custom-block"><p class="custom-block-title custom-block-title-default">TIP</p><p>The <code>--subgrid-gap-*</code> are used for the direct child as <code><header></code>, <code><main></code> and <code><footer></code>. It set by default the gap block at <strong>0</strong> and take the layout inline gap.</p></div><h2 id="container" tabindex="-1">Container <a class="header-anchor" href="#container" aria-label="Permalink to “Container”"></a></h2><p>The default layout include a <code>.container</code> and a <code>.container-full</code>.</p><p>The classic container is centered into the page layout and the full container take the full length of the page. It's perfect if you need to set a background color to a section.</p><div class="language-html"><button title="Copy Code" class="copy"></button><span class="lang">html</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"container"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"container-full"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><h2 id="subgrid" tabindex="-1">Subgrid <a class="header-anchor" href="#subgrid" aria-label="Permalink to “Subgrid”"></a></h2><p>You can re-use the layout grid into a container with the class <code>.subgrid</code>. Then you can use the grid-column CSS property to manage the space.</p><div class="vp-code-group"><div class="tabs"><input type="radio" name="group-118" id="tab-119" checked><label data-title="html" for="tab-119">html</label><input type="radio" name="group-118" id="tab-120"><label data-title="css properties" for="tab-120">css properties</label></div><div class="blocks"><div class="language-html active"><button title="Copy Code" class="copy"></button><span class="lang">html</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"container subgrid"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"container-full subgrid"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">section</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><div class="language-css"><button title="Copy Code" class="copy"></button><span class="lang">css</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--subgrid-gap-block</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">--subgrid-gap-inline</span></span></code></pre></div></div></div>`,16)])])}const g=i(l,[["render",n]]);export{c as __pageData,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,o as a,c as t,ai as e}from"./chunks/framework.CaiDwmc7.js";const c=JSON.parse('{"title":"Layout","description":"","frontmatter":{},"headers":[],"relativePath":"base/layout.md","filePath":"base/layout.md"}'),l={name:"base/layout.md"};function n(h,s,p,d,k,r){return a(),t("div",null,[...s[0]||(s[0]=[e("",16)])])}const g=i(l,[["render",n]]);export{c as __pageData,g as default};
|