@ilo-org/styles 1.3.1 → 1.3.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ilo-org/styles",
3
3
  "description": "Styles for products using ILO's Design System",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
package/scss/_mixins.scss CHANGED
@@ -149,6 +149,15 @@
149
149
  background-repeat: no-repeat;
150
150
  }
151
151
 
152
+ @mixin icon($name, $color: black) {
153
+ $icon: map-get($icons, $name);
154
+ mask-image: url("#{$icon}");
155
+ mask-repeat: no-repeat;
156
+ -webkit-mask-image: url("#{$icon}");
157
+ -webkit-mask-repeat: no-repeat;
158
+ background-color: $color;
159
+ }
160
+
152
161
  // ======================================
153
162
  // Video Button
154
163
  // ======================================
@@ -4,6 +4,8 @@
4
4
  @import "../config";
5
5
 
6
6
  .#{$prefix}--accordion {
7
+ --ilo-accordion-color-icon: var(--ilo-color-blue-dark);
8
+
7
9
  // This provides a reference to the outerclass within nested declarations
8
10
  $accordion: &;
9
11
 
@@ -14,6 +16,11 @@
14
16
  // If the accordion item is scrollable, then this is its max-height
15
17
  $scroll-max-height: 300px;
16
18
 
19
+ &--icon {
20
+ width: 24px;
21
+ height: 24px;
22
+ }
23
+
17
24
  &--button {
18
25
  display: flex;
19
26
  flex-direction: row;
@@ -21,42 +28,40 @@
21
28
  width: 100%;
22
29
  margin: 0;
23
30
  padding-block: spacing(4);
24
- padding-inline-end: spacing(11);
31
+ padding-inline-end: spacing(1);
25
32
  background-color: $color-ux-background-default;
26
- background-position: calc(100% - px-to-rem(6px)) center;
27
- background-repeat: no-repeat;
28
- background-size: px-to-rem(24px) px-to-rem(24px);
29
33
  border: none;
30
34
  border-top: 2px solid $color-base-neutrals-lighter;
31
- fill: $color-ux-labels-actionable;
32
35
  font-family: var(--ilo-fonts-display);
33
36
  color: $color-ux-labels-actionable;
34
37
  font-weight: $type-weights-section;
35
38
  transition: all $transition-timing ease-in-out;
36
39
  @include font-styles("label-medium");
37
- @include dataurlicon("plus", $color-ux-labels-actionable);
38
40
 
39
41
  &__large {
40
42
  @include font-styles("headline-6");
41
43
  padding-block: spacing(5);
42
- padding-inline-end: spacing(11);
44
+ }
45
+
46
+ &[aria-expanded="true"] {
47
+ background-color: $color-base-blue-light;
48
+ #{$accordion}--icon {
49
+ @include icon("minus", var(--ilo-color-blue));
50
+ }
51
+ }
52
+
53
+ &[aria-expanded="false"] {
54
+ #{$accordion}--icon {
55
+ @include icon("plus", var(--ilo-color-blue-dark));
56
+ }
43
57
  }
44
58
 
45
59
  &:hover,
46
60
  &:focus {
61
+ --ilo-accordion-color-icon: var(--ilo-color-blue);
47
62
  border-top-color: $color-ux-borders-hover;
48
63
  color: $color-ux-labels-hover;
49
- fill: $color-ux-labels-hover;
50
64
  cursor: pointer;
51
-
52
- &[aria-expanded="true"] {
53
- color: $brand-ilo-dark-blue;
54
- @include dataurlicon("minus", $brand-ilo-dark-blue);
55
- }
56
-
57
- &[aria-expanded="false"] {
58
- @include dataurlicon("plus", $color-ux-labels-hover);
59
- }
60
65
  }
61
66
 
62
67
  @include breakpoint("md") {
@@ -64,23 +69,8 @@
64
69
  &__large {
65
70
  @include font-styles("headline-6");
66
71
  padding: spacing(5) 0;
67
- padding-inline-end: spacing(11);
68
72
  }
69
73
  }
