@total_onion/onion-library 1.0.78 → 1.0.79

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.
@@ -0,0 +1,163 @@
1
+ // LIBRARY FILE - Do not modify/override here as your changes will be lost when the package is updated.
2
+ @use 'Assets/scss/theme/breakpoints';
3
+ @use 'Assets/scss/modules/library-modules/core-mixins/core-mixins';
4
+ @use 'Assets/scss/modules/library-modules/core-functions/core-functions';
5
+
6
+ // Do not edit this file directly as it is a library module and
7
+ // any changes will be overwritten by future updates.
8
+
9
+ body {
10
+ --screen-width: var(--screen-width-mobile);
11
+ --font-reference: var(--font-reference-mobile);
12
+ --design-reference: var(--mobile-design-reference);
13
+ @include core-mixins.device(breakpoints.$tabPortrait) {
14
+ --screen-width: var(--screen-width-portrait);
15
+ --font-reference: var(--font-reference-portrait);
16
+ --design-reference: var(--portrait-design-reference);
17
+ }
18
+ @include core-mixins.device(breakpoints.$tabLandscape) {
19
+ --screen-width: var(--screen-width-landscape);
20
+ --font-reference: var(--font-reference-landscape);
21
+ --design-reference: var(--landscape-design-reference);
22
+ }
23
+ @include core-mixins.device(breakpoints.$desktop) {
24
+ --screen-width: var(--screen-width-desktop);
25
+ --font-reference: var(--font-reference-desktop);
26
+ --design-reference: var(--desktop-design-reference);
27
+ }
28
+ @include core-mixins.device(breakpoints.$desktop-fullhd) {
29
+ --screen-width: var(--screen-width-fullhd);
30
+ --font-reference: var(--font-reference-fullhd);
31
+ --design-reference: var(--fullhd-design-reference);
32
+ }
33
+ }
34
+ body {
35
+ //**SPACING VARS**\\
36
+
37
+ //Global Inline Spacing
38
+ --global-inline-spacing: #{core-functions.fluidSize(
39
+ var(--mobile-inline),
40
+ 'mobile'
41
+ )};
42
+
43
+ @include core-mixins.device(breakpoints.$tabPortrait) {
44
+ --global-inline-spacing: #{core-functions.fluidSize(
45
+ var(--portrait-inline),
46
+ 'portrait'
47
+ )};
48
+ }
49
+
50
+ @include core-mixins.device(breakpoints.$tabLandscape) {
51
+ --global-inline-spacing: #{core-functions.fluidSize(
52
+ var(--landscape-inline),
53
+ 'landscape'
54
+ )};
55
+ }
56
+
57
+ @include core-mixins.device(breakpoints.$desktop) {
58
+ --global-inline-spacing: #{core-functions.fluidSize(
59
+ var(--desktop-inline),
60
+ 'desktop'
61
+ )};
62
+ }
63
+ }
64
+ body {
65
+ // Content box padding - inline - This setting is intentionally set to the global inline size.
66
+ // You can override it if you need it to be different (like in Chivas which has a stupid inline size)
67
+ --global-content-box-padding-inline: #{core-functions.fluidSize(
68
+ var(--mobile-inline),
69
+ 'mobile'
70
+ )};
71
+
72
+ @include core-mixins.device(breakpoints.$tabPortrait) {
73
+ --global-content-box-padding-inline: #{core-functions.fluidSize(
74
+ var(--portrait-inline),
75
+ 'portrait'
76
+ )};
77
+ }
78
+
79
+ @include core-mixins.device(breakpoints.$tabLandscape) {
80
+ --global-content-box-padding-inline: #{core-functions.fluidSize(
81
+ var(--landscape-inline),
82
+ 'landscape'
83
+ )};
84
+ }
85
+
86
+ @include core-mixins.device(breakpoints.$desktop) {
87
+ --global-content-box-padding-inline: #{core-functions.fluidSize(
88
+ var(--desktop-inline),
89
+ 'desktop'
90
+ )};
91
+ }
92
+ }
93
+ body {
94
+ //Content box padding - block
95
+ --global-content-box-padding-block: #{core-functions.fluidSize(
96
+ var(--mobile-inline),
97
+ 'mobile'
98
+ )};
99
+
100
+ @include core-mixins.device(breakpoints.$tabPortrait) {
101
+ --global-content-box-padding-block: #{core-functions.fluidSize(
102
+ var(--portrait-inline),
103
+ 'portrait'
104
+ )};
105
+ }
106
+
107
+ @include core-mixins.device(breakpoints.$tabLandscape) {
108
+ --global-content-box-padding-block: #{core-functions.fluidSize(
109
+ var(--landscape-inline),
110
+ 'landscape'
111
+ )};
112
+ }
113
+
114
+ @include core-mixins.device(breakpoints.$desktop) {
115
+ --global-content-box-padding-block: #{core-functions.fluidSize(
116
+ var(--desktop-inline),
117
+ 'desktop'
118
+ )};
119
+ }
120
+ }
121
+ body {
122
+ //Heading block Spacing
123
+ --heading-block-spacing: var(--heading-block-spacing-mobile);
124
+
125
+ @include core-mixins.device(breakpoints.$tabPortrait) {
126
+ --heading-block-spacing: var(--heading-block-spacing-portrait);
127
+ }
128
+
129
+ @include core-mixins.device(breakpoints.$tabLandscape) {
130
+ --heading-block-spacing: var(--heading-block-spacing-desktop);
131
+ }
132
+ }
133
+ body {
134
+ //Paragraph block spacing
135
+ --paragraph-block-spacing: var(--paragraph-block-spacing-mobile);
136
+
137
+ @include core-mixins.device(breakpoints.$tabPortrait) {
138
+ --paragraph-block-spacing: var(--paragraph-block-spacing-portrait);
139
+ }
140
+
141
+ @include core-mixins.device(breakpoints.$tabLandscape) {
142
+ --paragraph-block-spacing: var(--paragraph-block-spacing-desktop);
143
+ }
144
+ }
145
+ body {
146
+ //List Item block spacing
147
+ --list-item-block-spacing: var(--list-item-block-spacing-mobile);
148
+
149
+ @include core-mixins.device(breakpoints.$tabPortrait) {
150
+ --list-item-block-spacing: var(--list-item-block-spacing-portrait);
151
+ }
152
+
153
+ @include core-mixins.device(breakpoints.$tabLandscape) {
154
+ --list-item-block-spacing: var(--list-item-block-spacing-desktop);
155
+ }
156
+ }
157
+ body {
158
+ //Max width to restrict the main container if desired.
159
+ --global-content-max-width: #{core-functions.fluidSize(
160
+ var(--global-content-max-width-setting),
161
+ 'static'
162
+ )};
163
+ }
@@ -0,0 +1,279 @@
1
+ // LIBRARY FILE - Do not modify/override here as your changes will be lost when the package is updated.
2
+ @use 'Assets/scss/modules/library-modules/core-functions/core-functions';
3
+ @use 'Assets/scss/modules/library-modules/core-mixins/core-mixins';
4
+ @use 'Assets/scss/theme/breakpoints';
5
+
6
+ @mixin ctaButtonStyles() {
7
+ [class*='cmpl-cta-style-'] {
8
+ border: unset;
9
+ line-height: 100%;
10
+ position: relative;
11
+ display: flex;
12
+ gap: 1em;
13
+ justify-content: center;
14
+ align-items: center;
15
+ text-decoration-line: unset;
16
+ text-align: center;
17
+ transition:
18
+ background-color 0.1s,
19
+ border-colour 0.1s;
20
+
21
+ &:hover,
22
+ &:active,
23
+ &:focus {
24
+ cursor: pointer;
25
+ }
26
+
27
+ &[disabled] {
28
+ cursor: not-allowed;
29
+ }
30
+ margin-bottom: 0;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .cmpl-cta-span {
35
+ width: 100%;
36
+ }
37
+
38
+ .cmpl-cta-icon {
39
+ width: 1em;
40
+ }
41
+
42
+ @for $i from 1 through 20 {
43
+ .cmpl-cta-style-#{$i} {
44
+ justify-self: var(--cta-alignment);
45
+ justify-content: var(
46
+ --cta-style-#{$i}-content-vertical-alignment,
47
+ center
48
+ );
49
+ background-image: var(--cta-style#{$i}-image-background);
50
+ background-size: var(--cta-style#{$i}-image-background-size);
51
+ background-repeat: var(--cta-style#{$i}-image-background-repeat);
52
+ background-color: var(--cta-style-#{$i}-mobile-background-colour);
53
+ color: var(--cta-style-#{$i}-mobile-colour);
54
+ svg * {
55
+ fill: currentColor;
56
+ stroke: currentColor;
57
+ }
58
+ border: var(--cta-style-#{$i}-border-width)
59
+ solid
60
+ var(--cta-style-#{$i}-mobile-border-colour);
61
+ border-radius: var(--cta-style-#{$i}-border-radius);
62
+ font-weight: var(--cta-style-#{$i}-font-weight);
63
+ letter-spacing: var(--cta-style-#{$i}-letter-spacing);
64
+ line-height: var(--cta-style-#{$i}-line-height);
65
+ font-family: var(--cta-style-#{$i}-font-family);
66
+ text-transform: var(--cta-style-#{$i}-text-transform);
67
+ font-style: var(--cta-style-#{$i}-font-style);
68
+ text-align: var(--cta-style-#{$i}-text-align);
69
+ text-decoration: var(--cta-style-#{$i}-decoration-style);
70
+ text-decoration-color: var(--cta-style-#{$i}-decoration-colour);
71
+
72
+ font-size: clamp(
73
+ var(--cta-style-font-size-min-mobile, 10px),
74
+ core-functions.fontSize(
75
+ var(--cta-style-#{$i}-font-size-mobile),
76
+ 'mobile'
77
+ ),
78
+ var(--cta-style-font-size-max-mobile, 180px)
79
+ );
80
+
81
+ min-width: var(--cta-style-#{$i}-min-width-mobile);
82
+ padding: core-functions.fluidSize(
83
+ var(--cta-style-#{$i}-padding-block-mobile),
84
+ 'mobile'
85
+ )
86
+ core-functions.fluidSize(
87
+ var(--cta-style-#{$i}-padding-inline-mobile),
88
+ 'mobile'
89
+ );
90
+ // shadow
91
+ --box-shadow-offset-x: var(--cta-style-#{$i}-shadow-offset-x, 0);
92
+ --box-shadow-offset-y: var(--cta-style-#{$i}-shadow-offset-y, 0);
93
+ --box-shadow-blur: var(--cta-style-#{$i}-shadow-blur, 0);
94
+ --box-shadow-spread: var(--cta-style-#{$i}-shadow-radius, 0);
95
+ --box-shadow-colour: var(--cta-style-#{$i}-shadow-colour, 0);
96
+ --box-shadow-position: var(--cta-style-#{$i}-shadow-position, 0);
97
+
98
+ // hover shadow
99
+ --box-shadow-hover-offset-x: var(
100
+ --cta-style-#{$i}-shadow-offset-hover-x,
101
+ 0
102
+ );
103
+ --box-shadow-hover-offset-y: var(
104
+ --cta-style-#{$i}-shadow-offset-hover-y,
105
+ 0
106
+ );
107
+ --box-shadow-hover-blur: var(
108
+ --cta-style-#{$i}-shadow-hover-blur,
109
+ 0
110
+ );
111
+ --box-shadow-hover-spread: var(
112
+ --cta-style-#{$i}-shadow-hover-radius,
113
+ 0
114
+ );
115
+ --box-shadow-hover-colour: var(
116
+ --cta-style-#{$i}-shadow-hover-colour,
117
+ 0
118
+ );
119
+ --box-shadow-hover-position: var(
120
+ --cta-style-#{$i}-shadow-hover-position,
121
+ 0
122
+ );
123
+ @include core-mixins.boxShadow();
124
+
125
+ @include core-mixins.device(breakpoints.$tabPortrait) {
126
+ font-size: clamp(
127
+ var(--cta-style-font-size-min-mobile, 10px),
128
+ core-functions.fontSize(
129
+ var(--cta-style-#{$i}-font-size-portrait),
130
+ 'portrait'
131
+ ),
132
+ var(--cta-style-font-size-max-mobile, 180px)
133
+ );
134
+ min-width: var(--cta-style-#{$i}-min-width-portrait);
135
+ padding: core-functions.fluidSize(
136
+ var(--cta-style-#{$i}-padding-block-portrait),
137
+ 'portrait'
138
+ )
139
+ core-functions.fluidSize(
140
+ var(--cta-style-#{$i}-padding-inline-portrait),
141
+ 'portrait'
142
+ );
143
+ background-color: var(--cta-style-#{$i}-background-colour);
144
+ border: var(--cta-style-#{$i}-border-width) solid
145
+ var(--cta-style-#{$i}-border-colour);
146
+ color: var(--cta-style-#{$i}-colour);
147
+ svg * {
148
+ fill: currentColor;
149
+ stroke: currentColor;
150
+ }
151
+ }
152
+
153
+ @include core-mixins.device(breakpoints.$tabLandscape) {
154
+ font-size: clamp(
155
+ var(--cta-style-font-size-min-desktop, 10px),
156
+ core-functions.fontSize(
157
+ var(--cta-style-#{$i}-font-size-landscape),
158
+ 'landscape'
159
+ ),
160
+ var(--cta-style-font-size-max-desktop, 180px)
161
+ );
162
+ min-width: var(--cta-style-#{$i}-min-width-landscape);
163
+ padding: core-functions.fluidSize(
164
+ var(--cta-style-#{$i}-padding-block-landscape),
165
+ 'landscape'
166
+ )
167
+ core-functions.fluidSize(
168
+ var(--cta-style-#{$i}-padding-inline-landscape),
169
+ 'landscape'
170
+ );
171
+ }
172
+
173
+ @include core-mixins.device(breakpoints.$desktop) {
174
+ font-size: clamp(
175
+ var(--cta-style-font-size-min-desktop, 10px),
176
+ core-functions.fontSize(
177
+ var(--cta-style-#{$i}-font-size-desktop),
178
+ 'desktop'
179
+ ),
180
+ var(--cta-style-font-size-max-desktop, 180px)
181
+ );
182
+ min-width: var(--cta-style-#{$i}-min-width-desktop);
183
+ padding: core-functions.fluidSize(
184
+ var(--cta-style-#{$i}-padding-block-desktop),
185
+ 'desktop'
186
+ )
187
+ core-functions.fluidSize(
188
+ var(--cta-style-#{$i}-padding-inline-desktop),
189
+ 'desktop'
190
+ );
191
+ }
192
+
193
+ // this makes hover effect available only on desktops, avoiding the hover effect to stuck on mobile after click
194
+ @media (hover: hover) {
195
+ &:hover {
196
+ text-decoration: var(
197
+ --cta-style-#{$i}-decoration-style-hover
198
+ );
199
+ text-decoration-color: var(
200
+ --cta-style-#{$i}-decoration-colour-hover
201
+ );
202
+ border: var(--cta-style-#{$i}-border-width) solid
203
+ var(--cta-style-#{$i}-mobile-hover-border-colour);
204
+ background-color: var(
205
+ --cta-style-#{$i}-mobile-hover-background-colour
206
+ );
207
+ color: var(--cta-style-#{$i}-mobile-hover-colour);
208
+ svg * {
209
+ fill: currentColor;
210
+ stroke: currentColor;
211
+ }
212
+
213
+ // for touch devices fix hover state
214
+ @media (hover: none) {
215
+ background-color: var(
216
+ --cta-style-#{$i}-mobile-background-colour
217
+ );
218
+ }
219
+
220
+ @include core-mixins.device(breakpoints.$tabPortrait) {
221
+ background-color: var(
222
+ --cta-style-#{$i}-hover-background-colour
223
+ );
224
+ border: var(--cta-style-#{$i}-border-width) solid
225
+ var(--cta-style-#{$i}-hover-border-colour);
226
+ color: var(--cta-style-#{$i}-hover-colour);
227
+ svg * {
228
+ fill: currentColor;
229
+ stroke: currentColor;
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ &:active {
236
+ color: var(--cta-style-#{$i}-active-colour);
237
+ background-color: var(
238
+ --cta-style-#{$i}-active-background-colour
239
+ );
240
+ border: var(--cta-style-#{$i}-border-width)
241
+ solid
242
+ var(--cta-style-#{$i}-active-border-colour);
243
+ }
244
+
245
+ // &:focus {
246
+ // color: var(--cta-style-#{$i}-focus-colour);
247
+ // background-color: var(--cta-style-#{$i}-focus-background-colour);
248
+ // border: var(--cta-style-#{$i}-border-width) solid var(--cta-style-#{$i}-focus-border-colour);
249
+ // }
250
+
251
+ &--inactive,
252
+ &.cta-style-inactive,
253
+ &[disabled] {
254
+ color: var(--cta-style-#{$i}-inactive-colour);
255
+ background-color: var(
256
+ --cta-style-#{$i}-inactive-background-colour
257
+ );
258
+ border: var(--cta-style-#{$i}-border-width)
259
+ solid
260
+ var(--cta-style-#{$i}-inactive-border-colour);
261
+ }
262
+
263
+ &--selected,
264
+ &.cta-style-selected {
265
+ color: var(--cta-style-#{$i}-selected-colour);
266
+ background-color: var(
267
+ --cta-style-#{$i}-selected-background-colour
268
+ );
269
+ border: var(--cta-style-#{$i}-border-width)
270
+ solid
271
+ var(--cta-style-#{$i}-selected-border-colour);
272
+ }
273
+ }
274
+ }
275
+ }
276
+
277
+ @mixin core-cta() {
278
+ @include ctaButtonStyles();
279
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {