@apolitical/component-library 1.18.8 → 2.0.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.
- package/communities/join-button/join-button.d.ts +1 -1
- package/context/user/index.d.ts +1 -1
- package/discussion/components/likes/likes.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +7 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +6 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +8 -0
- package/form/components/email-helper-text-box/email-helper-text-box.d.ts +1 -1
- package/form/components/form/components/field-wrapper/field-wrapper.d.ts +3 -0
- package/form/components/form/components/field-wrapper/index.d.ts +1 -0
- package/form/components/form/components/fields/checkbox/checkbox.d.ts +31 -0
- package/form/components/form/components/fields/checkbox/index.d.ts +1 -0
- package/form/components/form/components/fields/dropdown-menu/components/index.d.ts +1 -0
- package/form/components/form/components/fields/dropdown-menu/components/rotating-chevron/index.d.ts +1 -0
- package/form/components/form/components/fields/dropdown-menu/components/rotating-chevron/rotating-chevron.d.ts +6 -0
- package/form/components/form/components/fields/dropdown-menu/dropdown-menu.d.ts +3 -0
- package/form/components/form/components/fields/dropdown-menu/index.d.ts +1 -0
- package/form/components/form/components/fields/index.d.ts +5 -0
- package/form/components/form/components/fields/input/index.d.ts +1 -0
- package/form/components/form/components/fields/input/input.d.ts +39 -0
- package/form/components/form/components/fields/multiple-options/index.d.ts +1 -0
- package/form/components/form/components/fields/multiple-options/multiple-options.d.ts +3 -0
- package/form/components/form/components/fields/password/index.d.ts +1 -0
- package/form/components/form/components/fields/password/password.d.ts +3 -0
- package/form/components/form/components/index.d.ts +2 -0
- package/form/components/form/form.d.ts +3 -0
- package/form/components/form/form.mocks.d.ts +18 -0
- package/form/components/form/form.reducer.d.ts +3 -0
- package/form/components/form/form.types.d.ts +189 -0
- package/form/components/form/index.d.ts +1 -0
- package/form/components/index.d.ts +1 -0
- package/form/components/password-rules/password-rules.d.ts +1 -1
- package/form/components/rating/rating.d.ts +1 -1
- package/form/types/contact-form/contact-form.d.ts +12 -0
- package/form/types/contact-form/index.d.ts +1 -0
- package/form/types/index.d.ts +3 -1
- package/form/types/signup-form/components/index.d.ts +1 -0
- package/form/types/signup-form/components/success-message.d.ts +4 -0
- package/form/types/signup-form/index.d.ts +1 -0
- package/form/types/signup-form/signup-form.d.ts +25 -0
- package/form/types/signup-form/signup-form.helpers.d.ts +41 -0
- package/form/types/signup-form/signup-form.helpers.get-fields.d.ts +56 -0
- package/general/buttons/button/button.d.ts +1 -1
- package/helpers/in-development.d.ts +1 -0
- package/helpers/index.d.ts +4 -3
- package/index.js +34 -15
- package/index.mjs +5422 -2940
- package/layout/content-layout/contact-footer/contact-footer.d.ts +5 -0
- package/layout/content-layout/contact-footer/index.d.ts +1 -0
- package/layout/content-layout/index.d.ts +1 -0
- package/mappers/index.d.ts +1 -1
- package/mappers/{mapGetSteamData.d.ts → map-get-steam-data.d.ts} +1 -1
- package/modals/index.d.ts +1 -1
- package/navigation/filters/filters.d.ts +1 -1
- package/navigation/more-menu/more-menu.d.ts +1 -1
- package/package.json +2 -1
- package/sections/full-width-section/full-width-section.d.ts +2 -0
- package/sections/logo-section/logo-section.d.ts +1 -1
- package/style.css +1 -1
- package/styles/README.md +28 -0
- package/styles/base/_accessibility.scss +21 -11
- package/styles/base/_blockquotes.scss +31 -20
- package/styles/base/_fonts.scss +10 -6
- package/styles/base/_hr.scss +9 -8
- package/styles/base/_index.scss +2 -13
- package/styles/base/_layout.scss +5 -4
- package/styles/base/_links.scss +11 -13
- package/styles/base/_lists.scss +26 -13
- package/styles/base/_overlays.scss +34 -32
- package/styles/base/_table.scss +40 -27
- package/styles/base/_text.scss +128 -63
- package/styles/base/_titles.scss +192 -114
- package/styles/base/buttons/_button-wrapper.scss +23 -18
- package/styles/base/buttons/_buttons.scss +246 -169
- package/styles/base/buttons/_icons.scss +26 -26
- package/styles/base/buttons/_index.scss +1 -2
- package/styles/base/buttons/_mixins.scss +9 -3
- package/styles/base/buttons/_sizes.scss +47 -8
- package/styles/base/form/_fields.scss +50 -41
- package/styles/base/form/_form.scss +26 -0
- package/styles/base/form/_index.scss +1 -2
- package/styles/base/form/_labels.scss +12 -0
- package/styles/base/form/_search-button.scss +17 -17
- package/styles/functions/_index.scss +1 -1
- package/styles/functions/_maps.scss +25 -0
- package/styles/functions/_size-conversions.scss +3 -3
- package/styles/index.scss +3 -5
- package/styles/mixins/_animations.scss +1 -1
- package/styles/mixins/_backgrounds.scss +8 -2
- package/styles/mixins/_breakpoints.scss +1 -1
- package/styles/mixins/_browsers.scss +4 -2
- package/styles/mixins/_containers.scss +0 -1
- package/styles/mixins/_index.scss +2 -8
- package/styles/mixins/_queries.scss +11 -0
- package/styles/mixins/_selectors.scss +1 -1
- package/styles/mixins/_styles.scss +23 -21
- package/styles/mixins/_transitions.scss +19 -15
- package/styles/reset/_index.scss +1 -1
- package/styles/reset/_reset.scss +104 -20
- package/styles/variables/_index.scss +1 -3
- package/styles/variables/assets/_assets.scss +0 -1
- package/styles/variables/assets/_index.scss +1 -1
- package/styles/variables/colors/_colors.scss +53 -53
- package/styles/variables/colors/_index.scss +1 -1
- package/styles/variables/colors/theme/_banners.scss +26 -0
- package/styles/variables/colors/theme/_base.scss +88 -0
- package/styles/variables/colors/theme/_cards.scss +24 -0
- package/styles/variables/colors/theme/_communities.scss +7 -0
- package/styles/variables/colors/theme/_discussion.scss +20 -0
- package/styles/variables/colors/theme/_form.scss +25 -0
- package/styles/variables/colors/theme/_general.scss +9 -0
- package/styles/variables/colors/theme/_index.scss +8 -0
- package/styles/variables/colors/theme/_layout.scss +50 -0
- package/styles/variables/colors/theme/_loaders.scss +20 -0
- package/styles/variables/colors/theme/_modals.scss +14 -0
- package/styles/variables/colors/theme/_navigation.scss +41 -0
- package/styles/variables/colors/theme/_pages.scss +9 -0
- package/styles/variables/colors/theme/_text.scss +47 -0
- package/styles/variables/colors/theme/_user.scss +16 -0
- package/styles/variables/sizes/_common.scss +1 -1
- package/styles/variables/sizes/_index.scss +1 -1
- package/text/helper-text-box/helper-text-box.d.ts +1 -1
- package/text/hide-show-text-box/hide-show-text-box.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/styles/variables/colors/_theme.scss +0 -312
package/styles/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Styles
|
|
2
2
|
|
|
3
|
+
- [`@layer](#layer)
|
|
4
|
+
- [Colour variables](#colour-variables)
|
|
5
|
+
- [`button` styling](#button-styling)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
3
9
|
## `@layer`
|
|
4
10
|
|
|
5
11
|
We're using [CSS cascade layers (`@layer`)](https://www.smashingmagazine.com/2022/01/introduction-css-cascade-layers/) to organise our styles, to help us avoid specificity issues and to make it easier to find and update styles.
|
|
@@ -8,6 +14,28 @@ The `public/styles/index.scss` file defines the order of our layers, with the br
|
|
|
8
14
|
|
|
9
15
|
If you need to overwrite CSS, you don't need to create an overly specific (and less performant) rule or add an `!important` (as an aside: please, please [never add an `!important`](https://dev.to/alvaromontoro/using-important-in-css-75c)) - just put the styling in a higher layer.
|
|
10
16
|
|
|
17
|
+
The only 'gotcha' with this is importing external CSS; any styling that _isn't_ in a CSS layer is considered more important than styling in CSS layers, so styling from an external package will overwrite our styling. To change this, we need to write any styling that needs to overwrite external styling outside of CSS layers. (See the `InviteForm` component for an example.)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Colour variables
|
|
22
|
+
|
|
23
|
+
Our colour variables are defined in `public/styles/variables/colors`.
|
|
24
|
+
|
|
25
|
+
We have two separate files:
|
|
26
|
+
|
|
27
|
+
- `colors.scss` defines the colours themselves, using the names as they're defined in Figma, like `b700`. **We never call these values directly in the code.**
|
|
28
|
+
|
|
29
|
+
Because the colours are described as colours (`b700`), rather than by what they're used for (`link_hover`), we can't rely on these names. In a future redesign, the links might become pale pink - at which point `b700` would no longer make sense, and would make the code hard to read and reason about. We also can't guarantee that everything which used to be `b700` is now pink in the redesign - some things may become yellow or green instead.
|
|
30
|
+
|
|
31
|
+
We can't rely on these colours making sense in the future, so we don't use them directly in the code.
|
|
32
|
+
|
|
33
|
+
- `theme/index.scss` defines a `$theme` map which describes where the colours are used, rather than what the colours look like, e.g. `card_bg` for the default background colour of cards and `card_hover_bg` for the background colour cards should change to on hover.
|
|
34
|
+
|
|
35
|
+
Using these names, rather than the direct colour values, future-proofs the code against redesigns and makes it easy to maintain; when we redesign the platform, we can update the colours in one place, rather than having to amend every component.
|
|
36
|
+
|
|
37
|
+
To avoid `theme` being a giant, difficult-to-navigate file, we split out all the values by the component directory they're in (e.g. `base`, `buttons`, `cards`, etc.) and then import them into `theme/index.scss`. We use a Sass function to pull everything into the `$theme` variable, so we don't need to know exactly what's in each file.
|
|
38
|
+
|
|
11
39
|
---
|
|
12
40
|
|
|
13
41
|
## `button` styling
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../functions',
|
|
3
|
-
'./../mixins',
|
|
4
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../mixins', './../variables';
|
|
5
2
|
|
|
6
3
|
@layer base {
|
|
7
|
-
a,
|
|
8
|
-
|
|
4
|
+
a,
|
|
5
|
+
button,
|
|
6
|
+
input,
|
|
7
|
+
textarea,
|
|
8
|
+
[role='menu'],
|
|
9
|
+
li[tabindex] {
|
|
10
|
+
&:focus,
|
|
11
|
+
&:focus-visible {
|
|
9
12
|
outline: none;
|
|
10
|
-
box-shadow: $outline map
|
|
13
|
+
box-shadow: $outline get-map($theme, 'default_focus');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:active {
|
|
17
|
+
box-shadow: none;
|
|
11
18
|
}
|
|
12
|
-
&:active { box-shadow: none; }
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
[role=
|
|
16
|
-
|
|
21
|
+
[role='menu'],
|
|
22
|
+
[role='menu'] a,
|
|
23
|
+
li[tabindex] {
|
|
24
|
+
&:focus,
|
|
25
|
+
&:focus-visible {
|
|
26
|
+
box-shadow: $outline get-map($theme, 'default_focus') inset;
|
|
27
|
+
}
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
.hidden {
|
|
@@ -23,4 +34,3 @@
|
|
|
23
34
|
overflow: hidden;
|
|
24
35
|
}
|
|
25
36
|
}
|
|
26
|
-
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../functions',
|
|
3
|
-
'./../mixins',
|
|
4
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../mixins', './../variables';
|
|
5
2
|
|
|
6
|
-
$blockquote: (
|
|
3
|
+
$blockquote: (
|
|
4
|
+
'margin-top': 20,
|
|
5
|
+
'margin-top_md': 30,
|
|
6
|
+
'margin-bottom': 10,
|
|
7
|
+
'margin-bottom_md': 20,
|
|
8
|
+
'padding-vertical': 4,
|
|
9
|
+
'padding-left': 24,
|
|
10
|
+
'font-size': 18,
|
|
11
|
+
'font-size_md': 20,
|
|
12
|
+
'line-height': 28,
|
|
13
|
+
'border-width': 6,
|
|
14
|
+
);
|
|
7
15
|
|
|
8
16
|
@layer base {
|
|
9
17
|
blockquote {
|
|
10
|
-
margin: px-to-rem(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
margin: px-to-rem(get-map($blockquote, 'margin-top')) 0
|
|
19
|
+
px-to-rem(get-map($blockquote, 'margin-bottom')) 0;
|
|
20
|
+
padding: px-to-rem(get-map($blockquote, 'padding-vertical')) 0 0
|
|
21
|
+
px-to-rem(get-map($blockquote, 'padding-left'));
|
|
22
|
+
font-size: px-to-rem(get-map($blockquote, 'font-size'));
|
|
23
|
+
color: get-map($theme, 'blockquote');
|
|
14
24
|
font-weight: 700;
|
|
15
25
|
font-style: italic;
|
|
16
|
-
line-height: px-to-rem(map
|
|
17
|
-
border-left: px-to-rem(map
|
|
26
|
+
line-height: px-to-rem(get-map($blockquote, 'line-height'));
|
|
27
|
+
border-left: px-to-rem(get-map($blockquote, 'border-width')) solid
|
|
28
|
+
get-map($theme, 'blockquote_border');
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
p:last-of-type {
|
|
31
|
+
margin-bottom: 0;
|
|
32
|
+
}
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
@include breakpoint('min-width', 'md') {
|
|
35
|
+
margin-top: px-to-rem(get-map($blockquote, 'margin-top_md'));
|
|
36
|
+
margin-bottom: px-to-rem(get-map($blockquote, 'margin-bottom_md'));
|
|
37
|
+
font-size: px-to-rem(get-map($blockquote, 'font-size_md'));
|
|
38
|
+
}
|
|
28
39
|
}
|
|
29
|
-
}
|
|
40
|
+
}
|
package/styles/base/_fonts.scss
CHANGED
|
@@ -26,16 +26,20 @@ $font-name: 'Moderat';
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
$font-family: (400, normal), (400, italic), (600, normal), (600, italic), (900, normal),
|
|
30
|
-
|
|
29
|
+
$font-family: (400, normal), (400, italic), (600, normal), (600, italic), (900, normal),
|
|
30
|
+
(900, italic);
|
|
31
31
|
|
|
32
32
|
@layer base {
|
|
33
33
|
@each $weight, $style in $font-family {
|
|
34
34
|
@include font-styling($weight, $style);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
body,
|
|
38
|
-
|
|
37
|
+
body,
|
|
38
|
+
button,
|
|
39
|
+
input,
|
|
40
|
+
textarea {
|
|
41
|
+
font-family:
|
|
42
|
+
#{$font-name},
|
|
43
|
+
sans-serif;
|
|
39
44
|
}
|
|
40
|
-
|
|
41
|
-
}
|
|
45
|
+
}
|
package/styles/base/_hr.scss
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../functions',
|
|
3
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../variables';
|
|
4
2
|
|
|
5
|
-
$hr: (
|
|
3
|
+
$hr: (
|
|
4
|
+
'height': 1,
|
|
5
|
+
'margin-vertical': 40,
|
|
6
|
+
);
|
|
6
7
|
|
|
7
8
|
@layer base {
|
|
8
9
|
hr {
|
|
9
10
|
width: 100%;
|
|
10
|
-
height: px-to-rem(map
|
|
11
|
-
background: map
|
|
12
|
-
margin: px-to-rem(map
|
|
11
|
+
height: px-to-rem(get-map($hr, 'height'));
|
|
12
|
+
background: get-map($theme, 'divider');
|
|
13
|
+
margin: px-to-rem(get-map($hr, 'margin-vertical')) auto;
|
|
13
14
|
border: none;
|
|
14
15
|
display: block;
|
|
15
16
|
}
|
|
16
|
-
}
|
|
17
|
+
}
|
package/styles/base/_index.scss
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
@import 'fonts',
|
|
2
|
-
|
|
3
|
-
'blockquotes',
|
|
4
|
-
'buttons',
|
|
5
|
-
'form',
|
|
6
|
-
'hr',
|
|
7
|
-
'layout',
|
|
8
|
-
'links',
|
|
9
|
-
'lists',
|
|
10
|
-
'overlays',
|
|
11
|
-
'table',
|
|
12
|
-
'text',
|
|
13
|
-
'titles';
|
|
1
|
+
@import 'fonts', 'accessibility', 'blockquotes', 'buttons', 'form', 'hr', 'layout',
|
|
2
|
+
'links', 'lists', 'overlays', 'table', 'text', 'titles';
|
package/styles/base/_layout.scss
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
@import './../functions',
|
|
2
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../variables';
|
|
3
2
|
|
|
4
3
|
@layer base {
|
|
5
|
-
[hidden] {
|
|
4
|
+
[hidden] {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
6
7
|
|
|
7
8
|
.content-slim {
|
|
8
9
|
max-width: px-to-rem($content-slim-width);
|
|
9
10
|
margin-left: auto;
|
|
10
11
|
margin-right: auto;
|
|
11
12
|
}
|
|
12
|
-
}
|
|
13
|
+
}
|
package/styles/base/_links.scss
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../mixins',
|
|
3
|
-
'./../variables';
|
|
1
|
+
@import './../mixins', './../variables';
|
|
4
2
|
|
|
5
3
|
@layer base {
|
|
6
4
|
a {
|
|
7
|
-
|
|
5
|
+
@include transition(color text-decoration-color);
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
color: get-map($theme, 'link');
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
font-weight: 900;
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
&:hover,
|
|
12
|
+
&:focus,
|
|
13
|
+
&:active {
|
|
14
|
+
color: get-map($theme, 'link_hover');
|
|
15
|
+
}
|
|
18
16
|
}
|
|
19
|
-
}
|
|
17
|
+
}
|
package/styles/base/_lists.scss
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@import './../functions';
|
|
3
2
|
|
|
4
|
-
$ul: (
|
|
5
|
-
|
|
3
|
+
$ul: (
|
|
4
|
+
'margin-bottom': 16,
|
|
5
|
+
'padding-left': 40,
|
|
6
|
+
);
|
|
7
|
+
$li: (
|
|
8
|
+
'margin-bottom': 18,
|
|
9
|
+
'margin-bottom_sm': 12,
|
|
10
|
+
'margin-bottom_md': 16,
|
|
11
|
+
);
|
|
6
12
|
|
|
7
13
|
@layer base {
|
|
8
|
-
ol,
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
ol,
|
|
15
|
+
ul {
|
|
16
|
+
margin: 0 0 px-to-rem(get-map($ul, 'margin-bottom')) 0;
|
|
17
|
+
padding-left: px-to-rem(get-map($ul, 'padding-left'));
|
|
11
18
|
display: block;
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
li {
|
|
15
|
-
margin-bottom: px-to-rem(map
|
|
22
|
+
margin-bottom: px-to-rem(get-map($li, 'margin-bottom'));
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
.text-small & {
|
|
25
|
+
margin-bottom: px-to-rem(get-map($li, 'margin-bottom_sm'));
|
|
26
|
+
}
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
.text-medium & {
|
|
29
|
+
margin-bottom: px-to-rem(get-map($li, 'margin-bottom_md'));
|
|
30
|
+
}
|
|
20
31
|
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
&:last-child {
|
|
33
|
+
margin-bottom: 0;
|
|
23
34
|
|
|
24
|
-
|
|
35
|
+
p:last-child {
|
|
36
|
+
margin-bottom: 0;
|
|
25
37
|
}
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
|
-
}
|
|
40
|
+
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../functions',
|
|
3
|
-
'./../mixins',
|
|
4
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../mixins', './../variables';
|
|
5
2
|
|
|
6
|
-
$overlay: (
|
|
3
|
+
$overlay: (
|
|
4
|
+
'padding': 48,
|
|
5
|
+
);
|
|
7
6
|
|
|
8
7
|
@layer base {
|
|
9
|
-
body.has-overlay {
|
|
8
|
+
body.has-overlay {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
10
11
|
|
|
11
12
|
.overlay {
|
|
12
13
|
@include transition(opacity, 0.1s, ease);
|
|
13
14
|
|
|
14
15
|
width: 0;
|
|
15
16
|
height: 0;
|
|
16
|
-
background: map
|
|
17
|
+
background: get-map($theme, 'overlay');
|
|
17
18
|
position: fixed;
|
|
18
19
|
top: 0;
|
|
19
20
|
left: 0;
|
|
@@ -25,35 +26,36 @@ $overlay: ('padding': 48);
|
|
|
25
26
|
align-items: center;
|
|
26
27
|
overflow: hidden;
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
> div, > section {
|
|
36
|
-
width: 100vw;
|
|
37
|
-
height: 100vh;
|
|
38
|
-
margin-top: auto;
|
|
39
|
-
margin-bottom: auto;
|
|
40
|
-
overflow: hidden auto;
|
|
41
|
-
}
|
|
29
|
+
&.open {
|
|
30
|
+
width: 100vw;
|
|
31
|
+
height: 100vh;
|
|
32
|
+
opacity: 1;
|
|
33
|
+
z-index: 998;
|
|
34
|
+
}
|
|
42
35
|
|
|
36
|
+
> div,
|
|
37
|
+
> section {
|
|
38
|
+
width: 100vw;
|
|
39
|
+
height: 100vh;
|
|
40
|
+
margin-top: auto;
|
|
41
|
+
margin-bottom: auto;
|
|
42
|
+
overflow: hidden auto;
|
|
43
|
+
}
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
@include breakpoint('min-width', 'sm') {
|
|
46
47
|
.overlay {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
&.open {
|
|
49
|
+
padding: px-to-rem(get-map($overlay, 'padding'));
|
|
50
|
+
overflow-y: auto;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
> div,
|
|
54
|
+
> section {
|
|
55
|
+
width: auto;
|
|
56
|
+
height: auto;
|
|
57
|
+
overflow: unset;
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
}
|
|
61
|
+
}
|
package/styles/base/_table.scss
CHANGED
|
@@ -1,61 +1,74 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import './../functions',
|
|
3
|
-
'./../variables';
|
|
1
|
+
@import './../functions', './../variables';
|
|
4
2
|
|
|
5
|
-
$table: (
|
|
3
|
+
$table: (
|
|
4
|
+
'margin-top': 64,
|
|
5
|
+
'margin-bottom': 32,
|
|
6
|
+
'padding-vertical': 12,
|
|
7
|
+
'padding-horizontal': 20,
|
|
8
|
+
'border': 1,
|
|
9
|
+
'border-radius': 8,
|
|
10
|
+
);
|
|
6
11
|
|
|
7
12
|
@layer base {
|
|
8
13
|
table {
|
|
9
14
|
width: 100%;
|
|
10
|
-
margin: px-to-rem(
|
|
15
|
+
margin: px-to-rem(get-map($table, 'margin-top')) auto
|
|
16
|
+
px-to-rem(get-map($table, 'margin-bottom')) auto;
|
|
11
17
|
border-collapse: separate;
|
|
12
18
|
border-spacing: 0;
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
&,
|
|
21
|
+
p,
|
|
22
|
+
li {
|
|
23
|
+
text-align: left;
|
|
24
|
+
}
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
th,
|
|
18
|
-
|
|
27
|
+
th,
|
|
28
|
+
td {
|
|
29
|
+
border: px-to-rem(get-map($table, 'border')) solid get-map($theme, 'table_border');
|
|
19
30
|
vertical-align: top;
|
|
20
31
|
}
|
|
21
32
|
|
|
22
|
-
th,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
th,
|
|
34
|
+
tbody:first-child tr:first-child td {
|
|
35
|
+
background: get-map($theme, 'table_th_bg');
|
|
36
|
+
padding: px-to-rem(get-map($table, 'padding-horizontal'));
|
|
37
|
+
color: get-map($theme, 'table_th');
|
|
26
38
|
font-weight: 600;
|
|
27
39
|
border-right-width: 0;
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
/* Add border radius to the corners of the table, not each cell */
|
|
42
|
+
&:first-child {
|
|
43
|
+
border-top-left-radius: px-to-rem(get-map($table, 'border-radius'));
|
|
44
|
+
}
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
&:last-child {
|
|
47
|
+
border-top-right-radius: px-to-rem(get-map($table, 'border-radius'));
|
|
48
|
+
border-right-width: px-to-rem(get-map($table, 'border'));
|
|
49
|
+
}
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
td {
|
|
41
|
-
padding: px-to-rem(
|
|
53
|
+
padding: px-to-rem(get-map($table, 'padding-vertical'))
|
|
54
|
+
px-to-rem(get-map($table, 'padding-horizontal'));
|
|
42
55
|
border-top-width: 0;
|
|
43
56
|
border-right-width: 0;
|
|
44
57
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
/* Prevent borders with double width due to using border-collapse separate */
|
|
59
|
+
&:last-child {
|
|
60
|
+
border-right-width: px-to-rem(get-map($table, 'border'));
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
tr:last-child {
|
|
52
65
|
td {
|
|
53
66
|
&:first-child {
|
|
54
|
-
border-bottom-left-radius: px-to-rem(map
|
|
67
|
+
border-bottom-left-radius: px-to-rem(get-map($table, 'border-radius'));
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
&:last-child {
|
|
58
|
-
border-bottom-right-radius: px-to-rem(map
|
|
71
|
+
border-bottom-right-radius: px-to-rem(get-map($table, 'border-radius'));
|
|
59
72
|
}
|
|
60
73
|
}
|
|
61
74
|
}
|