qc-trousse-sdg 1.2.5-dev → 1.3.0-develop.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.
Files changed (97) hide show
  1. package/README.md +18 -3
  2. package/dist/css/qc-sdg-design-tokens.min.css +1 -1
  3. package/dist/css/qc-sdg-no-grid.min.css +1 -1
  4. package/dist/css/qc-sdg.min.css +1 -1
  5. package/dist/img/QUEBEC_blanc.svg +1 -1
  6. package/dist/img/QUEBEC_couleur.svg +24 -0
  7. package/dist/js/qc-sdg.min.js +1 -1
  8. package/package.json +23 -18
  9. package/public/css/qc-doc-sdg.css +247 -335
  10. package/public/css/qc-sdg-design-tokens.css +111 -64
  11. package/public/css/qc-sdg-no-grid.css +932 -428
  12. package/public/css/qc-sdg.css +941 -609
  13. package/public/img/QUEBEC_blanc.svg +1 -1
  14. package/public/img/QUEBEC_couleur.svg +24 -0
  15. package/public/img/ampoule.svg +1 -0
  16. package/public/img/note.svg +1 -0
  17. package/public/img/piv-MCE-theme-clair.svg +79 -0
  18. package/public/img/piv-MCE-theme-sombre.svg +62 -0
  19. package/public/img/piv-bas-MCE-theme-clair.png +0 -0
  20. package/public/img/piv-bas-MCE-theme-sombre.png +0 -0
  21. package/public/img/piv-logo-pied-de-page.svg +37 -0
  22. package/public/index.html +871 -715
  23. package/public/js/qc-doc-exemple.js +9 -0
  24. package/public/js/qc-doc-sdg.js +6893 -3724
  25. package/public/js/qc-sdg.js +2103 -962
  26. package/rollup.config.js +58 -23
  27. package/src/doc/components/Code.svelte +69 -0
  28. package/src/doc/components/Exemple.svelte +71 -0
  29. package/src/doc/components/Switch.svelte +108 -0
  30. package/src/doc/components/TopNav.svelte +53 -0
  31. package/src/doc/components/color-doc.svelte +44 -0
  32. package/src/doc/qc-doc-sdg.js +25 -14
  33. package/src/doc/scss/_tables.scss +1 -2
  34. package/src/doc/scss/components/_button.scss +14 -14
  35. package/src/doc/scss/components/_code.scss +106 -4
  36. package/src/doc/scss/jQueryUI/_jquery-ui.autocomplete.scss +48 -0
  37. package/src/doc/scss/qc-doc-sdg.scss +76 -75
  38. package/src/sdg/components/Button/IconButton.svelte +29 -0
  39. package/src/sdg/components/Icon.svelte +39 -0
  40. package/src/sdg/components/{pivHeader.svelte → PivHeader/pivHeader.svelte} +49 -69
  41. package/src/sdg/components/SearchBar/searchBar.svelte +87 -0
  42. package/src/sdg/components/SearchInput/SearchInput.svelte +48 -0
  43. package/src/sdg/components/alert.svelte +40 -23
  44. package/src/sdg/components/componentWrapper.js +0 -3
  45. package/src/sdg/components/externalLink.svelte +92 -0
  46. package/src/sdg/components/notice.svelte +61 -34
  47. package/src/sdg/components/pivFooter.svelte +37 -36
  48. package/src/sdg/components/toTop.svelte +16 -10
  49. package/src/sdg/components/utils.js +28 -4
  50. package/src/sdg/qc-sdg.js +11 -3
  51. package/src/sdg/scss/_qc-sdg-lib.scss +3 -0
  52. package/src/sdg/scss/base/_accessibility.scss +4 -0
  53. package/src/sdg/scss/base/_colors.scss +10 -10
  54. package/src/sdg/scss/base/_figure.scss +14 -9
  55. package/src/sdg/scss/base/_fonts.scss +4 -4
  56. package/src/sdg/scss/base/_form.scss +7 -0
  57. package/src/sdg/scss/base/_layout.scss +45 -0
  58. package/src/sdg/scss/base/_lists.scss +5 -5
  59. package/src/sdg/scss/base/_shadings.scss +3 -11
  60. package/src/sdg/scss/base/_typography.scss +42 -25
  61. package/src/sdg/scss/components/_alert.scss +11 -34
  62. package/src/sdg/scss/components/_icons.scss +67 -38
  63. package/src/sdg/scss/components/_notice.scss +51 -44
  64. package/src/sdg/scss/components/_pivFooter.scss +35 -23
  65. package/src/sdg/scss/components/_pivHeader.scss +131 -154
  66. package/src/sdg/scss/components/_searchBar.scss +75 -0
  67. package/src/sdg/scss/components/_searchInput.scss +64 -0
  68. package/src/sdg/scss/components/_separator.scss +2 -5
  69. package/src/sdg/scss/components/_toTop.scss +4 -6
  70. package/src/sdg/scss/grid/_grid-lib.scss +516 -0
  71. package/src/sdg/scss/grid/_grid.scss +78 -0
  72. package/src/sdg/scss/lib/_functions.scss +78 -0
  73. package/src/sdg/scss/lib/_gridless-lib.scss +4 -0
  74. package/src/sdg/scss/lib/_mixins.scss +221 -0
  75. package/src/sdg/scss/qc-design-tokens.scss +31 -8
  76. package/src/sdg/scss/qc-sdg-utilities.scss +1 -0
  77. package/src/sdg/scss/qc-sdg.scss +1 -1
  78. package/src/sdg/scss/qc-sgd-no-grid.scss +20 -15
  79. package/src/sdg/scss/settings/_base.scss +58 -0
  80. package/src/sdg/scss/settings/_tokens.scss +145 -77
  81. package/src/sdg/scss/utilities/_display.scss +43 -3
  82. package/src/sdg/scss/utilities/_themes.scss +17 -0
  83. package/src/sdg/scss/vendor/modern-css-reset/src/reset.css +9 -8
  84. package/dist/img/logo-quebec-piv-footer.svg +0 -1
  85. package/dist/img/quebec-logo.svg +0 -13
  86. package/public/img/logo-quebec-piv-footer.svg +0 -1
  87. package/src/doc/components/code.svelte +0 -54
  88. package/src/sdg/scss/base/_grid.scss +0 -9
  89. package/src/sdg/scss/functions/_tokens.scss +0 -12
  90. package/src/sdg/scss/functions/_utils.scss +0 -44
  91. package/src/sdg/scss/modules/_grid.scss +0 -19
  92. package/src/sdg/scss/modules/_helpers.scss +0 -32
  93. package/src/sdg/scss/modules/_map.scss +0 -14
  94. package/src/sdg/scss/modules/_tokens.scss +0 -3
  95. package/src/sdg/scss/modules/_utils.scss +0 -55
  96. package/src/sdg/scss/settings/_grid.scss +0 -24
  97. package/src/sdg/scss/settings/_settings.scss +0 -12