70
-
71
- &[aria-expanded="true"] {
72
- background-color: $color-base-blue-light;
73
- color: $brand-ilo-blue;
74
- @include dataurlicon("minus", $brand-ilo-blue);
75
- }
76
-
77
- &[aria-expanded="false"] {
78
- @include dataurlicon("plus", $color-ux-labels-actionable);
79
- }
80
-
81
- [dir="rtl"] & {
82
- background-position: calc(0% + px-to-rem(6px)) center;
83
- }
84
74
  }
85
75
 
86
76
  &--panel {
@@ -27,7 +27,6 @@ It could eventually be used for a standalone blockquote component.
27
27
  @include font-styles("pull-quote-sm");
28
28
 
29
29
  &:after {
30
- background-repeat: no-repeat;
31
30
  bottom: 0;
32
31
  content: "";
33
32
  display: inline-block;
@@ -36,7 +35,7 @@ It could eventually be used for a standalone blockquote component.
36
35
  right: 0;
37
36
  transform: scaleX(-1);
38
37
  width: px-to-rem(26.5px);
39
- @include dataurlicon("quote", $color-font-blockquote);
38
+ @include icon("quote", var(--ilo-color-purple));
40
39
  }
41
40
  }
42
41
 
@@ -47,7 +46,6 @@ It could eventually be used for a standalone blockquote component.
47
46
  }
48
47
 
49
48
  &:before {
50
- background-repeat: no-repeat;
51
49
  content: "";
52
50
  display: inline-block;
53
51
  height: px-to-rem(40px);
@@ -55,7 +53,7 @@ It could eventually be used for a standalone blockquote component.
55
53
  position: absolute;
56
54
  width: px-to-rem(53px);
57
55
  top: 0;
58
- @include dataurlicon("quote", $color-font-blockquote);
56
+ @include icon("quote", var(--ilo-color-purple));
59
57
  }
60
58
 
