@coopdigital/styles 0.5.6 → 0.5.8

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  # Experience Kit for Styles
8
8
 
9
9
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
10
- [all_contributors_badge]: https://img.shields.io/badge/all_contributors-16-C08A00.svg ''
10
+ [all_contributors_badge]: https://img.shields.io/badge/all_contributors-17-C08A00.svg ''
11
11
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
12
12
 
13
13
  <a href="https://www.npmjs.com/package/@coopdigital/styles"><img src="https://img.shields.io/npm/v/%40coopdigital%2Fstyles?color=E85A00" alt="npm version" /></a>
@@ -113,19 +113,24 @@ Thanks goes to these wonderful people:
113
113
  <div><img src="https://secure.gravatar.com/avatar/faf90b70d749cf9460eb603fa1700add94fd7d3a32645b4be6fa12eb45c4ffa3?s=80&d=identicon" width="200px;" alt=""/></div>
114
114
  <small>Omid Kashan</small>
115
115
  <div><a href="#a11y-omid.kashan" title="Accessibility">️️️️♿️</a> <a href="#code-omid.kashan" title="Code">💻</a> <a href="#doc-omid.kashan" title="Documentation">📖</a> <a href="#test-omid.kashan" title="Tests">⚠️</a></div>
116
+ </a></td>
117
+ <td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/phil.wolstenholme">
118
+ <div><img src="https://gitlab.com/uploads/-/system/user/avatar/25900363/avatar.png" width="200px;" alt=""/></div>
119
+ <small>Phil Wolstenholme</small>
120
+ <div><a href="#a11y-phil.wolstenholme" title="Accessibility">️️️️♿️</a></div>
116
121
  </a></td>
117
122
  <td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/romain.chen">
118
123
  <div><img src="https://s3.eu-west-1.amazonaws.com/assets.digital.coop.co.uk/oneweb/blank.jpg" width="200px;" alt=""/></div>
119
124
  <small>Romain Chen</small>
120
125
  <div><a href="#design-romain.chen" title="Design">🎨</a></div>
121
126
  </a></td>
127
+ </tr><br />
128
+ <tr>
122
129
  <td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/sam.harden">
123
130
  <div><img src="https://ca.slack-edge.com/T0C9E3ZF0-U03NT7D39L6-2fc82e7f7c6e-150" width="200px;" alt=""/></div>
124
131
  <small>Sam Harden</small>
125
132
  <div><a href="#a11y-sam.harden" title="Accessibility">️️️️♿️</a> <a href="#code-sam.harden" title="Code">💻</a> <a href="#doc-sam.harden" title="Documentation">📖</a> <a href="#test-sam.harden" title="Tests">⚠️</a></div>
126
133
  </a></td>
127
- </tr><br />
128
- <tr>
129
134
  <td align="center" valign="top" width="14.28%"><a href="">
130
135
  <div><img src="https://s3.eu-west-1.amazonaws.com/assets.digital.coop.co.uk/oneweb/blank.jpg" width="200px;" alt=""/></div>
131
136
  <small>Shweta Jaju</small>
@@ -15,7 +15,7 @@
15
15
  color: var(--text-color);
16
16
  background-color: var(--bg-color);
17
17
  }
18
- .coop-alert-banner--inner h3,
18
+ .coop-alert-banner--inner h2,
19
19
  .coop-alert-banner--inner p {
20
20
  margin: 0 0 var(--spacing-8) 0;
21
21
  }
@@ -26,7 +26,7 @@
26
26
  color: inherit;
27
27
  text-decoration: none;
28
28
  }
