@amsterdam/design-system-css 0.1.0

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.
@@ -0,0 +1,42 @@
1
+ @import "../../utils/calculate-fluid-style";
2
+
3
+ .amsterdam-heading {
4
+ break-after: avoid;
5
+ break-inside: avoid;
6
+ color: black;
7
+ font-weight: 800;
8
+ margin-block-end: 0;
9
+ margin-block-start: 0;
10
+ margin-inline-end: 0;
11
+ margin-inline-start: 0;
12
+ }
13
+
14
+ .amsterdam-heading-1 {
15
+ font-size: calculate-fluid-style(32, 80);
16
+ line-height: calculate-fluid-style(35, 80);
17
+ }
18
+
19
+ .amsterdam-heading-2 {
20
+ font-size: calculate-fluid-style(28, 56);
21
+ line-height: calculate-fluid-style(34, 62);
22
+ }
23
+
24
+ .amsterdam-heading-3 {
25
+ font-size: calculate-fluid-style(24, 40);
26
+ line-height: calculate-fluid-style(32, 48);
27
+ }
28
+
29
+ .amsterdam-heading-4 {
30
+ font-size: calculate-fluid-style(22, 32);
31
+ line-height: calculate-fluid-style(31, 38);
32
+ }
33
+
34
+ .amsterdam-heading-5 {
35
+ font-size: calculate-fluid-style(18, 24);
36
+ line-height: calculate-fluid-style(25, 31);
37
+ }
38
+
39
+ .amsterdam-heading-6 {
40
+ font-size: calculate-fluid-style(16, 18);
41
+ line-height: calculate-fluid-style(22, 23);
42
+ }
@@ -0,0 +1,34 @@
1
+ @import "../../utils/calculate-fluid-style";
2
+
3
+ .amsterdam-icon {
4
+ align-items: center;
5
+ display: inline-flex;
6
+
7
+ /* TODO: this height should be provided by the text element its part of? */
8
+ height: calculate-fluid-style(24, 26);
9
+
10
+ /* TODO: 12px is not part of the design system, what should this be? */
11
+ margin-inline-end: 12px;
12
+
13
+ /* Offset icon by 3px, because Amsterdam Sans vertical alignment is off */
14
+ padding-block-end: 3px;
15
+ }
16
+
17
+ .amsterdam-icon svg {
18
+ fill: currentColor;
19
+ }
20
+
21
+ .amsterdam-icon-small svg {
22
+ height: 1rem;
23
+ width: 1rem;
24
+ }
25
+
26
+ .amsterdam-icon-medium svg {
27
+ height: 1.5rem;
28
+ width: 1.5rem;
29
+ }
30
+
31
+ .amsterdam-icon-large svg {
32
+ height: 2rem;
33
+ width: 2rem;
34
+ }
@@ -0,0 +1,45 @@
1
+ @import "../../utils/calculate-fluid-style";
2
+
3
+ .amsterdam-link {
4
+ color: var(--amsterdam-color-primary-blue);
5
+ display: inline-flex;
6
+ font-size: calculate-fluid-style(18, 24);
7
+ font-weight: 800;
8
+ line-height: calculate-fluid-style(29, 38);
9
+ outline-offset: var(--amsterdam-focus-outline-offset);
10
+ text-decoration: none;
11
+ }
12
+
13
+ .amsterdam-link:focus,
14
+ .amsterdam-link:hover {
15
+ outline-offset: var(--amsterdam-focus-outline-offset);
16
+ text-decoration: underline;
17
+ }
18
+
19
+ .amsterdam-link-standalone {
20
+ box-shadow: inset 0 -2px var(--amsterdam-color-primary-blue);
21
+ font-weight: 400;
22
+ transition: box-shadow 100ms ease-in-out, color 100ms ease-in-out;
23
+ }
24
+
25
+ .amsterdam-link-standalone:focus,
26
+ .amsterdam-link-standalone:hover {
27
+ box-shadow: inset 0 -3px var(--amsterdam-color-primary-blue);
28
+ text-decoration: none;
29
+ }
30
+
31
+ .amsterdam-link-inline {
32
+ color: var(--amsterdam-color-primary-blue);
33
+ display: inline;
34
+ font-size: inherit;
35
+ font-weight: 400;
36
+ letter-spacing: inherit;
37
+ line-height: inherit;
38
+ }
39
+
40
+ .amsterdam-link-inlist {
41
+ font-size: calculate-fluid-style(16, 18);
42
+ font-weight: 400;
43
+ line-height: calculate-fluid-style(24, 26);
44
+ padding-block: 12px;
45
+ }
@@ -0,0 +1,5 @@
1
+ .amsterdam-list {
2
+ list-style: none;
3
+ margin-block: 0;
4
+ padding-inline: 0;
5
+ }
@@ -0,0 +1,17 @@
1
+ @import "../../utils/calculate-fluid-style";
2
+
3
+ .amsterdam-paragraph {
4
+ font-size: calculate-fluid-style(18, 24);
5
+ line-height: calculate-fluid-style(29, 38);
6
+ margin-block: 0;
7
+ }
8
+
9
+ .amsterdam-paragraph-intro {
10
+ font-size: calculate-fluid-style(22, 30);
11
+ line-height: calculate-fluid-style(35, 45);
12
+ }
13
+
14
+ .amsterdam-paragraph-small {
15
+ font-size: calculate-fluid-style(16, 18);
16
+ line-height: calculate-fluid-style(24, 29);
17
+ }
@@ -0,0 +1,60 @@
1
+ @import "../../utils/breakpoint";
2
+
3
+ $amsterdam-spaces: (
4
+ "xs": 8px,
5
+ "s": 16px,
6
+ "m": 24px,
7
+ "l": 40px,
8
+ "xl": 56px,
9
+ "xxl": 72px,
10
+ );
11
+ $amsterdam-spaces-large: (
12
+ "xs": 8px,
13
+ "s": 16px,
14
+ "m": 24px,
15
+ "l": 40px,
16
+ "xl": 80px,
17
+ "xxl": 120px,
18
+ );
19
+
20
+ /*
21
+ utility classes for spacing
22
+ TODO: currently using :nth-child(n) for higher specificity, find better way to solve this
23
+ */
24
+ @each $size, $value in $amsterdam-spaces {
25
+ .amsterdam-space-block-start-#{$size}:nth-child(n) {
26
+ margin-block-start: $value;
27
+ }
28
+ .amsterdam-space-block-end-#{$size}:nth-child(n) {
29
+ margin-block-end: $value;
30
+ }
31
+ .amsterdam-space-inline-start-#{$size}:nth-child(n) {
32
+ margin-inline-start: $value;
33
+ }
34
+ .amsterdam-space-inline-end-#{$size}:nth-child(n) {
35
+ margin-inline-end: $value;
36
+ }
37
+ }
38
+
39
+ @each $size, $value in $amsterdam-spaces-large {
40
+ .amsterdam-space-block-start-#{$size}--large:nth-child(n) {
41
+ @media (min-width: $amsterdam-breakpoint) {
42
+ margin-block-start: $value;
43
+ }
44
+ }
45
+ .amsterdam-space-block-end-#{$size}--large:nth-child(n) {
46
+ @media (min-width: $amsterdam-breakpoint) {
47
+ margin-block-end: $value;
48
+ }
49
+ }
50
+ .amsterdam-space-inline-start-#{$size}--large:nth-child(n) {
51
+ @media (min-width: $amsterdam-breakpoint) {
52
+ margin-inline-start: $value;
53
+ }
54
+ }
55
+ .amsterdam-space-inline-end-#{$size}--large:nth-child(n) {
56
+ @media (min-width: $amsterdam-breakpoint) {
57
+ margin-inline-end: $value;
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ The breakpoint is 820px / 16 = 51.25rems
3
+ https://developer.mozilla.org/en-US/docs/Web/CSS/@media#accessibility_concerns
4
+ */
5
+ $amsterdam-breakpoint: 51.25rem;
@@ -0,0 +1,17 @@
1
+ @use "sass:math";
2
+
3
+ @function calculate-fluid-style($minSizePx, $maxSizePx, $minScreenWidthPx: 320, $maxScreenWidthPx: 1920) {
4
+ $defaultBaseSize: 16;
5
+ $minSize: math.div($minSizePx, $defaultBaseSize) * 1rem;
6
+ $maxSize: math.div($maxSizePx, $defaultBaseSize) * 1rem;
7
+ $minScreenWidth: math.div($minScreenWidthPx, $defaultBaseSize) * 1rem;
8
+ $maxScreenWidth: math.div($maxScreenWidthPx, $defaultBaseSize) * 1rem;
9
+
10
+ @return clamp(
11
+ #{$minSize},
12
+ calc(
13
+ #{$minSize} + #{math.div($maxSize - $minSize, $maxScreenWidth - $minScreenWidth)} * (100vw - #{$minScreenWidth})
14
+ ),
15
+ #{$maxSize}
16
+ );
17
+ }