@ilo-org/styles 1.8.0 → 1.8.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.
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.0",
4
+ "version": "1.8.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -38,9 +38,9 @@
38
38
  "author": "@justintemps, @johnpauldavis, @avrilpearl, @ghlost",
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
- "@ilo-org/icons": "2.1.0",
41
+ "@ilo-org/fonts": "1.0.0",
42
42
  "@ilo-org/themes": "0.9.1",
43
- "@ilo-org/fonts": "1.0.0"
43
+ "@ilo-org/icons": "2.1.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "cssnano": "^7.0.6",
@@ -7,16 +7,28 @@
7
7
  .#{$prefix}--breadcrumb {
8
8
  $breadcrumb: &;
9
9
 
10
+ --ilo-breadcrumb-background-color: var(--ilo-color-white);
11
+ --ilo-breadcrumb-link-color: var(--ilo-color-blue-dark);
12
+ --ilo-breadcrumb-link-hover-color: var(--ilo-color-blue);
13
+
10
14
  position: relative;
11
15
  z-index: 10;
12
16
 
17
+ &__theme {
18
+ &__dark {
19
+ --ilo-breadcrumb-background-color: var(--ilo-color-blue-dark);
20
+ --ilo-breadcrumb-link-color: var(--ilo-color-white);
21
+ --ilo-breadcrumb-link-hover-color: var(--ilo-color-white);
22
+ }
23
+ }
24
+
13
25
  &--inner {
14
26
  display: inline-flex;
15
27
  // Local variable set in the Hero for alignment
16
28
  padding-inline-start: var(--breadcrumb-padding);
17
29
  padding-inline-end: spacing(12);
18
30
  padding-block: spacing(4);
19
- background-color: var(--ilo-color-white);
31
+ background-color: var(--ilo-breadcrumb-background-color);
20
32
  @include cornercut(spacing(12), 100%, "right", "bottom");
21
33
 
22
34
  [dir="rtl"] & {
@@ -42,7 +54,7 @@
42
54
  left: 0;
43
55
  position: absolute;
44
56
  background-repeat: no-repeat;
45
- @include dataurlicon("chevron_right", $color-link-text-default);
57
+ @include icon("chevron_right", var(--ilo-breadcrumb-link-color));
46
58
  background-size: px-to-rem(24px);
47
59
  height: px-to-rem(24px);
48
60
  width: px-to-rem(24px);
@@ -50,7 +62,7 @@
50
62
  [dir="rtl"] & {
51
63
  left: auto;
52
64
  right: 0;
53
- @include dataurlicon("chevron_left", $color-link-text-default);
65
+ @include icon("chevron_left", var(--ilo-breadcrumb-link-color));
54
66
  }
55
67
  }
56
68
  }
@@ -70,11 +82,11 @@
70
82
  width: px-to-rem(24px);
71
83
  height: px-to-rem(24px);
72
84
  background-size: px-to-rem(24px);
73
- @include dataurlicon("dot_menu", $color-link-text-default);
85
+ @include icon("dot_menu", var(--ilo-breadcrumb-link-color));
74
86
 
75
87
  &:hover {
76
88
  cursor: pointer;
77
- @include dataurlicon("dot_menu", $color-base-blue-medium);
89
+ @include icon("dot_menu", var(--ilo-breadcrumb-link-hover-color));
78
90
  }
79
91
  }
80
92
 
@@ -115,39 +127,30 @@
115
127
  width: px-to-rem(24px);
116
128
  height: px-to-rem(24px);
117
129
 
118
- // No chevron befor the home icon
130
+ // No chevron before the home icon
119
131
  &:before {
120
132
  content: none;
121
133
  }
122
134
 
123
- &:hover,
124
- &:focus {
125
- #{$breadcrumb}--link {
135
+ #{$breadcrumb}--link {
136
+ height: 24px;
137
+ width: 24px;
138
+ position: relative;
139
+
140
+ &:hover,
141
+ &:focus {
126
142
  &:after {
127
- @include dataurlicon("home", $color-link-text-hover);
128
- width: px-to-rem(24px);
129
- height: px-to-rem(24px);
143
+ @include icon("home", var(--ilo-breadcrumb-link-hover-color));
130
144
  }
131
145
  }
132
- }
133
-
134
- #{$breadcrumb}--link {
135
- background: none;
136
- width: px-to-rem(16px);
137
- height: px-to-rem(16px);
138
- position: relative;
139
146
 
140
147
  &:after {
141
- background-position: center center;
142
- background-repeat: no-repeat;
143
148
  content: "";
144
149
  display: block;
145
- left: 0;
146
- top: 0;
147
- height: px-to-rem(24px);
148
- width: px-to-rem(24px);
149
- background-size: px-to-rem(24px);
150
- @include dataurlicon("home", $color-link-text-default);
150
+ height: 24px;
151
+ width: 24px;
152
+ position: relative;
153
+ @include icon("home", var(--ilo-breadcrumb-link-color));
151
154
  }
152
155
  }
153
156
  }
@@ -156,7 +159,7 @@
156
159
  &--link {
157
160
  display: inline-flex;
158
161
  align-items: center;
159
- color: $color-link-text-default;
162
+ color: var(--ilo-breadcrumb-link-color);
160
163
  height: px-to-rem(16px);
161
164
  padding-block: 0;
162
165
  text-decoration: none;
@@ -172,7 +175,7 @@
172
175
 
173
176
  &:hover,
174
177
  &:focus {
175
- color: $color-link-text-hover;
178
+ color: var(--ilo-breadcrumb-link-hover-color);
176
179
  text-decoration: underline;
177
180
  text-underline-offset: px-to-rem(4px);
178
181
  text-decoration-thickness: px-to-rem(2px);
@@ -141,6 +141,10 @@ $link-hover-selectors: ".ilo--card--link:hover, .ilo--card--link:focus, .ilo--ca
141
141
 
142
142
  &__light,
143
143
  &__soft {
144
+ #{$self}--date-extra {
145
+ color: var(--ilo-color-gray-charcoal);
146
+ }
147
+
144
148
  @include card-link-hover {
145
149
  border-bottom: px-to-rem(3px) solid var(--ilo-color-blue);
146
150
 
@@ -175,6 +179,7 @@ $link-hover-selectors: ".ilo--card--link:hover, .ilo--card--link:focus, .ilo--ca
175
179
  #{$self}--eyebrow,
176
180
  #{$self}--intro,
177
181
  #{$self}--date,
182
+ #{$self}--date-extra,
178
183
  #{$self}--content--item {
179
184
  color: var(--ilo-color-gray-light);
180
185
  }
@@ -12,8 +12,8 @@
12
12
 
13
13
  --max-width: #{px-to-rem(600px)};
14
14
 
15
- background: $brand-ilo-light-blue;
16
- border-bottom: px-to-rem(3px) solid $brand-ilo-ramp-blue;
15
+ background: var(--ilo-color-blue-lighter);
16
+ border-bottom: px-to-rem(3px) solid var(--ilo-color-blue-light);
17
17
  padding: spacing(12) spacing(10) spacing(14);
18
18
  position: relative;
19
19
  width: 100%;
@@ -137,16 +137,9 @@
137
137
  }
138
138
 
139
139
  &--content-label {
140
- @include font-styles("body-xs");
141
- @include textmargin(
142
- "margin-bottom",
143
- 13px,
144
- "body-xs",
145
- "copy",
146
- "headline-5",
147
- "display"
148
- );
149
- color: $brand-ilo-grey-accessible;
140
+ @include typography("body-small");
141
+ margin-block-end: spacing(2);
142
+ color: var(--ilo-color-gray-accessible);
150
143
  }
151
144
 
152
145
  #{$self}--eyebrow {
@@ -154,14 +147,19 @@
154
147
  }
155
148
 
156
149
  &--content-copy {
157
- @include font-styles("headline-5");
158
- color: $brand-ilo-black;
159
- font-family: var(--ilo-fonts-display);
160
- font-weight: 500;
150
+ @include typography("body-large");
151
+ color: var(--ilo-color-gray-charcoal);
152
+
153
+ @include breakpoint("md") {
154
+ #{$self}__size__wide &,
155
+ #{$self}__size__fluid & {
156
+ @include typography("body-xlarge");
157
+ }
158
+ }
161
159
  }
162
160
 
163
161
  [class*="ilo--link"] {
164
- @include font-styles("headline-6");
162
+ @include typography("body-large");
165
163
  line-height: 1.8;
166
164
  margin-inline-end: px-to-rem(12px);
167
165
  margin-bottom: px-to-rem(12px);
@@ -55,7 +55,6 @@
55
55
 
56
56
  #{$self}--date-extra {
57
57
  @include typography("body-medium");
58
- color: var(--ilo-color-gray-charcoal);
59
58
  gap: spacing(2);
60
59
 
61
60
  // this makes sure the para will be indented
@@ -26,8 +26,10 @@
26
26
  top: 50%;
27
27
  left: 50%;
28
28
  transform: translate(-50%, -50%);
29
- height: auto;
29
+ height: 100%;
30
30
  width: 100%;
31
+ object-fit: cover;
32
+ object-position: center;
31
33
  }
32
34
  }
33
35
 
@@ -4,6 +4,25 @@
4
4
  @import "../mixins";
5
5
 
6
6
  .ilo--fieldset {
7
+ --ilo-fieldset-legend-color: var(--ilo-color-gray-charcoal);
8
+ --ilo-fieldset-helper-color: var(--ilo-color-gray-accessible);
9
+ --ilo-fieldset-error-color: var(--ilo-color-red-dark);
10
+
11
+ &__theme {
12
+ &__light {
13
+ --ilo-fieldset-legend-color: var(--ilo-color-gray-charcoal);
14
+ --ilo-fieldset-helper-color: var(--ilo-color-gray-accessible);
15
+ --ilo-fieldset-error-color: var(--ilo-color-red-dark);
16
+ }
17
+ &__dark {
18
+ --ilo-fieldset-legend-color: var(--ilo-color-yellow);
19
+ --ilo-fieldset-helper-color: var(--ilo-color-white);
20
+ --ilo-fieldset-error-color: var(--ilo-color-red-dark);
21
+ }
22
+ }
23
+
24
+ appearance: none;
25
+ $c: &;
7
26
  $gap: 24px;
8
27
  box-sizing: border-box;
9
28
 
@@ -15,9 +34,6 @@
15
34
  @include textmargin("gap", $gap, "label-medium", "display", 0, 0);
16
35
  }
17
36
 
18
- appearance: none;
19
- $c: &;
20
-
21
37
  &--legend-wrapper {
22
38
  @include textmargin("margin-bottom", $gap, "label-medium", "display", 0, 0);
23
39
 
@@ -33,6 +49,7 @@
33
49
  flex-flow: row nowrap;
34
50
  align-items: center;
35
51
  @include font-styles("label-medium");
52
+ color: var(--ilo-fieldset-legend-color);
36
53
  line-height: px-to-rem(20px);
37
54
  }
38
55
 
@@ -99,11 +116,11 @@
99
116
  }
100
117
 
101
118
  &--helper {
102
- color: $color-base-neutrals-medium;
119
+ color: var(--ilo-fieldset-helper-color);
103
120
  }
104
121
 
105
122
  &__error {
106
- color: $color-base-red-dark;
123
+ color: var(--ilo-fieldset-error-color);
107
124
  }
108
125
 
109
126
  &__disabled {
@@ -5,6 +5,16 @@
5
5
  .ilo--form {
6
6
  $gap: spacing(8);
7
7
  $c: &;
8
+ --ilo-form-legend-color: var(--ilo-color-blue-dark);
9
+
10
+ &__theme {
11
+ &__light {
12
+ --ilo-form-legend-color: var(--ilo-color-blue-dark);
13
+ }
14
+ &__dark {
15
+ --ilo-form-legend-color: var(--ilo-color-white);
16
+ }
17
+ }
8
18
 
9
19
  box-sizing: border-box;
10
20
  display: flex;
@@ -13,34 +23,15 @@
13
23
  flex-direction: column;
14
24
  appearance: none;
15
25
  gap: $gap;
16
- color: $color-base-neutrals-black;
17
-
18
- &__theme {
19
- &__light {
20
- color: $color-base-neutrals-black;
21
-
22
- label,
23
- p {
24
- color: $color-base-neutrals-black;
25
- }
26
- }
27
-
28
- &__dark {
29
- color: $color-base-neutrals-lighter;
30
-
31
- label,
32
- p {
33
- color: $color-base-neutrals-lighter;
34
- }
35
-
36
- legend {
37
- color: $color-base-yellow;
38
- }
39
- }
40
- }
26
+ color: var(--ilo-color-gray-charcoal);
41
27
 
42
28
  &__disabled {
43
29
  opacity: 0.5;
44
30
  pointer-events: none;
45
31
  }
32
+
33
+ // Twig uses h2 for the form headline but React doesn't have one
34
+ h2 {
35
+ color: var(--ilo-form-legend-color);
36
+ }
46
37
  }
@@ -6,12 +6,29 @@
6
6
  .ilo--form-control {
7
7
  $c: &;
8
8
 
9
+ --ilo-form-control-label-color: var(--ilo-color-gray-charcoal);
10
+ --ilo-form-control-helper-color: var(--ilo-color-gray-accessible);
11
+ --ilo-form-control-error-color: var(--ilo-color-red-dark);
12
+
9
13
  grid-area: input;
10
14
  display: inline-grid;
11
15
  grid-template-rows: auto;
12
16
  grid-template-columns: auto;
13
17
  gap: spacing(2);
14
18
 
19
+ &__theme {
20
+ &__light {
21
+ --ilo-form-control-label-color: var(--ilo-color-gray-charcoal);
22
+ --ilo-form-control-helper-color: var(--ilo-color-gray-accessible);
23
+ --ilo-form-control-error-color: var(--ilo-color-red-dark);
24
+ }
25
+ &__dark {
26
+ --ilo-form-control-label-color: var(--ilo-color-white);
27
+ --ilo-form-control-helper-color: var(--ilo-color-white);
28
+ --ilo-form-control-error-color: var(--ilo-color-red-dark);
29
+ }
30
+ }
31
+
15
32
  &__label-placement {
16
33
  // Label is to the flex start of form element
17
34
  &__start {
@@ -116,12 +133,12 @@
116
133
 
117
134
  &__error {
118
135
  #{$c}--helper {
119
- color: $color-base-red-dark;
136
+ color: var(--ilo-form-control-error-color);
120
137
  }
121
138
  }
122
139
 
123
140
  &--label {
124
- color: $color-base-neutrals-black;
141
+ color: var(--ilo-form-control-label-color);
125
142
  grid-area: label;
126
143
  display: flex;
127
144
  flex-flow: row nowrap;
@@ -179,7 +196,7 @@
179
196
 
180
197
  &--helper {
181
198
  grid-area: helper;
182
- color: $color-base-neutrals-medium;
199
+ color: var(--ilo-form-control-helper-color);
183
200
  font-family: var(--ilo-fonts-copy);
184
201
  @include font-styles("body-xxs");
185
202
  }
@@ -41,8 +41,10 @@
41
41
  top: 50%;
42
42
  left: 50%;
43
43
  transform: translate(-50%, -50%);
44
- height: auto;
44
+ height: 100%;
45
45
  width: 100%;
46
+ object-fit: cover;
47
+ object-position: center;
46
48
  }
47
49
  }
48
50
 
@@ -3,6 +3,18 @@
3
3
  @import "../mixins";
4
4
 
5
5
  .ilo--pagination {
6
+ --ilo-pagination-page-color: var(--ilo-color-blue-dark);
7
+
8
+ &__theme {
9
+ &__dark {
10
+ --ilo-pagination-page-color: var(--ilo-color-white);
11
+ }
12
+
13
+ &__light {
14
+ --ilo-pagination-page-color: var(--ilo-color-blue-dark);
15
+ }
16
+ }
17
+
6
18
  display: flex;
7
19
  justify-content: space-between;
8
20
  margin-bottom: spacing(10);
@@ -160,9 +172,10 @@
160
172
  &--page {
161
173
  display: flex;
162
174
  gap: spacing(1);
163
- @include font-styles("nav-md-sm");
175
+ @include typography("highlight-small");
164
176
  margin-inline-end: spacing(2);
165
177
  font-family: var(--ilo-fonts-copy);
178
+ color: var(--ilo-pagination-page-color);
166
179
  font-weight: 400;
167
180
  line-height: 45px;
168
181
 
@@ -4,6 +4,30 @@
4
4
  @import "../mixins";
5
5
 
6
6
  .ilo--richtext {
7
+ --ilo-richtext-color: var(--ilo-color-blue-dark);
8
+ --ilo-richtext-figcaption-color: var(--ilo-color-gray-accessible);
9
+ --ilo-richtext-hr-color: var(--ilo-color-gray-light);
10
+ --ilo-richtext-link-color: var(--ilo-color-purple);
11
+ --ilo-richtext-link-visited-color: var(--ilo-color-purple);
12
+
13
+ &__theme__light {
14
+ --ilo-richtext-color: var(--ilo-color-blue-dark);
15
+ --ilo-richtext-figcaption-color: var(--ilo-color-gray-accessible);
16
+ --ilo-richtext-hr-color: var(--ilo-color-gray-light);
17
+ --ilo-richtext-link-color: var(--ilo-color-purple);
18
+ --ilo-richtext-link-visited-color: var(--ilo-color-purple);
19
+ }
20
+
21
+ &__theme__dark {
22
+ --ilo-richtext-color: var(--ilo-color-white);
23
+ --ilo-richtext-figcaption-color: var(--ilo-color-gray-light);
24
+ --ilo-richtext-hr-color: var(--ilo-color-gray-light);
25
+ --ilo-richtext-link-color: var(--ilo-color-blue-medium);
26
+ --ilo-richtext-link-visited-color: var(--ilo-color-blue-medium);
27
+ }
28
+
29
+ color: var(--ilo-richtext-color);
30
+
7
31
  & > * {
8
32
  margin-top: spacing(4);
9
33
  margin-bottom: spacing(4);
@@ -100,7 +124,7 @@
100
124
  // Figcaption styles
101
125
  figcaption {
102
126
  border-left: var(--ilo-border-lg) solid var(--ilo-color-borders-default);
103
- color: var(--ilo-color-gray-accessible);
127
+ color: var(--ilo-richtext-figcaption-color);
104
128
  font-weight: var(--ilo-font-weight-regular);
105
129
  margin-top: spacing(4);
106
130
  padding-left: spacing(2);
@@ -109,7 +133,7 @@
109
133
 
110
134
  // Horizontal rule (hr) styles
111
135
  hr {
112
- background-color: var(--ilo-color-gray-light);
136
+ background-color: var(--ilo-richtext-hr-color);
113
137
  border: none;
114
138
  height: px-to-rem(3px);
115
139
  }