@ilo-org/styles 0.11.0 → 0.11.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": "0.11.0",
4
+ "version": "0.11.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -18,7 +18,7 @@
18
18
  "css"
19
19
  ],
20
20
  "dependencies": {
21
- "@ilo-org/fonts": "0.1.0",
21
+ "@ilo-org/fonts": "0.1.2",
22
22
  "@ilo-org/icons": "0.2.1",
23
23
  "@ilo-org/themes": "0.6.1"
24
24
  },
package/scss/_reset.scss CHANGED
@@ -151,6 +151,12 @@ select {
151
151
  -moz-appearance: none;
152
152
  }
153
153
 
154
+ // Reset border-radius on iOS Safari
155
+ input,
156
+ textarea {
157
+ border-radius: 0;
158
+ }
159
+
154
160
  *,
155
161
  *::before,
156
162
  *::after {
@@ -3,33 +3,35 @@
3
3
  @import "../mixins";
4
4
 
5
5
  .ilo--accordion {
6
- $transition-timing: 150ms;
7
- $transition-timing-long: 225ms;
8
- $scroll-max-height: 500px;
6
+ $transition-timing: 500ms;
7
+ $scroll-max-height: 300px;
9
8
 
10
9
  &--button {
10
+ display: flex;
11
11
  align-items: center;
12
+ flex-direction: row;
13
+ justify-content: space-between;
14
+
15
+ width: 100%;
16
+ margin: 0;
17
+ padding: px-to-rem(calc($spacing-ui-padding-lg - 6px)) px-to-rem(36px)
18
+ px-to-rem(calc($spacing-ui-padding-lg - 6px)) 0;
19
+
12
20
  background-color: $color-ux-background-default;
13
21
  background-position: calc(100% - px-to-rem(6px)) center;
14
22
  background-repeat: no-repeat;
15
23
  background-size: px-to-rem(24px) px-to-rem(24px);
24
+
16
25
  border: none;
17
26
  border-top: 2px solid map-get($color, "accordion", "border");
18
- color: $color-ux-labels-actionable;
19
- display: flex;
27
+
20
28
  fill: $color-ux-labels-actionable;
21
- flex-direction: row;
22
29
  font-family: $fonts-display;
30
+ color: $color-ux-labels-actionable;
23
31
  font-weight: map-get($type, "weights", "section");
24
32
  @include font-styles("label-medium");
25
- justify-content: space-between;
26
- margin: 0;
27
- padding: px-to-rem(calc($spacing-ui-padding-lg - 6px)) px-to-rem(36px)
28
- px-to-rem(calc($spacing-ui-padding-lg - 6px)) 0;
29
- text-align: left;
30
- transition: border $transition-timing ease-out,
31
- background $transition-timing ease-out, color $transition-timing ease-out;
32
- width: 100%;
33
+
34
+ transition: all $transition-timing ease-in-out;
33
35
  @include dataurlicon("add", $color-ux-labels-actionable);
34
36
 
35
37
  &--large {
@@ -77,50 +79,26 @@
77
79
  }
78
80
 
79
81
  &--panel {
80
- --height: auto;
81
- color: $color-ux-labels-default;
82
- font-family: $fonts-copy;
83
- position: relative;
84
- height: 0px;
82
+ $panel: &;
83
+
84
+ max-height: 0;
85
+ transition: all $transition-timing cubic-bezier(0, 1, 0, 1);
85
86
  overflow: hidden;
86
- transition: height $transition-timing-long ease-out,
87
- padding $transition-timing-long ease-out;
88
87
 
89
88
  .ilo--accordion--innerpanel {
90
89
  padding-bottom: px-to-rem($spacing-ui-padding-xxl);
91
90
  padding-top: px-to-rem(8px);
92
91
  }
93
92
 
94
- @include font-styles("label-medium");
95
-
96
93
  &--open {
97
- height: var(--height);
98
- transition: height $transition-timing-long ease-out,
99
- padding $transition-timing-long ease-out;
100
- }
101
-
102
- &__scroll {
103
- max-height: $scroll-max-height;
104
- overflow-y: auto;
105
- padding-right: px-to-rem($spacing-ui-padding-xl);
106
- }
94
+ max-height: 100vh;
95
+ transition: all $transition-timing ease-in-out;
107
96
 
108
- &.collapsing,
109
- &.expanding {
110
- height: 0;
111
- position: relative;
112
- overflow: hidden;
113
- visibility: visible;
114
- -webkit-transition-property: height, padding, visibility;
115
- transition-property: height, padding, visibility;
116
- transition-duration: attr(data-transition);
117
- -webkit-transition-duration: attr(data-transition);
118
- transition-timing-function: ease;
119
- -webkit-transition-timing-function: ease;
120
- }
121
-
122
- @include breakpoint("medium") {
123
- @include font-styles("label-large");
97
+ &#{$panel}__scroll {
98
+ max-height: $scroll-max-height;
99
+ overflow-y: auto;
100
+ padding-right: px-to-rem($spacing-ui-padding-xl);
101
+ }
124
102
  }
125
103
  }
126
104
  }
@@ -24,20 +24,18 @@
24
24
  &--sidebar {
25
25
  padding: px-to-rem($spacing-padding-3 + 2) px-to-rem(12px);
26
26
  width: px-to-rem(40px);
27
+
28
+ #{$self}--icon {
29
+ position: relative;
30
+ top: px-to-rem(1.5px);
31
+ }
27
32
  }