29
- .coop-alert-banner--inner h3 {
29
+ .coop-alert-banner--inner h2 {
30
30
  font-size: var(--type-size-22);
31
31
  font-weight: 500;
32
32
  }
@@ -0,0 +1,69 @@
1
+ .coop-editorial-card {
2
+ --flex-direction: column;
3
+ --image-max-width: 100%;
4
+ --image-border-radius: var(--ui-border-radius-m) var(--ui-border-radius-m) 0 0;
5
+ display: flex;
6
+ position: relative;
7
+ flex-direction: var(--flex-direction);
8
+ border-radius: var(--ui-border-radius-m);
9
+ box-shadow: var(--ui-shadow);
10
+ transition: box-shadow var(--ui-transition-hover);
11
+ }
12
+ @media (min-width: 48em) {
13
+ .coop-editorial-card[data-layout=horizontal] {
14
+ --flex-direction: row;
15
+ --image-max-width: calc(100% / 3);
16
+ --image-border-radius: var(--ui-border-radius-m) 0 0 var(--ui-border-radius-m);
17
+ }
18
+ }
19
+ .coop-editorial-card:hover, .coop-editorial-card:focus {
20
+ box-shadow: var(--ui-shadow-hover);
21
+ }
22
+ .coop-editorial-card h2,
23
+ .coop-editorial-card h3,
24
+ .coop-editorial-card h4,
25
+ .coop-editorial-card h5,
26
+ .coop-editorial-card h6 {
27
+ margin: 0;
28
+ font-size: var(--type-size-20);
29
+ font-weight: var(--type-weight-demibold);
30
+ }
31
+ .coop-editorial-card picture {
32
+ overflow: hidden;
33
+ max-width: var(--image-max-width);
34
+ margin: 0;
35
+ border-radius: var(--image-border-radius);
36
+ }
37
+ .coop-editorial-card img {
38
+ width: 100%;
39
+ height: 100%;
40
+ }
41
+ .coop-editorial-card p {
42
+ margin: 0;
43
+ }
44
+ .coop-editorial-card a {
45
+ color: inherit;
46
+ text-decoration: none;
47
+ outline: 0;
48
+ }
49
+ .coop-editorial-card a::before {
50
+ content: "";
51
+ position: absolute;
52
+ inset: 0 0 0 0;
53
+ border-radius: var(--ui-border-radius-m);
54
+ }
55
+ .coop-editorial-card a:focus-within::before {
56
+ outline: 2px solid var(--color-focus-ring);
57
+ outline-offset: 3px;
58
+ }
59
+ .coop-editorial-card a:hover h3, .coop-editorial-card a:focus h3 {
60
+ text-decoration: underline;
61
+ }
62
+ .coop-editorial-card--content {
63
+ display: flex;
64
+ flex-direction: column;
65
+ gap: var(--spacing-12);
66
+ padding: var(--spacing-20);
67
+ border-radius: var(--ui-border-radius-m);
68
+ background: var(--color-white);
69
+ }
package/dist/main.css CHANGED
@@ -110,7 +110,7 @@
110
110
 
111
111
  :root {
112
112
  --ui-shadow: 0 2px 4px 0 rgb(0 0 0 / 15%);
113
- --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 35%);
113
+ --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 25%);
114
114
  --ui-transition-hover: 0.1s ease-out;
115
115
  --ui-transition-hover-property: background-color, color;
116
116
  --ui-border-radius: 4px;