@@ -0,0 +1,516 @@
1
+ // fichier construit à partir de bootstrap, pour éviter d'utiliser la direction @import, déprécié.
2
+ // voir les commentaires des différentes sections
3
+
4
+ @use "sass:color";
5
+ @use "sass:string";
6
+ @use 'sass:math';
7
+ @use 'sass:map';
8
+ @use 'sass:list';
9
+ @use 'sass:meta';
10
+ @use "settings/base";
11
+ @use "settings/tokens";
12
+ @use "lib/functions" as *;
13
+
14
+ $enable-grid-classes: base.$enable-grid-classes;
15
+ $enable-deprecation-messages : false;
16
+ $grid-columns: 12;
17
+ $grid-row-columns: 6 !default;
18
+ $grid-breakpoints: map.get(tokens.$lg-tokens, grid, breakpoint);
19
+ $grid-gutter-width: token-value(grid gutter);
20
+ $container-max-widths: map.get(tokens.$lg-tokens, grid, container-max-width);
21
+
22
+ // équivalent à @import(src/sdg/scss/vendor/bootstrap-rewrite/mixins/_grid-framework.scss)
23
+ // Framework grid generation
24
+ //
25
+ // Used only by Bootstrap to generate the correct number of grid classes given
26
+ // any value of `$grid-columns`.
27
+ @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
28
+ // Common properties for all breakpoints
29
+ // Common properties for all breakpoints
30
+ // Common properties for all breakpoints
31
+ %grid-column {
32
+ position: relative;
33
+ width: 100%;
34
+ padding-right: calc(1 * $gutter / 2);
35
+ padding-left: calc(1 * $gutter / 2);
36
+ }
37
+
38
+ @each $breakpoint in map.keys($breakpoints) {
39
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
40
+
41
+ @if $columns > 0 {
42
+ // Allow columns to stretch full width below their breakpoints
43
+ @for $i from 1 through $columns {
44
+ .qc-col#{$infix}-#{$i} {
45
+ @extend %grid-column;
46
+ }
47
+ }
48
+ }
49
+
50
+ .qc-col#{$infix},
51
+ .qc-col#{$infix}-auto {
52
+ @extend %grid-column;
53
+ }
54
+
55
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
56
+ // Provide basic `.qc-col-{bp}` classes for equal-width flexbox columns
57
+ .qc-col#{$infix} {
58
+ flex-basis: 0;
59
+ flex-grow: 1;
60
+ max-width: 100%;
61
+ }
62
+
63
+ @if $grid-row-columns > 0 {
64
+ @for $i from 1 through $grid-row-columns {
65
+ .qc-row-cols#{$infix}-#{$i} {
66
+ @include row-cols($i);
67
+ }
68
+ }
69
+ }
70
+
71
+ .qc-col#{$infix}-auto {
72
+ @include make-col-auto();
73
+ }
74
+
75
+ @if $columns > 0 {
76
+ @for $i from 1 through $columns {
77
+ .qc-col#{$infix}-#{$i} {
78
+ @include make-col($i, $columns);
79
+ }
80
+ }
81
+ }
82
+
83
+ .qc-order#{$infix}-first { order: -1; }
84
+
85
+ .qc-order#{$infix}-last { order: $columns + 1; }
86
+
87
+ @for $i from 0 through $columns {
88
+ .qc-order#{$infix}-#{$i} { order: $i; }
89
+ }
90
+
91
+ @if $columns > 0 {
92
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
93
+ @for $i from 0 through ($columns - 1) {
94
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .qc-offset-0
95
+ .qc-offset#{$infix}-#{$i} {
96
+ @include make-col-offset($i, $columns);
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ // équivalent à @import(src/sdg/scss/vendor/bootstrap-rewrite/functions)
106
+ // Bootstrap functions
107
+ //
108
+ // Utility mixins and functions for evaluating source code across our variables, maps, and mixins.
109
+
110
+ // Ascending
111
+ // Used to evaluate Sass maps like our grid breakpoints.
112
+ // Licensed under MIT (https://github.com/twbs/rfs/blob/v8.x/LICENSE)
113
+ @mixin _assert-ascending($map, $map-name) {
114
+ $prev-key: null;
115
+ $prev-num: null;
116
+ @each $key, $num in $map {
117
+ @if $prev-num == null or math.unit($num) == "%" or math.unit($prev-num) == "%" {
118
+ // Do nothing
119
+ } @else if not math.compatible($prev-num, $num) {
120
+ @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
121
+ } @else if $prev-num >= $num {
122
+ @warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
123
+ }
124
+ $prev-key: $key;
125
+ $prev-num: $num;
126
+ }
127
+ }
128
+
129
+ // Starts at zero
130
+ // Used to ensure the min-width of the lowest breakpoint starts at 0.
131
+ @mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
132
+ @if list.length($map) > 0 {
133
+ $values: map.values($map);
134
+ $first-value: list.nth($values, 1);
135
+ @if $first-value != 0 {
136
+ @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
137
+ }
138
+ }
139
+ }
140
+
141
+ // Replace `$search` with `$replace` in `$string`
142
+ // Used on our SVG icon backgrounds for custom forms.
143
+ //
144
+ // @author Hugo Giraudel
145
+ // @param {String} $string - Initial string
146
+ // @param {String} $search - Substring to replace
147
+ // @param {String} $replace ('') - New value
148
+ // @return {String} - Updated string
149
+ @function str-replace($string, $search, $replace: "") {
150
+ $index: string.index($string, $search);
151
+
152
+ @if $index {
153
+ @return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + string.length($search)), $search, $replace);
154
+ }
155
+
156
+ @return $string;
157
+ }
158
+
159
+ // See https://codepen.io/kevinweber/pen/dXWoRw
160
+ //
161
+ // Requires the use of quotes around data URIs.
162
+
163
+ @function escape-svg($string) {
164
+ @if string.index($string, "data:image/svg+xml") {
165
+ @each $char, $encoded in $escaped-characters {
166
+ // Do not escape the url brackets
167
+ @if string.index($string, "url(") == 1 {
168
+ $string: url("#{str-replace(string.slice($string, 6, -3), $char, $encoded)}");
169
+ } @else {
170
+ $string: str-replace($string, $char, $encoded);
171
+ }
172
+ }
173
+ }
174
+
175
+ @return $string;
176
+ }
177
+
178
+ // Color contrast
179
+ @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
180
+ $r: color.red($color);
181
+ $g: color.green($color);
182
+ $b: color.blue($color);
183
+
184
+ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) * .001;
185
+
186
+ @if ($yiq >= $yiq-contrasted-threshold) {
187
+ @return $dark;
188
+ } @else {
189
+ @return $light;
190
+ }
191
+ }
192
+
193
+ // Retrieve color Sass maps
194
+ @function color($key: "blue") {
195
+ @return map.get($colors, $key);
196
+ }
197
+
198
+ @function theme-color($key: "primary") {
199
+ @return map.get($theme-colors, $key);
200
+ }
201
+
202
+ @function gray($key: "100") {
203
+ @return map.get($grays, $key);
204
+ }
205
+
206
+ // Request a theme color level
207
+ @function theme-color-level($color-name: "primary", $level: 0) {
208
+ $color: theme-color($color-name);
209
+ $color-base: if($level > 0, $black, $white);
210
+ $level: math.abs($level);
211
+
212
+ @return color.mix($color-base, $color, $level * $theme-color-interval);
213
+ }
214
+
215
+ // Return valid calc
216
+ @function add($value1, $value2, $return-calc: true) {
217
+ @if $value1 == null {
218
+ @return $value2;
219
+ }
220
+
221
+ @if $value2 == null {
222
+ @return $value1;
223
+ }
224
+
225
+ @if meta.type-of($value1) == number and meta.type-of($value2) == number and math.compatible($value1, $value2) {
226
+ @return $value1 + $value2;
227
+ }
228
+
229
+ @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + string.unquote(" + ") + $value2);
230
+ }
231
+
232
+ @function subtract($value1, $value2, $return-calc: true) {
233
+ @if $value1 == null and $value2 == null {
234
+ @return null;
235
+ }
236
+
237
+ @if $value1 == null {
238
+ @return -$value2;
239
+ }
240
+
241
+ @if $value2 == null {
242
+ @return $value1;
243
+ }
244
+
245
+ @if meta.type-of($value1) == number and meta.type-of($value2) == number and math.compatible($value1, $value2) {
246
+ @return $value1 - $value2;
247
+ }
248
+
249
+ @if meta.type-of($value2) != number {
250
+ $value2: string.unquote("(") + $value2 + string.unquote(")");
251
+ }
252
+
253
+ @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + string.unquote(" - ") + $value2);
254
+ }
255
+
256
+ @function divide($dividend, $divisor, $precision: 10) {
257
+ $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
258
+ $dividend: math.abs($dividend);
259
+ $divisor: math.abs($divisor);
260
+ @if $dividend == 0 {
261
+ @return 0;
262
+ }
263
+ @if $divisor == 0 {
264
+ @error "Cannot divide by 0";
265
+ }
266
+ $remainder: $dividend;
267
+ $result: 0;
268
+ $factor: 10;
269
+ @while ($remainder > 0 and $precision >= 0) {
270
+ $quotient: 0;
271
+ @while ($remainder >= $divisor) {
272
+ $remainder: $remainder - $divisor;
273
+ $quotient: $quotient + 1;
274
+ }
275
+ $result: $result * 10 + $quotient;
276
+ $factor: $factor * .1;
277
+ $remainder: $remainder * 10;
278
+ $precision: $precision - 1;
279
+ @if ($precision < 0 and $remainder >= $divisor * 5) {
280
+ $result: $result + 1;
281
+ }
282
+ }
283
+ $result: $result * $factor * $sign;
284
+ $dividend-unit: math.unit($dividend);
285
+ $divisor-unit: math.unit($divisor);
286
+ $unit-map: (
287
+ "px": 1px,
288
+ "rem": 1rem,
289
+ "em": 1em,
290
+ "%": 1%
291
+ );
292
+ @if ($dividend-unit != $divisor-unit and map.has-key($unit-map, $dividend-unit)) {
293
+ $result: $result * map.get($unit-map, $dividend-unit);
294
+ }
295
+ @return $result;
296
+ }
297
+
298
+
299
+
300
+
301
+ // équivalent à @import(src/sdg/scss/vendor/bootstrap-rewrite/mixins/breakpoints)
302
+ // Breakpoint viewport sizes and media queries.
303
+ //
304
+ // Breakpoints are defined as a map of (name: minimum width), order from small to large:
305
+ //
306
+ // (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
307
+ //
308
+ // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
309
+
310
+ // Name of the next breakpoint, or null for the last breakpoint.
311
+ //
312
+ // >> breakpoint-next(sm)
313
+ // md
314
+ // >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
315
+ // md
316
+ // >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
317
+ // md
318
+ // Licensed under MIT (https://github.com/twbs/rfs/blob/v8.x/LICENSE)
319
+
320
+
321
+ @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map.keys($breakpoints)) {
322
+ $n: list.index($breakpoint-names, $name);
323
+ @return if($n != null and $n < list.length($breakpoint-names), list.nth($breakpoint-names, $n + 1), null);
324
+ }
325
+
326
+ // Minimum breakpoint width. Null for the smallest (first) breakpoint.
327
+ //
328
+ // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
329
+ // 576px
330
+ @function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
331
+ $min: map.get($breakpoints, $name);
332
+ @return if($min != 0, $min, null);
333
+ }
334
+
335
+ // Maximum breakpoint width. Null for the largest (last) breakpoint.
336
+ // The maximum value is calculated as the minimum of the next one less 0.02px
337
+ // to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths.
338
+ // See https://www.w3.org/TR/mediaqueries-4/#mq-min-max
339
+ // Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
340
+ // See https://bugs.webkit.org/show_bug.cgi?id=178261
341
+ //
342
+ // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
343
+ // 767.98px
344
+ @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
345
+ $next: breakpoint-next($name, $breakpoints);
346
+ @return if($next, breakpoint-min($next, $breakpoints) - .02, null);
347
+ }
348
+
349
+ // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
350
+ // Useful for making responsive utilities.
351
+ //
352
+ // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
353
+ // "" (Returns a blank string)
354
+ // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
355
+ // "-sm"
356
+ @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
357
+ @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
358
+ }
359
+
360
+ // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
361
+ // Makes the @content apply to the given breakpoint and wider.
362
+ @mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
363
+ $min: breakpoint-min($name, $breakpoints);
364
+ @if $min {
365
+ @media (min-width: $min) {
366
+ @content;
367
+ }
368
+ } @else {
369
+ @content;
370
+ }
371
+ }
372
+
373
+ // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
374
+ // Makes the @content apply to the given breakpoint and narrower.
375
+ @mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
376
+ $max: breakpoint-max($name, $breakpoints);
377
+ @if $max {
378
+ @media (max-width: $max) {
379
+ @content;
380
+ }
381
+ } @else {
382
+ @content;
383
+ }
384
+ }
385
+
386
+ // Media that spans multiple breakpoint widths.
387
+ // Makes the @content apply between the min and max breakpoints
388
+ @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
389
+ $min: breakpoint-min($lower, $breakpoints);
390
+ $max: breakpoint-max($upper, $breakpoints);
391
+
392
+ @if $min != null and $max != null {
393
+ @media (min-width: $min) and (max-width: $max) {
394
+ @content;
395
+ }
396
+ } @else if $max == null {
397
+ @include media-breakpoint-up($lower, $breakpoints) {
398
+ @content;
399
+ }
400
+ } @else if $min == null {
401
+ @include media-breakpoint-down($upper, $breakpoints) {
402
+ @content;
403
+ }
404
+ }
405
+ }
406
+
407
+ // Media between the breakpoint's minimum and maximum widths.
408
+ // No minimum for the smallest breakpoint, and no maximum for the largest one.
409
+ // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
410
+ @mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
411
+ $min: breakpoint-min($name, $breakpoints);
412
+ $max: breakpoint-max($name, $breakpoints);
413
+
414
+ @if $min != null and $max != null {
415
+ @media (min-width: $min) and (max-width: $max) {
416
+ @content;
417
+ }
418
+ } @else if $max == null {
419
+ @include media-breakpoint-up($name, $breakpoints) {
420
+ @content;
421
+ }
422
+ } @else if $min == null {
423
+ @include media-breakpoint-down($name, $breakpoints) {
424
+ @content;
425
+ }
426
+ }
427
+ }
428
+
429
+ // équivalent à @import(src/sdg/scss/vendor/bootstrap-rewrite/mixins/deprecate)
430
+ // Deprecate mixin
431
+ // This mixin can be used to deprecate mixins or functions.
432
+ // `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to
433
+ // some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap)
434
+
435
+ // Licensed under MIT (https://github.com/twbs/rfs/blob/v8.x/LICENSE)
436
+
437
+ @mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) {
438
+ @if ($enable-deprecation-messages != false and $ignore-warning != true) {
439
+ @warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}.";
440
+ }
441
+ }
442
+
443
+ // équivalent à @import(src/sdg/scss/vendor/bootstrap-rewrite/mixins/grid)
444
+ /// Grid system
445
+ //
446
+ // Generate semantic grid columns with these mixins.
447
+
448
+ @mixin make-container($gutter: $grid-gutter-width) {
449
+ width: 100%;
450
+ padding-right: $gutter;
451
+ padding-left: $gutter;
452
+ margin-right: auto;
453
+ margin-left: auto;
454
+ }
455
+
456
+ @mixin make-row($gutter: $grid-gutter-width) {
457
+ display: flex;
458
+ flex-wrap: wrap;
459
+ margin-right: calc(-1 * $gutter / 2);
460
+ margin-left: calc(-1 * $gutter / 2);
461
+ }
462
+
463
+ // For each breakpoint, define the maximum width of the container in a media query
464
+ @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
465
+ @each $breakpoint, $container-max-width in $max-widths {
466
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
467
+ max-width: $container-max-width;
468
+ }
469
+ }
470
+ @include deprecate("The `make-container-max-widths` mixin", "v4.5.2", "v5");
471
+ }
472
+
473
+ @mixin make-col-ready($gutter: $grid-gutter-width) {
474
+ position: relative;
475
+ // Prevent columns from becoming too narrow when at smaller grid tiers by
476
+ // always setting `width: 100%;`. This works because we use `flex` values
477
+ // later on to override this initial width.
478
+ width: 100%;
479
+ padding-right: calc(1 * $gutter / 2);
480
+ padding-left: calc(1 * $gutter / 2);
481
+ }
482
+
483
+ @mixin make-col($size, $columns: $grid-columns) {
484
+ flex: 0 0 math.percentage(divide($size, $columns));
485
+ // Add a `max-width` to ensure content within each column does not blow out
486
+ // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
487
+ // do not appear to require this.
488
+ max-width: math.percentage(divide($size, $columns));
489
+ }
490
+
491
+ @mixin make-col-auto() {
492
+ flex: 0 0 auto;
493
+ width: auto;
494
+ max-width: 100%; // Reset earlier grid tiers
495
+ }
496
+
497
+ @mixin make-col-offset($size, $columns: $grid-columns) {
498
+ $num: divide($size, $columns);
499
+ margin-left: if($num == 0, 0, math.percentage($num));
500
+ }
501
+
502
+ // Row columns
503
+ //
504
+ // Specify on a parent element(e.g., .qc-row) to force immediate children into NN
505
+ // numberof columns. Supports wrapping to new lines, but does not do a Masonry
506
+ // style grid.
507
+ @mixin row-cols($count) {
508
+ > * {
509
+ flex: 0 0 divide(100%, $count);
510
+ max-width: divide(100%, $count);
511
+ }
512
+ }
513
+
514
+
515
+
516
+
@@ -0,0 +1,78 @@
1
+ @use "grid-lib" as *;
2
+
3
+ // Framework grid generation
4
+ //
5
+ // Used only by Bootstrap to generate the correct number of grid classes given
6
+ // any value of `$grid-columns`.
7
+
8
+
9
+ @if $enable-grid-classes {
10
+ // Single container class with breakpoint max-widths
11
+ .qc-container,
12
+ // 100% wide container at all breakpoints
13
+ .qc-container-fluid {
14
+ @include make-container();
15
+ }
16
+
17
+ // Responsive containers that are 100% wide until a breakpoint
18
+ @each $breakpoint, $container-max-width in $container-max-widths {
19
+ .qc-container-#{$breakpoint} {
20
+ @extend .qc-container-fluid;
21
+ }
22
+
23
+ @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
24
+ %responsive-container-#{$breakpoint} {
25
+ max-width: $container-max-width;
26
+ }
27
+
28
+ // Extend each breakpoint which is smaller or equal to the current breakpoint
29
+ $extend-breakpoint: true;
30
+
31
+ @each $name, $width in $grid-breakpoints {
32
+ @if ($extend-breakpoint) {
33
+ .qc-container#{breakpoint-infix($name, $grid-breakpoints)} {
34
+ @extend %responsive-container-#{$breakpoint};
35
+ }
36
+
37
+ // Once the current breakpoint is reached, stop extending
38
+ @if ($breakpoint == $name) {
39
+ $extend-breakpoint: false;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+
48
+ // Row
49
+ //
50
+ // Rows contain your columns.
51
+
52
+ @if $enable-grid-classes {
53
+ .qc-row {
54
+ @include make-row();
55
+ }
56
+
57
+ // Remove the negative margin from default .qc-row, then the horizontal padding
58
+ // from all immediate children columns (to prevent runaway style inheritance).
59
+ .no-gutters {
60
+ margin-right: 0;
61
+ margin-left: 0;
62
+
63
+ > .qc-col,
64
+ > [class*="col-"] {
65
+ padding-right: 0;
66
+ padding-left: 0;
67
+ }
68
+ }
69
+ }
70
+
71
+ // Columns
72
+ //
73
+ // Common styles for small and large grid columns
74
+
75
+ @if $enable-grid-classes {
76
+ @include make-grid-columns($breakpoints: $grid-breakpoints);
77
+ }
78
+
@@ -0,0 +1,78 @@
1
+ @use "sass:color";
2
+ @use "sass:meta";
3
+ @use "settings/base" as *;
4
+ @use "sass:math";
5
+ @use "sass:map";
6
+ @use "sass:string";
7
+
8
+
9
+ // Return rem size from pixel size according to root font-size as define in settings
10
+ // Always use this function for rem values
11
+ //
12
+ // root font-size : 100 %,
13
+ // /* foo.scss */
14
+ // .foo { font-size: rem(16); }
15
+ // /* foo.css */
16
+ // .foo { font-size: 1rem; }
17
+ //
18
+ // root font-size : 62.5 %,
19
+ // /* foo.scss */
20
+ // .foo { font-size: rem(16); }
21
+ // /* foo.css */
22
+ // .foo { font-size: 1.6rem; }
23
+
24
+ $rem-ratio: math.div(1, .16 * $percent-root-font-size);
25
+ @function rem($px-size) {
26
+ @return $px-size * $rem-ratio * 1rem;
27
+ }
28
+
29
+ @function rem-ratio($px-size) {
30
+ @return math.div($px-size, 16 * $percent-root-font-size * .01) * 1rem;
31
+ }
32
+
33
+ // implode a list (and flatten inner list : implode( (foo, (bar baz)), '-'); => foo-bar-baz
34
+ @function deep-implode($list, $glue: '-') {
35
+ $separator : '';
36
+ $result : '';
37
+ @each $item in $list {
38
+ $part : $item;
39
+ @if meta.type-of($item) == 'list' {
40
+ $part : deep-implode($item, $glue);
41
+ }
42
+ $result : '#{$result}#{$separator}#{$part}';
43
+ $separator: $glue;
44
+ }
45
+ @return $result;
46
+ }
47
+
48
+ @function google-font($font) {
49
+ @return string.unquote(deep-implode(map.get($google-fonts, $font), ','));
50
+ }
51
+
52
+ @function getImageUrl($nom, $images: $images) {
53
+ $image: map.get($images, $nom);
54
+ @return url('data:image/svg+xml;base64,#{$image}');
55
+ }
56
+
57
+
58
+ // Return css var corresponding to this token
59
+ // token-value(foo bar); // var(--qc-foo-bar);
60
+ @function token-value($args...) {
61
+ @return var(#{token-name($args...)});
62
+ }
63
+
64
+ @function token-name($args...) {
65
+ @return --qc-#{deep-implode($args, '-')};
66
+ }
67
+
68
+ @function rgb-token($color) {
69
+ @if meta.function-exists("channel","color") { // Sass 1.63.0 = Dart Sass 3.63.0
70
+ @return (color.channel($color, 'red', $space: rgb), color.channel($color, 'green', $space: rgb), color.channel($color, 'blue', $space: rgb));
71
+ } @else {
72
+ @return (color.red($color), color.green($color), color.blue($color));
73
+ }
74
+ }
75
+
76
+
77
+
78
+
@@ -0,0 +1,4 @@
1
+ // @use this file to access every variables, function, mixin or %class from Qc SDG except for grid variables and functions
2
+ @forward "settings/base";
3
+ @forward "settings/tokens";
4
+ @forward "lib/functions";