@ilo-org/styles 1.8.1 → 1.8.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.8.1",
4
+ "version": "1.8.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -39,8 +39,8 @@
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
41
  "@ilo-org/fonts": "1.0.0",
42
- "@ilo-org/themes": "0.9.1",
43
- "@ilo-org/icons": "2.1.0"
42
+ "@ilo-org/icons": "2.1.0",
43
+ "@ilo-org/themes": "0.9.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "cssnano": "^7.0.6",
package/scss/_mixins.scss CHANGED
@@ -189,106 +189,57 @@
189
189
  // Link styles
190
190
  // ======================================
191
191
 
192
- @mixin linkstyles() {
193
- background: map-get($color, "link", "background", "default");
194
- color: map-get($color, "link", "text", "default");
192
+ @mixin linkstyles($theme: "light") {
193
+ $color-default: var(--ilo-link-color-default-light);
194
+ $color-visited: var(--ilo-link-color-visited-light);
195
+ $color-hover: var(--ilo-link-color-hover-light);
196
+ $color-active: var(--ilo-link-color-active-light);
197
+ $color-focus: var(--ilo-link-color-focus-light);
198
+ $background-default: var(--ilo-link-background-default-light);
199
+ $background-hover: var(--ilo-link-background-hover-light);
200
+ $background-focus: var(--ilo-link-background-focus-light);
201
+
202
+ @if ($theme == "dark") {
203
+ $color-default: var(--ilo-link-color-default-dark);
204
+ $color-visited: var(--ilo-link-color-visited-dark);
205
+ $color-hover: var(--ilo-link-color-hover-dark);
206
+ $background-default: var(--ilo-link-background-default-dark);
207
+ $background-hover: var(--ilo-link-background-hover-dark);
208
+ $background-focus: var(--ilo-link-background-focus-dark);
209
+ }
210
+
211
+ // Default styles
195
212
  font-size: inherit;
196
213
  font-weight: inherit;
197
214
  line-height: inherit;
198
215
  text-decoration: underline;
199
- text-underline-offset: px-to-rem(6px);
200
- text-decoration-thickness: px-to-rem(1.5px);
201
- text-decoration-color: var(--ilo-color-blue);
202
- padding-bottom: spacing(1);
216
+ background: transparent;
217
+ text-decoration-thickness: #{px-to-rem(1px)};
218
+ text-underline-offset: #{px-to-rem(6px)};
219
+ padding-bottom: #{spacing(1)};
220
+
221
+ color: $color-default;
222
+ text-decoration-color: $color-default;
203
223
 
204
224
  &:visited {
205
- background: map-get($color, "link", "background", "visited");
206
- color: map-get($color, "link", "text", "visited");
207
- text-decoration-color: var(--ilo-color-purple);
225
+ color: $color-visited;
226
+ text-decoration-color: $color-visited;
208
227
  }
209
228
 
210
229
  &:hover {
211
- background: map-get($color, "link", "background", "hover");
212
- color: map-get($color, "link", "text", "hover");
213
- text-decoration-thickness: 3px;
214
- text-decoration-color: var(--ilo-color-blue);
215
- }
216
-
217
- &:active {
218
- background: map-get($color, "link", "background", "active");
219
- color: map-get($color, "link", "text", "active");
220
- text-decoration-thickness: 3px;
221
- text-decoration-color: var(--ilo-color-blue-dark);
230
+ color: $color-hover;
231
+ background-color: $background-hover;
232
+ text-decoration-color: $color-hover;
233
+ text-decoration-thickness: #{px-to-rem(3px)};
222
234
  }
223
235
 
236
+ &:active,
224
237
  &:focus {
225
- background: map-get($color, "link", "background", "focus");
226
- color: map-get($color, "link", "text", "focus");
227
- text-decoration-thickness: 3px;
228
- text-decoration-color: var(--ilo-color-blue-dark);
229
- }
230
-
231
- &--dark {
232
- background: map-get($color, "link", "background-dark", "default");
233
- color: map-get($color, "link", "text-dark", "default");
234
- text-decoration-color: var(--ilo-color-gray-light);
235
-
236
- &:visited {
237
- background: map-get($color, "link", "background-dark", "visited");
238
- color: map-get($color, "link", "text-dark", "visited");
239
- text-decoration-color: var(--ilo-color-gray-base);
240
- }
241
-
242
- &:hover {
243
- background: map-get($color, "link", "background-dark", "hover");
244
- color: map-get($color, "link", "text-dark", "hover");
245
- text-decoration-thickness: 3px;
246
- text-decoration-color: var(--ilo-color-blue);
247
- }
248
-
249
- &:active {
250
- background: map-get($color, "link", "background-dark", "active");
251
- color: map-get($color, "link", "text-dark", "active");
252
- text-decoration-thickness: 3px;
253
- text-decoration-color: var(--ilo-color-blue-dark);
254
- }
255
-
256
- &:focus {
257
- background: map-get($color, "link", "background-dark", "focus");
258
- color: map-get($color, "link", "text-dark", "focus");
259
- text-decoration-thickness: 3px;
260
- text-decoration-color: var(--ilo-color-blue-dark);
261
- }
262
- }
263
-
264
- &--footer {
265
- @include font-styles("body-xxs");
266
-
267
- background: map-get($color, "link", "background-footer", "default");
268
- color: map-get($color, "link", "text-footer", "default");
269
-
270
- &:visited {
271
- background: map-get($color, "link", "background-footer", "visited");
272
- color: map-get($color, "link", "text-footer", "visited");
273
- }
274
-
275
- &:hover {
276
- background: map-get($color, "link", "background-footer", "hover");
277
- color: map-get($color, "link", "text-footer", "hover");
278
- text-decoration-thickness: 3px;
279
- }
280
-
281
- &:active {
282
- background: map-get($color, "link", "background-footer", "active");
283
- color: map-get($color, "link", "text-footer", "active");
284
- text-decoration-thickness: 3px;
285
- }
286
-
287
- &:focus {
288
- background: map-get($color, "link", "background-footer", "focus");
289
- color: map-get($color, "link", "text-footer", "focus");
290
- text-decoration-thickness: 3px;
291
- }
238
+ color: $color-focus;
239
+ text-decoration-color: $color-focus;
240
+ text-decoration-thickness: #{px-to-rem(3px)};
241
+ background-color: $background-focus;
242
+ outline: none;
292
243
  }
293
244
  }
294
245
 
@@ -2,5 +2,11 @@
2
2
  @use "../mixins" as *;
3
3
 
4
4
  .ilo--link {
5
- @include linkstyles();
5
+ &__theme__light {
6
+ @include linkstyles("light");
7
+ }
8
+
9
+ &__theme__dark {
10
+ @include linkstyles("dark");
11
+ }
6
12
  }
@@ -16,6 +16,10 @@
16
16
  --ilo-richtext-hr-color: var(--ilo-color-gray-light);
17
17
  --ilo-richtext-link-color: var(--ilo-color-purple);
18
18
  --ilo-richtext-link-visited-color: var(--ilo-color-purple);
19
+
20
+ a {
21
+ @include linkstyles("light");
22
+ }
19
23
  }
