@trilogy-ds/styles 4.2.1 → 4.2.2-beta-1

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.
@@ -1,641 +0,0 @@
1
- @use "sass:string";
2
- @import "./initial-variables";
3
-
4
- %delete {
5
- @extend %unselectable;
6
-
7
- -moz-appearance: none;
8
- -webkit-appearance: none;
9
- background-color: rgba(black, 0.2);
10
- border: none;
11
- border-radius: 9999px;
12
- cursor: pointer;
13
- display: inline-block;
14
- flex-grow: 0;
15
- flex-shrink: 0;
16
- font-size: 0;
17
- height: 20px;
18
- max-height: 20px;
19
- max-width: 20px;
20
- min-height: 20px;
21
- min-width: 20px;
22
- outline: none;
23
- position: relative;
24
- vertical-align: top;
25
- width: 20px;
26
-
27
- &::before,
28
- &::after {
29
- background-color: #fff;
30
- content: '';
31
- display: block;
32
- left: 50%;
33
- position: absolute;
34
- top: 50%;
35
- transform: translateX(-50%) translateY(-50%) rotate(45deg);
36
- transform-origin: center center;
37
- }
38
-
39
- &::before {
40
- height: 2px;
41
- width: 50%;
42
- }
43
-
44
- &::after {
45
- height: 50%;
46
- width: 2px;
47
- }
48
-
49
- &:hover,
50
- &:focus {
51
- background-color: rgba(black, 0.3);
52
- }
53
-
54
- &:active {
55
- background-color: rgba(black, 0.4);
56
- }
57
-
58
- // Sizes
59
- &.is-small {
60
- height: 16px;
61
- max-height: 16px;
62
- max-width: 16px;
63
- min-height: 16px;
64
- min-width: 16px;
65
- width: 16px;
66
- }
67
-
68
- &.is-medium {
69
- height: 24px;
70
- max-height: 24px;
71
- max-width: 24px;
72
- min-height: 24px;
73
- min-width: 24px;
74
- width: 24px;
75
- }
76
-
77
- &.is-large {
78
- height: 32px;
79
- max-height: 32px;
80
- max-width: 32px;
81
- min-height: 32px;
82
- min-width: 32px;
83
- width: 32px;
84
- }
85
- }
86
-
87
- %unselectable {
88
- -webkit-touch-callout: none;
89
- -webkit-user-select: none;
90
- -moz-user-select: none;
91
- -ms-user-select: none;
92
- user-select: none;
93
- }
94
-
95
- @mixin delete {
96
- @extend %delete;
97
- }
98
-
99
- @mixin arrow( $direction: 'down') {
100
- background-color: currentColor;
101
- @if $direction == 'up' {
102
- content: "";
103
- mask-image: url('./assets/icons/all/arrow-up.svg');
104
- } @else if $direction == 'left' {
105
- content: "";
106
- mask-image: url('./assets/icons/all/arrow-left.svg');
107
- } @else if $direction == 'right' {
108
- content: "";
109
- mask-image: url('./assets/icons/all/arrow-right.svg');
110
- } @else {
111
- content: "";
112
- mask-image: url('./assets/icons/all/arrow-down.svg');
113
- }
114
-
115
- min-width: 15px;
116
- min-height: 15px;
117
- mask-size: 15px;
118
- position: absolute;
119
- display: inline-block;
120
- }
121
-
122
- @mixin block {
123
- &:not(:last-child) {
124
- margin-bottom: 15px;
125
- }
126
- }
127
-
128
- @mixin clearfix {
129
- &::after {
130
- clear: both;
131
- content: ' ';
132
- display: table;
133
- }
134
- }
135
-
136
- @mixin center($width, $height: 0) {
137
- position: absolute;
138
-
139
- @if $height != 0 {
140
- left: calc(50% - (#{$width} / 2));
141
- top: calc(50% - (#{$height} / 2));
142
- } @else {
143
- left: calc(50% - (#{$width} / 2));
144
- top: calc(50% - (#{$width} / 2));
145
- }
146
- }
147
-
148
- @mixin spinner {
149
- animation: spinAround 500ms infinite linear;
150
- border: 2px solid getColor('neutral-fade');
151
- border-radius: 290486px;
152
- border-right-color: transparent;
153
- border-top-color: transparent;
154
- content: '';
155
- display: block;
156
- height: 1em;
157
- position: relative;
158
- width: 1em;
159
- }
160
-
161
- @mixin overflow-touch {
162
- -webkit-overflow-scrolling: touch;
163
- }
164
-
165
- @mixin label-states {
166
- &:focus,
167
- &:active,
168
- &:hover {
169
- @include hover();
170
- }
171
- }
172
-
173
- @mixin overlay($offset: 0) {
174
- position: absolute;
175
- top: $offset;
176
- bottom: $offset;
177
- left: $offset;
178
- right: $offset;
179
- }
180
-
181
- @mixin placeholder {
182
- $placeholders: ':-moz' ':-webkit-input' '-moz' '-ms-input';
183
-
184
- @each $placeholder in $placeholders {
185
- &:#{$placeholder}-placeholder {
186
- @content;
187
- }
188
- }
189
- }
190
-
191
- @mixin unselectable {
192
- @extend %unselectable;
193
- }
194
-
195
- @mixin ui-icon {
196
- font-family: trilogy-all;
197
- font-style: normal;
198
- font-weight: normal;
199
- display: inline-block;
200
- text-decoration: inherit;
201
- margin-right: 0.2em;
202
- text-align: center;
203
-
204
- /* For safety - reset parent styles, that can break glyph codes*/
205
- font-variant: normal;
206
- text-transform: none;
207
-
208
- /* fix buttons height, for twitter bootstrap */
209
- line-height: 1em;
210
-
211
- /* remove if not needed */
212
- margin-left: 0.2em;
213
-
214
- /* Font smoothing. That was taken from TWBS */
215
- -webkit-font-smoothing: antialiased;
216
- -moz-osx-font-smoothing: grayscale;
217
- }
218
-
219
- // Responsiveness
220
- @mixin from($device) {
221
- @media screen and (min-width: $device) {
222
- @content;
223
- }
224
- }
225
-
226
- @mixin until($device) {
227
- @media screen and (max-width: $device - 1px) {
228
- @content;
229
- }
230
- }
231
-
232
- @mixin mobile {
233
- @media screen and (max-width: $tablet - 1px) {
234
- @content;
235
- }
236
- }
237
-
238
- @mixin tablet {
239
- @media screen and (min-width: $tablet), print {
240
- @content;
241
- }
242
- }
243
-
244
- @mixin tablet-only {
245
- @media screen and (min-width: $tablet) and (max-width: $desktop - 1px) {
246
- @content;
247
- }
248
- }
249
-
250
- @mixin touch {
251
- @media screen and (max-width: $desktop - 1px) {
252
- @content;
253
- }
254
- }
255
-
256
- @mixin desktop {
257
- @media screen and (min-width: $desktop) {
258
- @content;
259
- }
260
- }
261
-
262
- @mixin desktop-only {
263
- @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px) {
264
- @content;
265
- }
266
- }
267
-
268
- @mixin until-widescreen {
269
- @media screen and (max-width: $widescreen - 1px) {
270
- @content;
271
- }
272
- }
273
-
274
- @mixin widescreen {
275
- @media screen and (min-width: $widescreen) {
276
- @content;
277
- }
278
- }
279
-
280
- @mixin widescreen-only {
281
- @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px) {
282
- @content;
283
- }
284
- }
285
-
286
- @mixin until-fullhd {
287
- @media screen and (max-width: $fullhd - 1px) {
288
- @content;
289
- }
290
- }
291
-
292
- @mixin fullhd {
293
- @media screen and (min-width: $fullhd) {
294
- @content;
295
- }
296
- }
297
-
298
- @mixin all-desktop-only {
299
- @media screen and (min-width: $desktop) and (max-width: $fullhd - 1px) {
300
- @content;
301
- }
302
- }
303
-
304
- @mixin ellipsis() {
305
- white-space: nowrap;
306
- overflow-x: hidden;
307
- text-overflow: ellipsis;
308
- }
309
-
310
- @mixin text-tags() {
311
- a,
312
- span,
313
- p,
314
- i,
315
- strong,
316
- h1,
317
- h2,
318
- h3,
319
- h4,
320
- h5,
321
- label,
322
- h6 {
323
- @content;
324
- }
325
- }
326
-
327
- @mixin heading-tags() {
328
- h1,
329
- h2,
330
- h3,
331
- h4,
332
- h5,
333
- h6 {
334
- @content;
335
- }
336
- }
337
-
338
- @mixin apply-shadow-box {
339
- box-shadow: $shadow;
340
- }
341
-
342
- @mixin apply-colors($property: 'color') {
343
- @each $name, $pair in $colors-brand-functionnal {
344
- $color: getColor($name);
345
- $brandName: getColorBrandName($name);
346
- &.is-#{$brandName} {
347
- #{$property}: $color;
348
- }
349
- }
350
- }
351
-
352
- @mixin pattern-light($size, $x-pos: top, $y-pos: center) {
353
- background-size: $size;
354
- background-position: $x-pos $y-pos;
355
- }
356
-
357
- @mixin pattern-dark($size, $x-pos: top, $y-pos: center) {
358
- background: linear-gradient(#1b3650, getColor('accent'));
359
- background-size: auto, $size, auto;
360
- background-position: top left, $x-pos $y-pos, top left;
361
- }
362
-
363
- // import sass bulma
364
- @mixin input {
365
- @include control;
366
- height: 56px;
367
- background-color: getColor('background');
368
- border-color: getColor('neutral');
369
- color: getColor('font');
370
-
371
- @include placeholder {
372
- color: getColor('font') !important;
373
- filter: grayscale(100%);
374
- opacity: 1 !important;
375
- transition: all 0.2s ease-out;
376
- }
377
-
378
- @include hover();
379
- }
380
-
381
- @mixin checkbox-and-radio($type) {
382
- //TILES WRAPPER
383
- .#{$type}-tiles {
384
- display: flex;
385
- gap: 16px;
386
- flex-wrap: wrap;
387
- }
388
-
389
- //BOTH
390
- .#{$type},
391
- .#{$type}-tile {
392
- position: relative;
393
-
394
- label.#{$type}-label {
395
- cursor: pointer;
396
- font-size: 14px;
397
-
398
- &:before,
399
- &:after {
400
- content: '';
401
- position: absolute;
402
- width: 18px;
403
- height: 18px;
404
- }
405
-
406
- &:before {
407
- border: var(--border);
408
- }
409
- }
410
-
411
- input {
412
- opacity: 0;
413
- position: absolute;
414
- outline: none;
415
-
416
- &:checked ~ label.#{$type}-label {
417
- border-color: getColor('main');
418
-
419
- &:before {
420
- border-color: getColor('main');
421
- }
422
-
423
- &:after {
424
- background-color: getColor('main');
425
- }
426
- }
427
- &:focus-visible ~ label.#{$type}-label:before {
428
- outline: 1px solid;
429
- }
430
-
431
- &:disabled,
432
- &:disabled:checked {
433
- & ~ label.#{$type}-label {
434
- &:after {
435
- background-color: getColor('disabled-fade');
436
- }
437
- }
438
- }
439
-
440
- &:disabled {
441
- & ~ label.#{$type}-label {
442
- &:after {
443
- background-color: transparent;
444
- }
445
- }
446
- }
447
- }
448
- }
449
-
450
- // SIMPLE WITH LABEL ONLY
451
- .#{$type} {
452
- display: flex;
453
- align-items: center;
454
- width: fit-content;
455
-
456
- input:disabled,
457
- input:disabled:checked {
458
- & ~ label.#{$type}-label {
459
- @include disabledRulesWithoutBG;
460
- }
461
- }
462
-
463
- label.#{$type}-label {
464
- padding-left: 30px;
465
-
466
- &:before,
467
- &:after {
468
- top: 50%;
469
- transform: translateY(-50%);
470
- left: 0;
471
- }
472
- }
473
-
474
- &:hover &:not(disabled) {
475
- label.#{$type}-label {
476
- &:before {
477
- @include hoverRules();
478
- }
479
- }
480
- }
481
-
482
- &:focus {
483
- border: 2px;
484
- border-color: getColor('main');
485
- }
486
- }
487
-
488
- //TILE ONLY
489
- .#{$type}-tile {
490
- position: relative;
491
- max-width: 160px;
492
- display: inline-block;
493
- text-align: center;
494
-
495
- input:disabled,
496
- input:disabled:checked {
497
- & ~ label.#{$type}-label {
498
- @include disabledRules;
499
- }
500
- }
501
- &:has(input:focus-visible) label.#{$type}-label{
502
- outline: 1px solid;
503
- }
504
-
505
- &:first-child {
506
- margin-left: 0;
507
- }
508
-
509
- &:last-child {
510
- margin-right: 0;
511
- }
512
-
513
- label.#{$type}-label {
514
- display: block;
515
- position: relative;
516
- padding: 40px 16px 16px;
517
- border: var(--border);
518
- border-radius: var(--radius);
519
- box-sizing: border-box;
520
- background-color: getColor('background');
521
-
522
- &:before {
523
- top: 16px;
524
- right: 16px;
525
- }
526
-
527
- span.#{$type}-title {
528
- font-weight: bold;
529
- width: 100%;
530
- display: block;
531
- font-size: 16px;
532
- }
533
- }
534
-
535
- input {
536
- &:not(:disabled):not(:checked) ~ label.radio-label {
537
- @include label-states;
538
- }
539
-
540
- &:not(:disabled) ~ label.checkbox-label {
541
- @include label-states;
542
- }
543
-
544
- &:checked:not(:disabled) ~ label.#{$type}-label {
545
- border-color: getColor('main');
546
- border-width: 2px;
547
- padding: 15px;
548
- padding-top: 39px;
549
-
550
- &:before {
551
- top: 15px;
552
- right: 15px;
553
- }
554
-
555
- span.#{$type}-title {
556
- color: getColor('main');
557
- }
558
- }
559
-
560
- &:disabled {
561
- & ~ label.#{$type}-label {
562
- &:before {
563
- border-color: getColor('disabled') !important;
564
- }
565
- }
566
- }
567
-
568
- &:disabled:checked ~ label.#{$type}-label {
569
- .checkbox-title {
570
- color: getColor('disabled');
571
- }
572
- }
573
- }
574
-
575
- &.is-horizontal {
576
- display: flex;
577
- justify-content: space-between;
578
- align-items: center;
579
- max-width: unset;
580
- width: 100%;
581
- position: relative;
582
-
583
- &.is-narrow {
584
- width: fit-content;
585
- }
586
-
587
- input {
588
- &:checked:not(:disabled) ~ label.#{$type}-label {
589
- padding: 15px;
590
- padding-right: 47px;
591
- }
592
-
593
- }
594
-
595
- label.#{$type}-label {
596
- width: 100%;
597
- display: flex;
598
- align-items: center;
599
- justify-content: flex-start;
600
- text-align: left;
601
- padding: 16px 48px 16px 16px;
602
-
603
- &:before,
604
- &:after {
605
- top: 50% !important;
606
- transform: translateY(-50%);
607
- }
608
- }
609
-
610
- .icon {
611
- margin-right: 16px;
612
- }
613
- }
614
- }
615
- }
616
-
617
- @mixin hoverRules {
618
- background-color: getColor('main-fade');
619
- }
620
-
621
- @mixin hover {
622
- &:hover:not(.is-disabled):not(:focus) {
623
- @include hoverRules();
624
- }
625
- &:focus:not(.is-disabled), &:focus-visible:not(.is-disabled) {
626
- border: 2px solid currentColor;
627
- }
628
- }
629
-
630
- @mixin disabledRulesWithoutBG {
631
- border-color: getColor('disabled') !important;
632
- box-shadow: none !important;
633
- color: getColor('disabled') !important;
634
- cursor: not-allowed !important;
635
- filter: grayscale(1);
636
- }
637
-
638
- @mixin disabledRules {
639
- background-color: getColor('disabled-fade') !important;
640
- @include disabledRulesWithoutBG;
641
- }