mypgs 2.1.0 → 3.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/.vscode/tasks.json +39 -0
- package/AGENTS.md +22 -21
- package/README.md +2 -2
- package/assets/javascript/components/_menu.js +2 -1
- package/assets/javascript/components/_modals.js +1 -1
- package/assets/javascript/components/_notifications.js +2 -1
- package/assets/javascript/components/_slides.js +2 -2
- package/assets/scss/base/_body.scss +5 -5
- package/assets/scss/base/_general.scss +27 -18
- package/assets/scss/base/_variables.scss +1 -1
- package/assets/scss/components/_accordion.scss +9 -7
- package/assets/scss/components/_alerts.scss +71 -0
- package/assets/scss/components/_badges.scss +40 -48
- package/assets/scss/components/_button.scss +27 -19
- package/assets/scss/components/_card.scss +9 -4
- package/assets/scss/components/_formAddon.scss +5 -1
- package/assets/scss/components/_logo.scss +3 -4
- package/assets/scss/components/_menu.scss +26 -3
- package/assets/scss/components/_modals.scss +2 -2
- package/assets/scss/components/_stepTabs.scss +2 -1
- package/assets/scss/index.scss +2 -3
- package/assets/scss/layout/_header.scss +3 -3
- package/assets/scss/layout/_responsive.scss +63 -0
- package/assets/scss/mixin/_mx-base.scss +4 -8
- package/assets/scss/mixin/_mx-button.scss +74 -70
- package/assets/scss/mixin/_mx-card.scss +33 -36
- package/assets/scss/mixin/_mx-form.scss +10 -5
- package/assets/scss/mixin/_mx-formAddon.scss +100 -58
- package/assets/scss/mixin/_mx-hover.scss +21 -15
- package/assets/scss/mixin/_mx-responsive.scss +81 -201
- package/demo/demo.css +9 -6
- package/demo/demo.html +7 -5
- package/demo/demo.js +34 -32
- package/dist/css/index.css +2502 -3507
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/javascript/index.js +7 -5
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/index.min.js +1 -1
- package/docs/componenti-e-markup.md +5 -5
- package/docs/components/accordion.md +3 -3
- package/docs/components/alerts.md +67 -0
- package/docs/components/badges.md +11 -8
- package/docs/components/breadcumbs.md +1 -1
- package/docs/components/button.md +9 -9
- package/docs/components/card.md +9 -6
- package/docs/components/dropdown.md +1 -1
- package/docs/components/form.md +6 -5
- package/docs/components/formAddon.md +56 -19
- package/docs/components/logo.md +1 -1
- package/docs/components/menu.md +2 -2
- package/docs/components/modal.md +7 -6
- package/docs/components/notification.md +2 -2
- package/docs/components/search.md +8 -7
- package/docs/components/slides.md +5 -6
- package/docs/components/stepTabs.md +7 -7
- package/docs/components/steps.md +1 -1
- package/docs/components/summary.md +1 -1
- package/docs/components/table.md +1 -1
- package/docs/components/tooltip.md +4 -3
- package/docs/convenzioni.md +1 -1
- package/docs/export-e-sviluppo.md +1 -1
- package/docs/helper-javascript.md +1 -1
- package/docs/layout/body.md +1 -1
- package/docs/layout/footer.md +7 -3
- package/docs/layout/header.md +5 -4
- package/docs/layout/pageShell.md +11 -11
- package/docs/layout/responsive.md +90 -0
- package/docs/layout/section.md +16 -16
- package/docs/patterns/cookieConsent.md +6 -3
- package/docs/utilizzo-css-scss.md +26 -2
- package/package.json +1 -1
- package/{templates → reference}/html/components/accordion.html +2 -2
- package/reference/html/components/alerts.html +59 -0
- package/{templates → reference}/html/components/badges.html +9 -7
- package/{templates → reference}/html/components/button.html +7 -7
- package/{templates → reference}/html/components/card.html +7 -5
- package/{templates → reference}/html/components/form.html +5 -4
- package/reference/html/components/formAddon.html +109 -0
- package/{templates → reference}/html/components/menu.html +2 -2
- package/{templates → reference}/html/components/modal.html +6 -5
- package/{templates → reference}/html/components/notification.html +2 -2
- package/{templates → reference}/html/components/search.html +7 -6
- package/{templates → reference}/html/components/slides.html +4 -5
- package/{templates → reference}/html/components/stepTabs.html +6 -6
- package/{templates → reference}/html/components/tooltip.html +3 -2
- package/{templates → reference}/html/layout/footer.html +5 -2
- package/{templates → reference}/html/layout/header.html +4 -3
- package/{templates → reference}/html/layout/pageShell.html +10 -10
- package/reference/html/layout/responsive.html +83 -0
- package/{templates → reference}/html/layout/section.html +15 -15
- package/{templates → reference}/html/patterns/cookieConsent.html +4 -2
- package/{templates → reference}/react/components/accordion.jsx +1 -1
- package/reference/react/components/alerts.jsx +46 -0
- package/{templates → reference}/react/components/button.jsx +4 -4
- package/{templates → reference}/react/components/card.jsx +2 -2
- package/{templates → reference}/react/components/form.jsx +1 -1
- package/{templates → reference}/react/components/modal.jsx +2 -2
- package/{templates → reference}/react/components/search.jsx +4 -4
- package/{templates → reference}/react/components/slides.jsx +1 -1
- package/{templates → reference}/react/components/stepTabs.jsx +4 -4
- package/{templates → reference}/react/components/tooltip.jsx +1 -1
- package/{templates → reference}/react/layout/pageShell.jsx +2 -2
- package/reference/react/layout/responsive.jsx +61 -0
- package/{templates → reference}/react/layout/section.jsx +12 -12
- package/{templates → reference}/react/patterns/cookieConsent.jsx +1 -1
- package/{templates → reference}/react/patterns/footer.jsx +1 -1
- package/{templates → reference}/react/patterns/header.jsx +2 -2
- package/scripts/generate-component-docs.js +8 -8
- package/assets/scss/layout/_flex.scss +0 -49
- package/assets/scss/layout/_gap.scss +0 -21
- package/assets/scss/layout/_grid.scss +0 -13
- package/docs/layout/flex.md +0 -116
- package/docs/layout/grid.md +0 -116
- package/templates/html/components/formAddon.html +0 -72
- package/templates/html/layout/flex.html +0 -109
- package/templates/html/layout/grid.html +0 -109
- package/templates/react/layout/flex.jsx +0 -36
- package/templates/react/layout/grid.jsx +0 -36
- /package/{templates → reference}/html/components/breadcumbs.html +0 -0
- /package/{templates → reference}/html/components/dropdown.html +0 -0
- /package/{templates → reference}/html/components/logo.html +0 -0
- /package/{templates → reference}/html/components/steps.html +0 -0
- /package/{templates → reference}/html/components/summary.html +0 -0
- /package/{templates → reference}/html/components/table.html +0 -0
- /package/{templates → reference}/html/layout/body.html +0 -0
- /package/{templates → reference}/react/components/breadcumbs.jsx +0 -0
- /package/{templates → reference}/react/components/dropdown.jsx +0 -0
- /package/{templates → reference}/react/components/logo.jsx +0 -0
- /package/{templates → reference}/react/components/menu.jsx +0 -0
- /package/{templates → reference}/react/components/notification.jsx +0 -0
- /package/{templates → reference}/react/components/steps.jsx +0 -0
- /package/{templates → reference}/react/components/summary.jsx +0 -0
- /package/{templates → reference}/react/components/table.jsx +0 -0
- /package/{templates → reference}/react/layout/body.jsx +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "mx-button" as *;
|
|
2
2
|
@use "mx-form" as *;
|
|
3
|
+
@use "mx-responsive" as *;
|
|
3
4
|
|
|
4
5
|
//= checkboxBackground
|
|
5
6
|
@mixin checkboxBackground() {
|
|
@@ -31,53 +32,6 @@
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
//= TWOSTATE
|
|
35
|
-
@mixin twoState() {
|
|
36
|
-
//== label
|
|
37
|
-
position: relative;
|
|
38
|
-
isolation: isolate;
|
|
39
|
-
--button-background-active: var(--color-primary);
|
|
40
|
-
--button-color-active: var(--color-white);
|
|
41
|
-
@include button();
|
|
42
|
-
flex-wrap: wrap;
|
|
43
|
-
display: flex !important;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
|
|
46
|
-
i {
|
|
47
|
-
opacity: 0.4;
|
|
48
|
-
min-width: 1.4rem;
|
|
49
|
-
transition: 300ms;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
i {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//== checked
|
|
59
|
-
&:has(input:checked) {
|
|
60
|
-
--button-background: var(--button-background-active);
|
|
61
|
-
--button-color: var(--button-color-active);
|
|
62
|
-
|
|
63
|
-
@supports not (color: contrast-color(red)) {
|
|
64
|
-
--button-color: var(--button-color-active);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
i {
|
|
68
|
-
--fa-secondary-opacity: 0.6;
|
|
69
|
-
opacity: 1;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
input {
|
|
74
|
-
opacity: 0;
|
|
75
|
-
z-index: -1;
|
|
76
|
-
position: absolute;
|
|
77
|
-
appearance: none;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
35
|
//= TOGGLE
|
|
82
36
|
@mixin toggle() {
|
|
83
37
|
--toggle-size: var(--border-radius-input);
|
|
@@ -163,18 +117,106 @@
|
|
|
163
117
|
}
|
|
164
118
|
}
|
|
165
119
|
|
|
166
|
-
//=
|
|
120
|
+
//= TWOSTATE
|
|
121
|
+
@mixin twoState($ifHover: true) {
|
|
122
|
+
//== label
|
|
123
|
+
position: relative;
|
|
124
|
+
isolation: isolate;
|
|
125
|
+
@include buttonBase();
|
|
126
|
+
@include buttonContent();
|
|
127
|
+
|
|
128
|
+
@if($ifHover) {
|
|
129
|
+
@include buttonHover();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
flex-wrap: wrap;
|
|
133
|
+
display: flex !important;
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
|
|
136
|
+
i {
|
|
137
|
+
opacity: 0.4;
|
|
138
|
+
min-width: 1.4rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
i {
|
|
143
|
+
opacity: 1;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
//== checked
|
|
148
|
+
&:has(input:checked) {
|
|
149
|
+
--button-background: var(--button-background-active);
|
|
150
|
+
--button-color: var(--button-color-active);
|
|
151
|
+
|
|
152
|
+
i {
|
|
153
|
+
--fa-secondary-opacity: 0.6;
|
|
154
|
+
opacity: 1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
input {
|
|
159
|
+
opacity: 0;
|
|
160
|
+
z-index: -1;
|
|
161
|
+
position: absolute;
|
|
162
|
+
appearance: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@mixin chip() {
|
|
167
|
+
@include twoState(false);
|
|
168
|
+
--button-size: 1rem;
|
|
169
|
+
|
|
170
|
+
&:has(input:checked) {
|
|
171
|
+
&:not(:has(i)) {
|
|
172
|
+
|
|
173
|
+
&::after,
|
|
174
|
+
&::before {
|
|
175
|
+
display: grid;
|
|
176
|
+
place-items: center;
|
|
177
|
+
width: 1.5rem;
|
|
178
|
+
height: 1.5rem;
|
|
179
|
+
border-radius: 50%;
|
|
180
|
+
font-size: 1.5rem;
|
|
181
|
+
line-height: 1;
|
|
182
|
+
font-weight: bold;
|
|
183
|
+
color: var(--color-blackFixed);
|
|
184
|
+
background-color: var(--color-whiteFixed);
|
|
185
|
+
padding: 0.2rem;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//== checkbox
|
|
192
|
+
&:has(input[type=checkbox]:checked) {
|
|
193
|
+
&:not(:has(i)) {
|
|
194
|
+
padding-right: var(--button-size);
|
|
195
|
+
|
|
196
|
+
&::after {
|
|
197
|
+
content: "×";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
//== radio
|
|
203
|
+
&:has(input[type=radio]:checked) {
|
|
204
|
+
&:not(:has(i)) {
|
|
205
|
+
padding-left: var(--button-size);
|
|
206
|
+
|
|
207
|
+
&::before {
|
|
208
|
+
content: "";
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
//= CHIPS
|
|
167
215
|
@mixin chips() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
padding: .4rem;
|
|
171
|
-
outline: var(--border-complete);
|
|
172
|
-
width: fit-content;
|
|
173
|
-
border-radius: var(--border-radius-input);
|
|
174
|
-
background-color: var(--color-box-transparent);
|
|
216
|
+
border: unset;
|
|
217
|
+
@include flexRow();
|
|
175
218
|
|
|
176
219
|
label {
|
|
177
|
-
|
|
178
|
-
--button-background: var(--color-box-transparent);
|
|
220
|
+
@include chip();
|
|
179
221
|
}
|
|
180
|
-
}
|
|
222
|
+
}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
@mixin _hoverColor() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--hover-
|
|
5
|
-
--hover-background: #{$color};
|
|
2
|
+
--hover-background: var(--color-primary-strong);
|
|
3
|
+
--hover-color: var(--color-white);
|
|
4
|
+
background: var(--hover-background);
|
|
6
5
|
color: var(--hover-color);
|
|
7
6
|
--fa-primary-color: var(--hover-color);
|
|
8
7
|
--fa-secondary-color: var(--hover-color);
|
|
9
|
-
background: var(--hover-background);
|
|
10
8
|
|
|
11
|
-
:
|
|
9
|
+
&:not(:disabled) {
|
|
10
|
+
:is(h1, h2, h3, h4, h5, h6, p) {
|
|
11
|
+
color: var(--hover-color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[pgs~=hover-text] {
|
|
15
|
+
color: var(--hover-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
color: var(--hover-color);
|
|
19
|
+
--fa-secondary-opacity: 0.5;
|
|
20
|
+
--fa-primary-color: var(--hover-color);
|
|
21
|
+
--fa-secondary-color: var(--hover-color);
|
|
13
22
|
}
|
|
14
23
|
}
|
|
15
24
|
|
|
@@ -20,7 +29,7 @@
|
|
|
20
29
|
&:focus-visible,
|
|
21
30
|
&:hover {
|
|
22
31
|
box-shadow: 0px 0px 38px 0px var(--hover-shadow-color);
|
|
23
|
-
|
|
32
|
+
outline-width: 0;
|
|
24
33
|
@include _hoverColor();
|
|
25
34
|
}
|
|
26
35
|
}
|
|
@@ -46,11 +55,16 @@
|
|
|
46
55
|
transition: all 200ms;
|
|
47
56
|
cursor: pointer;
|
|
48
57
|
text-decoration: none;
|
|
58
|
+
--hover-color: var(--color-whiteFixed);
|
|
49
59
|
--hover-shadow-color: var(--color-primary);
|
|
50
60
|
--hover-shadow-displacement: 0.25rem;
|
|
51
61
|
$color: var(--color-primary-strong);
|
|
52
62
|
$colorTxtSafari: var(--color-whiteFixed);
|
|
53
63
|
|
|
64
|
+
* {
|
|
65
|
+
transition: all 200ms;
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
&:not(:disabled) {
|
|
55
69
|
&:not([pgs-option~=buttonStyle-2]) {
|
|
56
70
|
@include _hoverContent1();
|
|
@@ -59,14 +73,6 @@
|
|
|
59
73
|
&[pgs-option~=buttonStyle-2] {
|
|
60
74
|
@include _hoverContent2();
|
|
61
75
|
}
|
|
62
|
-
|
|
63
|
-
&:hover {
|
|
64
|
-
--fa-secondary-opacity: 0.5;
|
|
65
|
-
--hover-color: var(--color-whiteFixed);
|
|
66
|
-
color: var(--hover-color);
|
|
67
|
-
--fa-primary-color: var(--hover-color);
|
|
68
|
-
--fa-secondary-color: var(--hover-color);
|
|
69
|
-
}
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
&:is(a):hover {
|
|
@@ -3,46 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
//= FLEX
|
|
5
5
|
//== column
|
|
6
|
-
@mixin flexColumn() {
|
|
6
|
+
@mixin flexColumn($gap: var(--gap-texts)) {
|
|
7
7
|
display: flex;
|
|
8
|
-
gap:
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@mixin flexColumnElements() {
|
|
13
|
-
display: flex;
|
|
14
|
-
gap: var(--gap-elements);
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@mixin flexColumnSections() {
|
|
19
|
-
display: flex;
|
|
20
|
-
gap: var(--gap-sections);
|
|
8
|
+
gap: $gap;
|
|
21
9
|
flex-direction: column;
|
|
22
10
|
}
|
|
23
11
|
|
|
24
12
|
//== row
|
|
25
|
-
@mixin flexRow($wrap: wrap) {
|
|
13
|
+
@mixin flexRow($wrap: wrap, $gap: var(--gap-texts)) {
|
|
26
14
|
display: flex;
|
|
27
|
-
gap:
|
|
15
|
+
gap: $gap;
|
|
28
16
|
flex-direction: row;
|
|
29
17
|
flex-wrap: $wrap;
|
|
30
18
|
}
|
|
31
19
|
|
|
32
|
-
@mixin flexRowElements() {
|
|
33
|
-
display: flex;
|
|
34
|
-
gap: var(--gap-elements);
|
|
35
|
-
flex-direction: row;
|
|
36
|
-
flex-wrap: wrap;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@mixin flexRowSection() {
|
|
40
|
-
display: flex;
|
|
41
|
-
gap: var(--gap-sections);
|
|
42
|
-
flex-direction: row;
|
|
43
|
-
flex-wrap: wrap;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
20
|
//== center
|
|
47
21
|
@mixin center($gap: var(--gap-texts)) {
|
|
48
22
|
display: flex;
|
|
@@ -51,23 +25,16 @@
|
|
|
51
25
|
justify-content: center;
|
|
52
26
|
}
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
//++ basis
|
|
55
29
|
@function _basis($ratio, $gap, $columns) {
|
|
56
30
|
$cols: math.ceil($columns * $ratio);
|
|
57
31
|
@return calc((100% - ($gap * ($cols - 1))) / $cols);
|
|
58
32
|
}
|
|
59
33
|
|
|
60
|
-
//==
|
|
61
|
-
@mixin
|
|
62
|
-
|
|
63
|
-
$
|
|
64
|
-
$gap: var(--gap-elements))
|
|
65
|
-
{
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-wrap: wrap;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
width: 100%;
|
|
70
|
-
gap: $gap;
|
|
34
|
+
//== Column
|
|
35
|
+
@mixin columnFlex($columns: 4) {
|
|
36
|
+
--flex-gap: var(--gap-elements);
|
|
37
|
+
$gap: var(--flex-gap);
|
|
71
38
|
|
|
72
39
|
>* {
|
|
73
40
|
flex: 1 0;
|
|
@@ -97,15 +64,13 @@
|
|
|
97
64
|
|
|
98
65
|
//-( mobile: 1 o 2 colonne
|
|
99
66
|
@container (max-width: #{$mobile}) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
flex-basis:#{_basis(0.33, $gap, $columns)};
|
|
103
|
-
}
|
|
67
|
+
>* {
|
|
68
|
+
flex-basis:#{_basis(0.15, $gap, $columns)};
|
|
104
69
|
}
|
|
105
70
|
|
|
106
|
-
|
|
71
|
+
&[pgs-option~=m2e] {
|
|
107
72
|
>* {
|
|
108
|
-
flex-basis:#{_basis(0.
|
|
73
|
+
flex-basis:#{_basis(0.33, $gap, $columns)};
|
|
109
74
|
}
|
|
110
75
|
}
|
|
111
76
|
}
|
|
@@ -118,79 +83,10 @@
|
|
|
118
83
|
}
|
|
119
84
|
}
|
|
120
85
|
|
|
121
|
-
//== adaptive flex
|
|
122
|
-
@mixin aFlex(
|
|
123
|
-
$columns: 4,
|
|
124
|
-
$start: var(--page-width),
|
|
125
|
-
$mobileTwoElements: false,
|
|
126
|
-
$gap: var(--gap-elements))
|
|
127
|
-
{
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-wrap: wrap;
|
|
130
|
-
justify-content: center;
|
|
131
|
-
width: 100%;
|
|
132
|
-
gap: $gap;
|
|
133
|
-
|
|
134
|
-
>* {
|
|
135
|
-
flex: 1 0;
|
|
136
|
-
flex-basis: #{_basis(1, $gap, $columns)};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ↓ da start (es. 1500px): ratio = 0.75
|
|
140
|
-
@container (max-width: #{$start}) {
|
|
141
|
-
>* {
|
|
142
|
-
flex-basis: #{_basis(0.75, $gap, $columns)};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// ↓ ~ 75% di start: ratio = 0.5
|
|
147
|
-
@container (max-width: #{calc($start * 0.75)}) {
|
|
148
|
-
>* {
|
|
149
|
-
flex-basis: #{_basis(0.5, $gap, $columns)};
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// ↓ ~ 50% di start: ratio = 0.33
|
|
154
|
-
@container (max-width: #{calc($start * 0.5)}) {
|
|
155
|
-
>* {
|
|
156
|
-
flex-basis: #{_basis(0.33, $gap, $columns)};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// ↓ ~ 33% di start: mobile (1 o 2 colonne)
|
|
161
|
-
@container (max-width: #{calc($start * 0.33)}) {
|
|
162
|
-
@if $mobileTwoElements ==true {
|
|
163
|
-
>* {
|
|
164
|
-
flex-basis: #{_basis(0.33, $gap, $columns)};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
@else {
|
|
169
|
-
>* {
|
|
170
|
-
flex-basis: #{_basis(0.15, $gap, $columns)};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// ↓ ~ 20% di start: mobile small / watch (sempre 1 colonna)
|
|
176
|
-
@container (max-width: #{calc($start * 0.2)}) {
|
|
177
|
-
>* {
|
|
178
|
-
flex-basis: #{_basis(0.15, $gap, $columns)};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
86
|
//= GRID
|
|
184
|
-
//==
|
|
185
|
-
@mixin
|
|
186
|
-
$columns: 4,
|
|
187
|
-
$mobileTwoElements: false,
|
|
188
|
-
$gap: var(--gap-elements))
|
|
189
|
-
{
|
|
190
|
-
display: grid;
|
|
191
|
-
width: 100%;
|
|
87
|
+
//== column
|
|
88
|
+
@mixin columnGrid($columns: 4) {
|
|
192
89
|
grid-template-columns: repeat($columns, 1fr);
|
|
193
|
-
gap: $gap;
|
|
194
90
|
|
|
195
91
|
/// dispari
|
|
196
92
|
@if $columns % 2==1 {
|
|
@@ -234,9 +130,8 @@
|
|
|
234
130
|
grid-template-columns: 1fr; // 1 colonna
|
|
235
131
|
}
|
|
236
132
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
//-( mobile
|
|
133
|
+
//-( mobile m2e
|
|
134
|
+
&[pgs-option~=m2e] {
|
|
240
135
|
@container (max-width: #{$mobile}) {
|
|
241
136
|
grid-template-columns: 1fr 1fr; // 2 colonne su mobile
|
|
242
137
|
}
|
|
@@ -248,109 +143,94 @@
|
|
|
248
143
|
}
|
|
249
144
|
}
|
|
250
145
|
|
|
146
|
+
//= ADAPTIVE
|
|
147
|
+
//== adaptive flex
|
|
148
|
+
@mixin _columnAdaptiveFlex($columns: 4) {
|
|
149
|
+
--adaptiveFlex-width: var(--page-width);
|
|
150
|
+
--adaptiveFlex-gap: var(--gap-elements);
|
|
151
|
+
$gap: var(--adaptiveFlex-gap);
|
|
152
|
+
|
|
153
|
+
>* {
|
|
154
|
+
flex: 1 0;
|
|
155
|
+
flex-basis: #{_basis(1, $gap, $columns)};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ↓ da start (es. 1500px): ratio = 0.75
|
|
159
|
+
@container (max-width: #{var(--adaptiveFlex-width)}) {
|
|
160
|
+
>* {
|
|
161
|
+
flex-basis: #{_basis(0.75, $gap, $columns)};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ↓ ~ 75% di start: ratio = 0.5
|
|
166
|
+
@container (max-width: #{calc(var(--adaptiveFlex-width) * 0.75)}) {
|
|
167
|
+
>* {
|
|
168
|
+
flex-basis: #{_basis(0.5, $gap, $columns)};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ↓ ~ 50% di start: ratio = 0.33
|
|
173
|
+
@container (max-width: #{calc(var(--adaptiveFlex-width) * 0.5)}) {
|
|
174
|
+
>* {
|
|
175
|
+
flex-basis: #{_basis(0.33, $gap, $columns)};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ↓ ~ 33% di start: mobile (1 o 2 colonne)
|
|
180
|
+
@container (max-width: #{calc(var(--adaptiveFlex-width) * 0.33)}) {
|
|
181
|
+
>* {
|
|
182
|
+
flex-basis: #{_basis(0.15, $gap, $columns)};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&[pgs-option~=m2e] {
|
|
186
|
+
>* {
|
|
187
|
+
flex-basis: #{_basis(0.33, $gap, $columns)};
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ↓ ~ 20% di start: mobile small / watch (sempre 1 colonna)
|
|
193
|
+
@container (max-width: #{calc(var(--adaptiveFlex-width) * 0.2)}) {
|
|
194
|
+
>* {
|
|
195
|
+
flex-basis: #{_basis(0.15, $gap, $columns)};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
251
200
|
//== adaptive Grid
|
|
252
|
-
@mixin
|
|
253
|
-
|
|
254
|
-
$start: var(--page-width),
|
|
255
|
-
$mobileTwoElements: false,
|
|
256
|
-
$gap: var(--gap-elements))
|
|
257
|
-
{
|
|
258
|
-
display: grid;
|
|
259
|
-
width: 100%;
|
|
201
|
+
@mixin _columnAdaptiveGrid($columns: 4) {
|
|
202
|
+
--adaptiveGrid-width: var(--page-width);
|
|
260
203
|
grid-template-columns: repeat($columns, 1fr);
|
|
261
|
-
gap: $gap;
|
|
262
204
|
|
|
263
205
|
//-( da 1500px
|
|
264
|
-
@container (max-width: #{
|
|
206
|
+
@container (max-width: #{var(--adaptiveGrid-width)}) {
|
|
265
207
|
grid-template-columns: repeat(math.ceil($columns * 0.75), 1fr);
|
|
266
208
|
}
|
|
267
209
|
|
|
268
210
|
//-( circa tablet landscape
|
|
269
|
-
@container (max-width: #{calc(
|
|
211
|
+
@container (max-width: #{calc(var(--adaptiveGrid-width) * 0.75)}) {
|
|
270
212
|
grid-template-columns: repeat(math.ceil($columns * 0.5), 1fr);
|
|
271
213
|
}
|
|
272
214
|
|
|
273
215
|
//-( tablet
|
|
274
|
-
@container (max-width: #{calc(
|
|
216
|
+
@container (max-width: #{calc(var(--adaptiveGrid-width) * 0.5)}) {
|
|
275
217
|
grid-template-columns: repeat(math.ceil($columns * 0.33), 1fr);
|
|
276
218
|
}
|
|
277
219
|
|
|
278
220
|
//-( mobile
|
|
279
|
-
@container (max-width: #{calc(
|
|
221
|
+
@container (max-width: #{calc(var(--adaptiveGrid-width) * 0.33)}) {
|
|
280
222
|
grid-template-columns: 1fr;
|
|
281
223
|
}
|
|
282
224
|
|
|
283
|
-
|
|
284
|
-
|
|
225
|
+
//-( mobile m2e
|
|
226
|
+
&[pgs-option~=m2e] {
|
|
227
|
+
@container (max-width: #{calc(var(--adaptiveGrid-width) * 0.33)}) {
|
|
285
228
|
grid-template-columns: 1fr 1fr;
|
|
286
229
|
}
|
|
287
230
|
}
|
|
288
231
|
|
|
289
232
|
//-( mobile small / watch
|
|
290
|
-
@container (max-width: #{calc(
|
|
233
|
+
@container (max-width: #{calc(var(--adaptiveGrid-width) * 0.2)}) {
|
|
291
234
|
grid-template-columns: 1fr;
|
|
292
235
|
}
|
|
293
236
|
}
|
|
294
|
-
|
|
295
|
-
// //- laptop
|
|
296
|
-
// @media (max-width: $laptop) {
|
|
297
|
-
// * {
|
|
298
|
-
// outline: red solid 0.1px
|
|
299
|
-
// }
|
|
300
|
-
// }
|
|
301
|
-
|
|
302
|
-
// //- tablet
|
|
303
|
-
// @media (max-width: $tablet) {
|
|
304
|
-
// * {
|
|
305
|
-
// outline: green solid 0.1px
|
|
306
|
-
// }
|
|
307
|
-
// }
|
|
308
|
-
|
|
309
|
-
// //- mobile
|
|
310
|
-
// @media (max-width: $mobile) {
|
|
311
|
-
// * {
|
|
312
|
-
// outline: blue solid 0.1px
|
|
313
|
-
// }
|
|
314
|
-
// }
|
|
315
|
-
|
|
316
|
-
// //- mobile small
|
|
317
|
-
// @media (max-width: $watch) {
|
|
318
|
-
// * {
|
|
319
|
-
// outline: yellow solid 0.1px
|
|
320
|
-
// }
|
|
321
|
-
// }
|
|
322
|
-
|
|
323
|
-
// //-( laptop
|
|
324
|
-
// @container (max-width: #{$laptop}) {
|
|
325
|
-
// * {
|
|
326
|
-
// outline: purple solid 0.1px
|
|
327
|
-
// }
|
|
328
|
-
// }
|
|
329
|
-
|
|
330
|
-
// //-( big-tablet
|
|
331
|
-
// @container (max-width: #{$big-tablet}) {
|
|
332
|
-
// * {
|
|
333
|
-
// outline: orange solid 0.1px
|
|
334
|
-
// }
|
|
335
|
-
// }
|
|
336
|
-
|
|
337
|
-
// //-( tablet
|
|
338
|
-
// @container (max-width: #{$tablet}) {
|
|
339
|
-
// * {
|
|
340
|
-
// outline: pink solid 0.1px
|
|
341
|
-
// }
|
|
342
|
-
// }
|
|
343
|
-
|
|
344
|
-
// //-( mobile
|
|
345
|
-
// @container (max-width: #{$mobile}) {
|
|
346
|
-
// * {
|
|
347
|
-
// outline: brown solid 0.1px
|
|
348
|
-
// }
|
|
349
|
-
// }
|
|
350
|
-
|
|
351
|
-
// //-( mobile small
|
|
352
|
-
// @container (max-width: #{$watch}) {
|
|
353
|
-
// * {
|
|
354
|
-
// outline: gray solid 0.1px
|
|
355
|
-
// }
|
|
356
|
-
// }
|
package/demo/demo.css
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
body{
|
|
2
2
|
--color-background: light-dark(#f1ffef, #101010);
|
|
3
|
+
&.is-loading{
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
3
6
|
}
|
|
4
7
|
|
|
5
8
|
.primary-menu {
|
|
@@ -15,7 +18,7 @@ pre {
|
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
.
|
|
21
|
+
.reference-title {
|
|
19
22
|
color: var(--color-primary);
|
|
20
23
|
display: flex;
|
|
21
24
|
align-items: center;
|
|
@@ -50,20 +53,20 @@ pre {
|
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
[pgs~=buttonBig]{
|
|
56
|
+
[pgs~=button][pgs-option~=buttonBig]{
|
|
54
57
|
max-width: 300px;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
#
|
|
60
|
+
#reference-demo-before{
|
|
58
61
|
position: relative;
|
|
59
62
|
z-index: 2;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
#
|
|
65
|
+
#reference-demo-main{
|
|
63
66
|
position: relative;
|
|
64
67
|
z-index: 1;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
#
|
|
70
|
+
#reference-demo-after{
|
|
68
71
|
position: relative;
|
|
69
|
-
}
|
|
72
|
+
}
|
package/demo/demo.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>MyPGS
|
|
7
|
+
<title>MyPGS reference demo</title>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
10
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Urbanist:ital,wght@0,100..900;1,100..900&display=swap">
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
<link rel="stylesheet" href="demo.css">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
|
-
<body pgs="bodyBase bodyImg bodyText bodyHeading">
|
|
17
|
-
<div id="
|
|
18
|
-
<main id="
|
|
19
|
-
<div id="
|
|
16
|
+
<body class="is-loading" pgs="bodyBase bodyImg bodyText bodyHeading">
|
|
17
|
+
<div id="reference-demo-before"></div>
|
|
18
|
+
<main id="reference-demo-main" pgs="main"></main>
|
|
19
|
+
<div id="reference-demo-after"></div>
|
|
20
|
+
|
|
20
21
|
<script src="./demo.js"></script>
|
|
22
|
+
|
|
21
23
|
</body>
|
|
22
24
|
|
|
23
25
|
</html>
|