20
24
 
21
25
  &__theme__dark {
@@ -24,6 +28,10 @@
24
28
  --ilo-richtext-hr-color: var(--ilo-color-gray-light);
25
29
  --ilo-richtext-link-color: var(--ilo-color-blue-medium);
26
30
  --ilo-richtext-link-visited-color: var(--ilo-color-blue-medium);
31
+
32
+ a {
33
+ @include linkstyles("dark");
34
+ }
27
35
  }
28
36
 
29
37
  color: var(--ilo-richtext-color);
@@ -101,16 +109,6 @@
101
109
  font-weight: 700;
102
110
  }
103
111
 
104
- // Link styles
105
- a {
106
- @include linkstyles();
107
- background: none;
108
-
109
- &:hover {
110
- background: none;
111
- }
112
- }
113
-
114
112
  // Image styles
115
113
  img {
116
114
  width: 100%;
@@ -63,7 +63,6 @@
63
63
  /**
64
64
  * Font-size
65
65
  */
66
-
67
66
  --ilo-font-size-2xsm: calc(#{px-to-rem(10)} * var(--ilo-scale));
68
67
  --ilo-font-size-xsm: calc(#{px-to-rem(12)} * var(--ilo-scale));
69
68
  --ilo-font-size-sm: calc(#{px-to-rem(14)} * var(--ilo-scale));
@@ -119,4 +118,31 @@
119
118
  --ilo-border-sm: calc(#{px-to-rem(1.5)} * var(--ilo-scale));
120
119
  --ilo-border-md: calc(#{px-to-rem(2)} * var(--ilo-scale));
121
120
  --ilo-border-lg: calc(#{px-to-rem(4)} * var(--ilo-scale));
121
+
122
+ /**
123
+ * Links
124
+ */
125
+ --ilo-link-color-default-light: var(--ilo-color-blue-dark);
126
+ --ilo-link-color-default-dark: var(--ilo-color-white);
127
+
128
+ --ilo-link-color-visited-light: var(--ilo-color-purple);
129
+ --ilo-link-color-visited-dark: var(--ilo-color-gray-base);
130
+
131
+ --ilo-link-color-hover-light: var(--ilo-color-blue);
132
+ --ilo-link-color-hover-dark: var(--ilo-color-blue);
133
+
134
+ --ilo-link-color-active-light: var(--ilo-color-blue-dark);
135
+ --ilo-link-color-active-dark: var(--ilo-color-blue-dark);
136
+
137
+ --ilo-link-color-focus-light: var(--ilo-color-blue-dark);
138
+ --ilo-link-color-focus-dark: var(--ilo-color-blue-dark);
139
+
140
+ --ilo-link-background-default-light: transparent;
141
+ --ilo-link-background-default-dark: transparent;
142
+
143
+ --ilo-link-background-hover-light: transparent;
144
+ --ilo-link-background-hover-dark: var(--ilo-color-white);
145
+
146
+ --ilo-link-background-focus-light: var(--ilo-color-yellow);
147
+ --ilo-link-background-focus-dark: var(--ilo-color-yellow);
122
148
  }