28
33
 
29
34
  &--content {
30
35
  padding: px-to-rem($spacing-padding-3 + 2) px-to-rem($spacing-padding-3 - 2)
31
36
  px-to-rem($spacing-padding-3);
32
37
  width: 100%;
33
- }
34
-
35
- &--copy {
36
- @include font-styles("body-xs");
37
-
38
- &:not(:last-child) {
39
- margin-bottom: px-to-rem($spacing-padding-3);
40
- }
38
+ font-size: px-to-rem(14.93px);
41
39
  }
42
40
 
43
41
  &--header {
@@ -46,7 +44,7 @@
46
44
  padding: 0 0 px-to-rem(24px);
47
45
  }
48
46
 
49
- &--headline {
47
+ &--title {
50
48
  @include font-styles("nav-bold-b");
51
49
 
52
50
  font-family: $fonts-display;
@@ -62,7 +60,7 @@
62
60
  cursor: pointer;
63
61
  font-family: $fonts-display;
64
62
  font-weight: 500;
65
- padding-right: 36px;
63
+ padding-right: 32px;
66
64
  position: relative;
67
65
 
68
66
  &--icon {
@@ -73,11 +71,11 @@
73
71
  display: inline-block;
74
72
  height: 24px;
75
73
  position: absolute;
76
- right: -3px;
77
- top: 50%;
74
+ right: 0;
75
+ top: 11px;
78
76
  transform: translateY(-50%) rotate(0);
79
77
  transition: transform 225ms ease-out;
80
- width: 23px;
78
+ width: 24px;
81
79
  }
82
80
  }
83
81
 
@@ -85,6 +85,10 @@
85
85
  }
86
86
  }
87
87
 