61
59
  @include breakpoint("md") {
@@ -69,7 +69,7 @@
69
69
  position: relative;
70
70
 
71
71
  &__icon {
72
- @include dataurlicon("chevron_down", $brand-ilo-dark-blue);
72
+ @include icon("chevron_down", var(--ilo-color-blue-dark));
73
73
 
74
74
  background-position: right;
75
75
  background-repeat: no-repeat;
@@ -96,23 +96,19 @@
96
96
  width: px-to-rem(24px);
97
97
 
98
98
  &__error {
99
- background-color: var(--ilo-color-notification-type-error);
100
- @include dataurlicon("notification_error", "white");
99
+ @include icon("notification_error", var(--ilo-color-white));
101
100
  }
102
101
 
103
102
  &__info {
104
- background-color: var(--ilo-color-notification-type-info);
105
- @include dataurlicon("notification_info", "white");
103
+ @include icon("notification_info", var(--ilo-color-white));
106
104
  }
107
105
 
108
106
  &__success {
109
- background-color: var(--ilo-color-notification-type-success);
110
- @include dataurlicon("notification_success", "white");
107
+ @include icon("notification_success", var(--ilo-color-white));
111
108
  }
112
109
 
113
110
  &__warning {
114
- background-color: var(--ilo-color-notification-type-warning);
115
- @include dataurlicon("notification_warning", "white");
111
+ @include icon("notification_warning", var(--ilo-color-white));
116
112
  }
117
113
  }
118
114
 
@@ -4,6 +4,9 @@
4
4
  @import "../mixins";
5
5
 
6
6
  .ilo--link-list {
7
+ --ilo-link-list-color-icon: var(--ilo-color-blue-dark);
8
+ --ilo-link-list-color-indent-icon: var(--ilo-color-gray-base);
9
+
7
10
  &--headline {
8
11
  font-family: var(--ilo-fonts-display);
9
12
  font-weight: map-get($type, "weights", "label");
@@ -33,14 +36,10 @@
33
36
  padding-left: spacing(8);
34
37
 
35
38
  .ilo--link-list--label {
36
- display: block;
37
39
  padding-left: spacing(8);
38
40
  position: relative;
39
41
 
40
42
  &:before {
41
- background-position: left center;
42
- background-repeat: no-repeat;
43
- background-size: contain;
44
43
  content: "";
45
44
  display: block;
46
45
  height: px-to-rem(24px);
@@ -48,15 +47,16 @@
48
47
  left: 0;
49
48
  position: absolute;
50
49
  top: 50%;
51
- transform: translateY(-50%) rotate(-90deg);
50
+ transform: translateY(-50%);
52
51
  transform-origin: center;
53
- @include dataurlicon("chevrondown", $color-base-neutrals-light);
52
+ @include icon("caret_right", var(--ilo-link-list-color-indent-icon));
54
53
  }
55
54
 
56
55
  [dir="rtl"] & {
57
56
  padding-right: spacing(6);
58
57
  &:before {
59
- transform: translateY(-50%) rotate(90deg);
58
+ @include icon("caret_left", var(--ilo-link-list-color-indent-icon));
59
+ transform: translateY(-50%);
60
60
  left: unset;
61
61
  right: 0;
62
62
  }
@@ -67,28 +67,29 @@
67
67
  & .ilo--link-list--link:focus,
68
68
  &:hover,
69
69
  &:focus {
70
- .ilo--link-list--label:before {
71
- @include dataurlicon("chevrondown", $color-link-text-hover);
72
- }
70
+ --ilo-link-list-color-indent-icon: var(--ilo-color-blue);
73
71
  }
74
72
  }
75
73
  }
76
74
 
75
+ .ilo--link-list--icon {
76
+ @include icon("chevron_right", var(--ilo-link-list-color-icon));
77
+ width: px-to-rem(24px);
78
+ height: px-to-rem(24px);
79
+ }
80
+
77
81
  &--link {
78
- background-position: calc(100% - 4px) center;
79
- background-repeat: no-repeat;
80
- background-size: px-to-rem(24px) px-to-rem(24px);
82
+ display: flex;
83
+ justify-content: space-between;
84
+ align-items: center;
81
85
  border-bottom: px-to-rem($borders-base) solid $color-base-neutrals-lighter;
82
86
  color: map-get($color, "link", "text", "default");
83
- display: block;
84
87
  font-family: var(--ilo-fonts-display);
85
88
  font-weight: map-get($type, "weights", "section");
86
89
  @include font-styles("body-small");
87
90
  padding-top: spacing(4);
88
91
  padding-bottom: spacing(4);
89
- padding-inline-end: spacing(8);
90
92
  text-decoration: none;
91
- @include dataurlicon("chevron_right", $color-link-text-default);
92
93
  @include globaltransition("color, background-color, border-color");
93
94
 
94
95
  &:visited {
@@ -104,41 +105,32 @@
104
105
 
105
106
  &:hover,
106
107
  &:focus {
108
+ --ilo-link-list-color-icon: var(--ilo-color-blue);
107
109
  border-bottom: px-to-rem($borders-base) solid
108
110
  map-get($color, "link", "text", "hover");
109
111
  background-color: $color-base-blue-light;
110
112
  color: map-get($color, "link", "text", "hover");
111
113
  outline: none;
112
- @include dataurlicon("chevron_right", $color-link-text-hover);
113
114
  @include globaltransition("color, background-color, border-color");
114
115
  }
115
116
 
116
117
  [dir="rtl"] & {
117
- background-position: px-to-rem(4px) center;
118
- @include dataurlicon("arrowleft", $color-link-text-default);
119
-
120
- &:hover,
121
- &:focus {
122
- @include dataurlicon("arrowleft", $color-link-text-hover);
118
+ .ilo--link-list--icon {
119
+ @include icon("chevron_left", var(--ilo-link-list-color-icon));
123
120
  }
124
121
  }
125
122
  }
126
123
 
127
124
  &--dark {
125
+ --ilo-link-list-color-icon: var(--ilo-color-white);
126
+ --ilo-link-list-color-indent-icon: var(--ilo-color-white);
128
127
  .ilo--link-list--headline,
129
128
  .ilo--link-list--links--headline {
130
129
  color: $color-base-neutrals-white;
131
130
  }
132
131
 
133
- .ilo--link-list--label {
134
- &:before {
135
- @include dataurlicon("chevrondown", $color-base-neutrals-white);
136
- }
137
- }
138
-
139
132
  .ilo--link-list--link {
140
133
  border-bottom: px-to-rem($borders-base) solid rgba(237, 240, 242, 0.4);
141
- @include dataurlicon("chevron_right", $color-base-neutrals-white);
142
134
 
143
135
  .ilo--link-list--label {
144
136
  color: $color-base-neutrals-white;
@@ -163,27 +155,12 @@
163
155
  &:hover,
164
156
  &:focus {
165
157
  outline: none;
166
- @include dataurlicon("chevron_right", $color-base-blue-medium);
167
158
 
168
159
  .ilo--link-list--label {
169
160
  color: $color-base-blue-medium;
170
161
  @include globaltransition("color");
171
162
  }
172
163
  }
173
-
174
- [dir="rtl"] & {
175
- background-position: px-to-rem(4px) center;
176
- @include dataurlicon("arrowleft", $color-base-neutrals-white);
177
-
178
- &:hover,
179
- &:focus {
180
- @include dataurlicon("arrowleft", $color-base-blue-medium);
181
- }
182
- }
183
164
  }
184
165
  }
185
166
  }
186
-
187
- .wingsuit-body .ilo--link-list--dark {
188
- background-color: $color-base-blue-dark;
189
- }
@@ -57,18 +57,12 @@
57
57
  &::before {
58
58
  transform: translate(-50%, -50%) rotate(180deg);
59
59
 
60
- @include dataurlicon(
61
- "double_chevron_right",
62
- map-get($color, "ux", "pagination", "default", "icon")
63
- );
60
+ @include icon("double_chevron_right", var(--ilo-color-blue-dark));
64
61
  }
65
62
 
66
63
  &:hover {
67
64
  &::before {
68
- @include dataurlicon(
69
- "double_chevron_right",
70
- map-get($color, "ux", "pagination", "hover", "icon")
71
- );
65
+ @include icon("double_chevron_right", var(--ilo-color-blue));
72
66
  }
73
67
  }
74
68
 
@@ -79,10 +73,7 @@
79
73
  background: var(--ilo-color-gray-light);
80
74
 
81
75
  &::before {
82
- @include dataurlicon(
83
- "double_chevron_right",
84
- map-get($color, "ux", "pagination", "default", "icon")
85
- );
76
+ @include icon("double_chevron_right", var(--ilo-color-blue-dark));
86
77
  }
87
78
  }
88
79
  }
@@ -93,18 +84,12 @@
93
84
  transform: translate(-50%, -50%) rotate(180deg);
94
85
  width: px-to-rem(20px);
95
86
 
96
- @include dataurlicon(
97
- "chevron_right",
98
- map-get($color, "ux", "pagination", "default", "icon")
99
- );
87
+ @include icon("chevron_right", var(--ilo-color-blue-dark));
100
88
  }
101
89
 
102
90
  &:hover {
103
91
  &::before {
104
- @include dataurlicon(
105
- "chevron_right",
106
- map-get($color, "ux", "pagination", "hover", "icon")
107
- );
92
+ @include icon("chevron_right", var(--ilo-color-blue));
108
93
  }
109
94
  }
110
95
 
@@ -115,10 +100,7 @@
115
100
  background: var(--ilo-color-gray-light);
116
101
 
117
102
  &::before {
118
- @include dataurlicon(
119
- "chevron_right",
120
- map-get($color, "ux", "pagination", "default", "icon")
121
- );
103
+ @include icon("chevron_right", var(--ilo-color-blue-dark));
122
104
  }
123
105
  }
124
106
  }