@@ -139,6 +139,10 @@
139
139
  :root {
140
140
  --font-family: "Avenir-Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
141
141
  --font-family-headline: "Co-opHeadline", "Impact", Helvetica, Arial, sans-serif;
142
+ /* Weights */
143
+ --type-weight-default: normal;
144
+ --type-weight-medium: 500;
145
+ --type-weight-demibold: 600;
142
146
  /* Typography Sizes */
143
147
  --type-size-10: 0.625rem;
144
148
  --type-size-12: 0.75rem;
@@ -158,6 +162,7 @@
158
162
  --type-size-56: 3.5rem;
159
163
  --type-size-64: 4rem;
160
164
  --type-size-82: 5.125rem;
165
+ --type-size-default: var(--type-size-16);
161
166
  /* Typography Line Height */
162
167
  --type-line-height-default: 1.5;
163
168
  --type-line-height-tight: 1.25;
@@ -233,13 +238,6 @@ label {
233
238
  line-height: 1.1;
234
239
  }
235
240
 
236
- h1,
237
- h2,
238
- h3,
239
- h4 {
240
- text-wrap: balance;
241
- }
242
-
243
241
  a:not([class]) {
244
242
  text-decoration-skip-ink: auto;
245
243
  }
@@ -249,6 +247,18 @@ picture {
249
247
  display: block;
250
248
  max-width: 100%;
251
249
  }
250
+ img[data-crop],
251
+ picture[data-crop] {
252
+ object-fit: cover;
253
+ }
254
+ img[data-crop=square],
255
+ picture[data-crop=square] {
256
+ aspect-ratio: 1/1;
257
+ }
258
+ img[data-crop=wide],
259
+ picture[data-crop=wide] {
260
+ aspect-ratio: 16/9;
261
+ }
252
262
 
253
263
  :target {
254
264
  scroll-margin-block: 5ex;
package/dist/reset.css CHANGED
@@ -67,13 +67,6 @@ label {
67
67
  line-height: 1.1;
68
68
  }
69
69
 
70
- h1,
71
- h2,
72
- h3,
73
- h4 {
74
- text-wrap: balance;
75
- }
76
-
77
70
  a:not([class]) {
78
71
  text-decoration-skip-ink: auto;
79
72
  }
@@ -83,6 +76,18 @@ picture {
83
76
  display: block;
84
77
  max-width: 100%;
85
78
  }
79
+ img[data-crop],
80
+ picture[data-crop] {
81
+ object-fit: cover;
82
+ }
83
+ img[data-crop=square],
84
+ picture[data-crop=square] {
85
+ aspect-ratio: 1/1;
86
+ }
87
+ img[data-crop=wide],
88
+ picture[data-crop=wide] {
89
+ aspect-ratio: 16/9;
90
+ }
86
91
 
87
92
  :target {
88
93
  scroll-margin-block: 5ex;
package/dist/vars.css CHANGED
@@ -109,7 +109,7 @@
109
109
 
110
110
  :root {
111
111
  --ui-shadow: 0 2px 4px 0 rgb(0 0 0 / 15%);
112
- --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 35%);
112
+ --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 25%);
113
113
  --ui-transition-hover: 0.1s ease-out;
114
114
  --ui-transition-hover-property: background-color, color;
115
115
  --ui-border-radius: 4px;
@@ -138,6 +138,10 @@
138
138
  :root {
139
139
  --font-family: "Avenir-Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
140
140
  --font-family-headline: "Co-opHeadline", "Impact", Helvetica, Arial, sans-serif;
141
+ /* Weights */
142
+ --type-weight-default: normal;
143
+ --type-weight-medium: 500;
144
+ --type-weight-demibold: 600;
141
145
  /* Typography Sizes */
142
146
  --type-size-10: 0.625rem;
143
147
  --type-size-12: 0.75rem;
@@ -157,6 +161,7 @@
157
161
  --type-size-56: 3.5rem;
158
162
  --type-size-64: 4rem;
159
163
  --type-size-82: 5.125rem;
164
+ --type-size-default: var(--type-size-16);
160
165
  /* Typography Line Height */
161
166
  --type-line-height-default: 1.5;
162
167
  --type-line-height-tight: 1.25;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/styles",
3
3
  "type": "module",
4
- "version": "0.5.6",
4
+ "version": "0.5.8",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -29,7 +29,7 @@
29
29
  "description": "",
30
30
  "devDependencies": {
31
31
  "glob": "^11.0.1",
32
- "sass-embedded": "^1.85.1"
32
+ "sass-embedded": "^1.86.0"
33
33
  },
34
- "gitHead": "a275fea237a8e1f918e9fd4bd0f18ba114e7ab34"
34
+ "gitHead": "60cbbc73c648be7d728d36a700bcf2761579548f"
35
35
  }
@@ -18,7 +18,7 @@
18
18
  color: var(--text-color);
19
19
  background-color: var(--bg-color);
20
20
 
21
- h3,
21
+ h2,
22
22
  p {
23
23
  margin: 0 0 var(--spacing-8) 0;
24
24
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
  }
34
34
 
35
- h3 {
35
+ h2 {
36
36
  font-size: var(--type-size-22);
37
37
  font-weight: 500;
38
38
  }
@@ -0,0 +1,91 @@
1
+ @use "../breakpoints.scss" as *;
2
+
3
+ .coop-editorial-card {
4
+ --flex-direction: column;
5
+ --image-max-width: 100%;
6
+ --image-border-radius: var(--ui-border-radius-m) var(--ui-border-radius-m) 0 0;
7
+
8
+ display: flex;
9
+ position: relative;
10
+ flex-direction: var(--flex-direction);
11
+ border-radius: var(--ui-border-radius-m);
12
+ box-shadow: var(--ui-shadow);
13
+ transition: box-shadow var(--ui-transition-hover);
14
+
15
+ &[data-layout="horizontal"] {
16
+ @media (min-width: $mq-medium) {
17
+ --flex-direction: row;
18
+ --image-max-width: calc(100% / 3);
19
+ --image-border-radius: var(--ui-border-radius-m) 0 0 var(--ui-border-radius-m);
20
+ }
21
+ }
22
+
23
+ &:hover,
24
+ &:focus {
25
+ box-shadow: var(--ui-shadow-hover);
26
+ }
27
+
28
+ h2,
29
+ h3,
30
+ h4,
31
+ h5,
32
+ h6 {
33
+ margin: 0;
34
+ font-size: var(--type-size-20);
35
+ font-weight: var(--type-weight-demibold);
36
+ }
37
+
38
+ picture {
39
+ overflow: hidden;
40
+ max-width: var(--image-max-width);
41
+ margin: 0;
42
+ border-radius: var(--image-border-radius);
43
+ }
44
+
45
+ img {
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+
50
+ p {
51
+ margin: 0;
52
+ }
53
+
54
+ a {
55
+ color: inherit;
56
+ text-decoration: none;
57
+ outline: 0;
58
+
59
+ &::before {
60
+ content: "";
61
+
62
+ position: absolute;
63
+ inset: 0 0 0 0;
64
+
65
+ border-radius: var(--ui-border-radius-m);
66
+ }
67
+
68
+ &:focus-within::before {
69
+ outline: 2px solid var(--color-focus-ring);
70
+ outline-offset: 3px;
71
+ }
72
+
73
+ &:hover,
74
+ &:focus {
75
+ h3 {
76
+ text-decoration: underline;
77
+ }
78
+ }
79
+ }
80
+
81
+ &--content {
82
+ display: flex;
83
+ flex-direction: column;
84
+ gap: var(--spacing-12);
85
+
86
+ padding: var(--spacing-20);
87
+ border-radius: var(--ui-border-radius-m);
88
+
89
+ background: var(--color-white);
90
+ }
91
+ }
package/src/reset.scss CHANGED
@@ -68,13 +68,6 @@ label {
68
68
  line-height: 1.1;
69
69
  }
70
70
 
71
- h1,
72
- h2,
73
- h3,
74
- h4 {
75
- text-wrap: balance;
76
- }
77
-
78
71
  a:not([class]) {
79
72
  text-decoration-skip-ink: auto;
80
73
  }
@@ -83,6 +76,18 @@ img,
83
76
  picture {
84
77
  display: block;
85
78
  max-width: 100%;
79
+
80
+ &[data-crop] {
81
+ object-fit: cover;
82
+ }
83
+
84
+ &[data-crop="square"] {
85
+ aspect-ratio: 1 / 1;
86
+ }
87
+
88
+ &[data-crop="wide"] {
89
+ aspect-ratio: 16 / 9;
90
+ }
86
91
  }
87
92
 
88
93
  :target {
@@ -2,6 +2,11 @@
2
2
  --font-family: "Avenir-Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
3
3
  --font-family-headline: "Co-opHeadline", "Impact", Helvetica, Arial, sans-serif;
4
4
 
5
+ /* Weights */
6
+ --type-weight-default: normal;
7
+ --type-weight-medium: 500;
8
+ --type-weight-demibold: 600;
9
+
5
10
  /* Typography Sizes */
6
11
  --type-size-10: 0.625rem;
7
12
  --type-size-12: 0.75rem;
@@ -26,6 +31,8 @@
26
31
 
27
32
  --type-size-82: 5.125rem;
28
33
 
34
+ --type-size-default: var(--type-size-16);
35
+
29
36
  /* Typography Line Height */
30
37
  --type-line-height-default: 1.5;
31
38
  --type-line-height-tight: 1.25;
package/src/vars/_ui.scss CHANGED
@@ -1,6 +1,6 @@
1
1
  :root {
2
2
  --ui-shadow: 0 2px 4px 0 rgb(0 0 0 / 15%);
3
- --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 35%);
3
+ --ui-shadow-hover: 0 2px 4px 0 rgb(0 0 0 / 25%);
4
4
  --ui-transition-hover: 0.1s ease-out;
5
5
  --ui-transition-hover-property: background-color, color;
6
6