88
+ &--wrap {
89
+ height: 100%;
90
+ }
91
+
88
92
  &--wrapper {
89
93
  max-width: var(--max-width);
90
94
 
@@ -86,19 +86,17 @@
86
86
 
87
87
  &--logo {
88
88
  display: block;
89
- max-width: 150px;
90
89
  width: 100%;
91
90
 
92
- @include breakpoint("large") {
93
- max-width: 200px;
94
- }
95
-
96
91
  &-link {
97
92
  display: block;
98
93
  padding: 16px 0;
94
+ max-width: 150px;
95
+ width: 100%;
99
96
 
100
97
  @include breakpoint("large") {
101
98
  padding: 0 0 24px;
99
+ max-width: 200px;
102
100
  }
103
101
  }
104
102
  }
@@ -3,199 +3,177 @@
3
3
  @import "../animations";
4
4
  @import "../mixins";
5
5
 
6
+ $row-1-lg: 64px;
7
+ $avatar-size-lg: $row-1-lg;
8
+
6
9
  .ilo--profile {
7
- max-width: 343px;
8
- position: relative;
10
+ $c: &;
11
+
12
+ display: grid;
13
+ grid-template-columns: min-content 1fr;
14
+ grid-template-rows: minmax($row-1-lg, auto) auto;
15
+ max-width: px-to-rem(343px);
16
+ width: 100%;
9
17
 
10
18
  &--avatar {
19
+ grid-row: 1;
11
20
  border-radius: 50%;
12
- float: left;
13
- width: px-to-rem(64px);
14
21
  }
15
22
 
16
- &--contents--light {
17
- .id {
18
- margin-left: px-to-rem(75px);
19
- padding-top: 5px;
20
-
21
- &:first-of-type {
22
- padding-bottom: 1px;
23
- }
24
-
25
- &:nth-of-type(2):last-of-type {
26
- padding-top: 0;
27
- }
28
- }
29
-
30
- .id:first-of-type:last-of-type,
31
- .id:nth-of-type(2):last-of-type {
32
- border-bottom: 2px solid $color-base-neutrals-lighter;
33
- padding-bottom: 11px;
34
- }
35
-
36
- .id:first-of-type:last-of-type {
37
- padding-top: 14px;
38
- }
23
+ figcaption {
24
+ box-sizing: border-box;
25
+ grid-row: 1;
26
+ grid-column-end: -1;
27
+ display: flex;
28
+ flex-flow: column;
29
+ justify-content: center;
30
+ align-items: start;
39
31
  }
40
32
 
41
- &--contents--dark {
42
- .id {
43
- margin-left: px-to-rem(75px);
44
- padding-top: 5px;
45
-
46
- &:first-of-type {
47
- padding-bottom: 1px;
48
- }
49
-
50
- &:nth-of-type(2):last-of-type {
51
- padding-top: 0;
52
- }
53
- }
54
-
55
- .id:first-of-type:last-of-type,
56
- .id:nth-of-type(2):last-of-type {
33
+ &--figcaption--content {
34
+ box-sizing: border-box;
35
+ width: 100%;
36
+ display: flex;
37
+ flex-flow: column;
38
+ justify-content: center;
39
+ align-items: start;
40
+ position: relative;
41
+
42
+ &:after {
43
+ content: "";
44
+ position: absolute;
45
+ bottom: -12px;
46
+ width: 100%;
57
47
  border-bottom: 2px solid $color-base-neutrals-lighter;
58
- padding-bottom: 11px;
59
- }
60
-
61
- .id:first-of-type:last-of-type {
62
- padding-top: 14px;
63
48
  }
64
49
  }
65
50
 
66
51
  &--name {
67
- display: block;
68
52
  font-family: $fonts-display;
69
- font-weight: map-get($type, "weights", "label");
70
- margin-left: 11px;
71
- @include font-styles("body-small");
72
53
  }
73
54
 
74
55
  &--role {
75
- display: block;
76
56
  font-family: $fonts-copy;
77
- margin-left: 11px;
78
- @include font-styles("body-xs");
79
57
  }
80
58
 
81
59
  &--description {
82
- clear: both;
83
60
  font-family: $fonts-copy;
84
- padding-top: 22px;
85
- @include font-styles("body-xs");
61
+ grid-row: 2;
62
+ grid-column: 1 / -1;
86
63
  }
87
64
 
88
65
  &--link {
89
- align-items: center;
90
- clear: both;
91
- color: map-get($color, "link", "text", "default");
92
- display: inline-flex;
66
+ $link: &;
67
+
93
68
  font-family: $fonts-display;
94
- font-weight: map-get($type, "weights", "section");
95
- height: px-to-rem(56px);
96
- text-decoration: none;
97
- @include font-styles("body-small");
69
+ grid-column: 1 / -1;
98
70
 
99
- span {
100
- align-items: center;
101
- background-position: calc(100% - 10px) center;
102
- background-repeat: no-repeat;
103
- background-size: 24px 24px;
104
- display: inline-flex;
105
- height: 24px;
106
- padding-right: 32px;
107
- @include dataurlicon("arrowright", $color-link-text-default);
71
+ a {
72
+ text-decoration: none;
73
+ color: map-get($color, "link", "text", "default");
74
+ display: inline-block;
108
75
  }
109
76
 
110
- &:visited {
111
- color: map-get($color, "link", "text", "visited");
77
+ &--label {
78
+ display: flex;
79
+ flex-flow: row nowrap;
80
+ align-items: center;
112
81
 
113
- span {
114
- @include dataurlicon("arrowright", $color-link-text-visited);
82
+ &:after {
83
+ position: relative;
84
+ bottom: px-to-rem(1px);
85
+ height: px-to-rem(24px);
86
+ width: px-to-rem(24px);
87
+ margin-inline-start: px-to-rem(8px);
88
+ content: "";
89
+ @include dataurlicon("arrowright", $color-link-text-default);
90
+
91
+ [dir="rtl"] & {
92
+ @include dataurlicon("arrowleft", $color-link-text-default);
93
+ }
115
94
  }
116
95
  }
117
96
 
118
- &:active {
119
- color: map-get($color, "link", "text", "active");
120
- outline: none;
121
-
122
- span {
123
- @include dataurlicon("arrowright", $color-link-text-active);
124
- background-color: map-get($color, "link", "background", "active");
125
- }
126
- }
97
+ a:hover,
98
+ a:focus {
99
+ #{$link}--label {
100
+ color: map-get($color, "link", "text", "hover");
101
+ outline: none;
127
102
 
128
- &:hover,
129
- &:focus {
130
- background-color: $color-base-blue-light;
131
- color: map-get($color, "link", "text", "hover");
132
- outline: none;
133
- @include globaltransition("color, background-color");
103
+ &:after {
104
+ @include dataurlicon("arrowright", $color-link-text-hover);
134
105
 
135
- span {
136
- @include dataurlicon("arrowright", $color-link-text-hover);
106
+ [dir="rtl"] & {
107
+ @include dataurlicon("arrowleft", $color-link-text-hover);
108
+ }
109
+ }
137
110
  }
138
111
  }
139
112
  }
140
113
 
141
- .ilo--profile--description + .ilo--profile--link {
142
- margin-top: px-to-rem(8px);
143
- }
114
+ &__theme {
115
+ &__dark {
116
+ color: $color-base-neutrals-lighter;
144
117
 
145
- .ilo--profile--role + .ilo--profile--link {
146
- margin-top: px-to-rem(2px);
147
- }
118
+ #{$c}--link {
119
+ &--label {
120
+ &:after {
121
+ @include dataurlicon("arrowright", $color-base-neutrals-lighter);
148
122
 
149
- .ilo--profile--name + .ilo--profile--link {
150
- margin-top: px-to-rem(18px);
151
- }
123
+ [dir="rtl"] & {
124
+ @include dataurlicon("arrowleft", $color-base-neutrals-lighter);
125
+ }
126
+ }
127
+ }
152
128
 
153
- .right-to-left & {
154
- direction: rtl;
129
+ a {
130
+ color: $color-base-neutrals-lighter;
131
+ }
155
132
 
156
- .ilo--profile--avatar {
157
- float: right;
158
- }
133
+ a:hover,
134
+ a:focus {
135
+ #{$c}--link--label {
136
+ color: $brand-ilo-turquoise;
137
+ outline: none;
159
138
 
160
- .ilo--profile--contents--light {
161
- .id {
162
- margin-left: auto;
163
- margin-right: px-to-rem(75px);
139
+ &:after {
140
+ @include dataurlicon("arrowright", $brand-ilo-turquoise);
141
+
142
+ [dir="rtl"] & {
143
+ @include dataurlicon("arrowleft", $brand-ilo-turquoise);
144
+ }
145
+ }
146
+ }
147
+ }
164
148
  }
165
149
  }
150
+ }
166
151
 
167
- .ilo--profile--contents--dark {
168
- .id {
169
- margin-left: auto;
170
- margin-right: px-to-rem(75px);
152
+ &__size {
153
+ &__large {
154
+ #{$c}--avatar {
155
+ width: px-to-rem($avatar-size-lg);
156
+ height: px-to-rem($avatar-size-lg);
157
+ margin-inline-end: px-to-rem(15px);
171
158
  }
172
- }
173
159
 
174
- .ilo--profile--link {
175
- span {
176
- background-position: 10px center;
177
- padding-left: 32px;
178
- padding-right: 0;
179
- @include dataurlicon("arrowleft", $color-link-text-default);
160
+ #{$c}--name {
161
+ font-weight: map-get($type, "weights", "label");
162
+ @include font-styles("body-small");
180
163
  }
181
164
 
182
- &:visited {
183
- span {
184
- @include dataurlicon("arrowleft", $color-link-text-visited);
185
- }
165
+ #{$c}--role {
166
+ @include font-styles("body-xs");
186
167
  }
187
168
 
188
- &:active {
189
- span {
190
- @include dataurlicon("arrowleft", $color-link-text-active);
191
- }
169
+ #{$c}--description {
170
+ @include font-styles("body-xs");
171
+ padding-block-start: px-to-rem(21px);
192
172
  }
193
173
 
194
- &:hover,
195
- &:focus {
196
- span {
197
- @include dataurlicon("arrowleft", $color-link-text-hover);
198
- }
174
+ #{$c}--link {
175
+ @include font-styles("body-small");
176
+ padding-block-start: px-to-rem(21px);
199
177
  }
200
178
  }
201
179
  }
@@ -37,7 +37,9 @@
37
37
 
38
38
  #{$self}--content {
39
39
  display: flex;
40
- flex-wrap: wrap;
40
+ flex-flow: column;
41
+ align-items: flex-start;
42
+ justify-content: flex-start;
41
43
  height: 100%;
42
44
 
43
45
  .right-to-left & {
@@ -67,9 +69,16 @@
67
69
  width: 100%;
68
70
  }
69
71
 
72
+ #{$self}--source {
73
+ display: flex;
74
+ flex: auto;
75
+ flex-flow: column;
76
+ justify-content: flex-end;
77
+ align-items: flex-start;
78
+ }
79
+
70
80
  .ilo--link {
71
81
  @include font-styles("image-credit");
72
- align-self: flex-end;
73
82
  }
74
83
  }
75
84
  }
@@ -156,7 +156,7 @@
156
156
  .ilo--tabs--selection {
157
157
  display: flex;
158
158
  max-width: 100%;
159
- overflow-x: scroll;
159
+ overflow-x: hidden;
160
160
  overflow-y: hidden;
161
161
 
162
162
  &--button {