@@ -129,18 +111,12 @@
129
111
  transform: translate(-50%, -50%) rotate(0);
130
112
  width: px-to-rem(20px);
131
113
 
132
- @include dataurlicon(
133
- "chevron_right",
134
- map-get($color, "ux", "pagination", "default", "icon")
135
- );
114
+ @include icon("chevron_right", var(--ilo-color-blue-dark));
136
115
  }
137
116
 
138
117
  &:hover {
139
118
  &::before {
140
- @include dataurlicon(
141
- "chevron_right",
142
- map-get($color, "ux", "pagination", "hover", "icon")
143
- );
119
+ @include icon("chevron_right", var(--ilo-color-blue));
144
120
  }
145
121
  }
146
122
 
@@ -151,10 +127,7 @@
151
127
  background: var(--ilo-color-gray-light);
152
128
 
153
129
  &::before {
154
- @include dataurlicon(
155
- "chevron_right",
156
- map-get($color, "ux", "pagination", "default", "icon")
157
- );
130
+ @include icon("chevron_right", var(--ilo-color-blue-dark));
158
131
  }
159
132
  }
160
133
  }
@@ -162,18 +135,12 @@
162
135
 
163
136
  &--last-page {
164
137
  &::before {
165
- @include dataurlicon(
166
- "double_chevron_right",
167
- map-get($color, "ux", "pagination", "default", "icon")
168
- );
138
+ @include icon("double_chevron_right", var(--ilo-color-blue-dark));
169
139
  }
170
140
 
171
141
  &:hover {
172
142
  &::before {
173
- @include dataurlicon(
174
- "double_chevron_right",
175
- map-get($color, "ux", "pagination", "hover", "icon")
176
- );
143
+ @include icon("double_chevron_right", var(--ilo-color-blue));
177
144
  }
178
145
  }
179
146
 
@@ -184,10 +151,7 @@
184
151
  background: var(--ilo-color-gray-light);
185
152
 
186
153
  &::before {
187
- @include dataurlicon(
188
- "chevron_right",
189
- map-get($color, "ux", "pagination", "default", "icon")
190
- );
154
+ @include icon("chevron_right", var(--ilo-color-blue-dark));
191
155
  }
192
156
  }
193
157
  }
@@ -106,12 +106,6 @@
106
106
  outline: none;
107
107
  border-top: px-to-rem(3px) solid $color-base-blue-medium;
108
108
  @include globaltransition("color, background-color, border-color");
109
-
110
- &.has--tooltip {
111
- .ilo--tooltip--wrapper {
112
- @include dataurlicon("info", $color-base-blue-medium);
113
- }
114
- }
115
109
  }
116
110
  }
117
111
 
@@ -88,7 +88,7 @@
88
88
 
89
89
  &.icon__position--right {
90
90
  .ilo--icon {
91
- @include dataurlicon("close", map-get($color, "tag", "text", "active"));
91
+ @include icon("close", var(--ilo-color-blue-dark));
92
92
  background-position: center;
93
93
  background-repeat: no-repeat;
94
94
  background-size: contain;
@@ -111,10 +111,7 @@
111
111
 
112
112
  &.icon__position--right {
113
113
  .ilo--icon {
114
- @include dataurlicon(
115
- "close",
116
- map-get($color, "tag", "text", "hover")
117
- );
114
+ @include icon("close", var(--ilo-color-blue));
118
115
  }
119
116
  }
120
117
  }
@@ -148,7 +145,7 @@
148
145
 
149
146
  &.icon__position--right {
150
147
  .ilo--icon {
151
- @include dataurlicon("close", map-get($color, "tag", "text", "active"));
148
+ @include icon("close", var(--ilo-color-blue-dark));
152
149
 
153
150
  height: 100%;
154
151
  max-height: 28px;
@@ -169,10 +166,7 @@
169
166
 
170
167
  &.icon__position--right {
171
168
  .ilo--icon {
172
- @include dataurlicon(
173
- "close",
174
- map-get($color, "tag", "text", "hover")
175
- );
169
+ @include icon("close", var(--ilo-color-blue));
176
170
  }
177
171
  }
178
172
  }