pallote-css 0.3.11 → 0.4.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.
Files changed (59) hide show
  1. package/README.md +0 -144
  2. package/dist/pallote.min.css +1 -1
  3. package/dist/pallote.min.css.map +1 -1
  4. package/dist/pallote.scss +37 -0
  5. package/dist/styles/common/_editor.scss +181 -0
  6. package/dist/styles/common/_fontface.scss +31 -0
  7. package/dist/styles/common/_functions.scss +11 -0
  8. package/dist/styles/common/_global.scss +157 -0
  9. package/dist/styles/common/_mixins.scss +164 -0
  10. package/dist/styles/common/_reset.scss +145 -0
  11. package/dist/styles/common/_variables.scss +252 -0
  12. package/dist/styles/components/_accordion.scss +132 -0
  13. package/dist/styles/components/_alert.scss +188 -0
  14. package/dist/styles/components/_breadcrumbs.scss +70 -0
  15. package/dist/styles/components/_button.scss +186 -0
  16. package/dist/styles/components/_buttons.scss +52 -0
  17. package/dist/styles/components/_card.scss +316 -0
  18. package/dist/styles/components/_divider.scss +53 -0
  19. package/dist/styles/components/_form.scss +58 -0
  20. package/dist/styles/components/_grid.scss +127 -0
  21. package/dist/styles/components/_input.scss +328 -0
  22. package/dist/styles/components/_link.scss +51 -0
  23. package/dist/styles/components/_list.scss +59 -0
  24. package/dist/styles/components/_nav.scss +274 -0
  25. package/dist/styles/components/_navbar.scss +192 -0
  26. package/dist/styles/components/_page.scss +33 -0
  27. package/dist/styles/components/_section.scss +177 -0
  28. package/dist/styles/components/_sidebar.scss +61 -0
  29. package/dist/styles/components/_snippet.scss +85 -0
  30. package/dist/styles/components/_status.scss +60 -0
  31. package/dist/styles/components/_switch.scss +84 -0
  32. package/dist/styles/components/_table.scss +153 -0
  33. package/dist/styles/components/_tabs.scss +118 -0
  34. package/dist/styles/components/_tag.scss +79 -0
  35. package/dist/styles/modules/_cookie.scss +38 -0
  36. package/dist/styles/utilities/_color.scss +119 -0
  37. package/dist/styles/utilities/_global.scss +211 -0
  38. package/dist/styles/utilities/_grid.scss +124 -0
  39. package/dist/styles/utilities/_layout.scss +127 -0
  40. package/dist/styles/utilities/_text.scss +199 -0
  41. package/package.json +10 -9
  42. package/dist/assets/fonts/SourceSansPro/regular.woff2 +0 -0
  43. package/dist/assets/fonts/SourceSansPro/regularitalic.woff2 +0 -0
  44. package/dist/assets/fonts/SourceSansPro/semibold.woff2 +0 -0
  45. package/dist/assets/fonts/SourceSansPro/semibolditalic.woff2 +0 -0
  46. package/dist/assets/icons/logos/patreon.svg +0 -3
  47. package/dist/assets/icons/phosphor/arrow-right.svg +0 -1
  48. package/dist/assets/icons/phosphor/arrow-square-out.svg +0 -1
  49. package/dist/assets/icons/phosphor/caret-down.svg +0 -1
  50. package/dist/assets/icons/phosphor/check-circle.svg +0 -1
  51. package/dist/assets/icons/phosphor/check.svg +0 -1
  52. package/dist/assets/icons/phosphor/coffee.svg +0 -1
  53. package/dist/assets/icons/phosphor/download-simple.svg +0 -1
  54. package/dist/assets/icons/phosphor/envelope-simple.svg +0 -1
  55. package/dist/assets/icons/phosphor/files.svg +0 -1
  56. package/dist/assets/icons/phosphor/info.svg +0 -1
  57. package/dist/assets/icons/phosphor/warning.svg +0 -1
  58. package/dist/assets/icons/phosphor/x-circle.svg +0 -1
  59. package/dist/assets/icons/rabbit.svg +0 -1
@@ -0,0 +1,164 @@
1
+ @use 'sass:list';
2
+ @use 'variables';
3
+
4
+ // —————————————————————————————————————————————————————————————————
5
+ // media queries
6
+ // font
7
+ // form
8
+ // misc
9
+ // —————————————————————————————————————————————————————————————————
10
+
11
+ // —————————————————————————————————————————————————————————————————
12
+ // media queries
13
+ // —————————————————————————————————————————————————————————————————
14
+
15
+ @mixin responsive($value, $breakpoint) {
16
+ @if $value == up {
17
+ $value: min-width;
18
+ @if $breakpoint == desktop-lg { $breakpoint: variables.$desktop-lg; }
19
+ @else if $breakpoint == desktop { $breakpoint: variables.$desktop; }
20
+ @else if $breakpoint == laptop { $breakpoint: variables.$laptop; }
21
+ @else if $breakpoint == tablet { $breakpoint: variables.$tablet; }
22
+ @else if $breakpoint == mobile { $breakpoint: variables.$mobile; }
23
+ @else if $breakpoint == mobile-sm { $breakpoint: variables.$mobile-sm; }
24
+
25
+ } @else if $value == down {
26
+ $value: max-width;
27
+ @if $breakpoint == desktop-lg { $breakpoint: variables.$desktop-lg-down; }
28
+ @else if $breakpoint == desktop { $breakpoint: variables.$desktop-down; }
29
+ @else if $breakpoint == laptop { $breakpoint: variables.$laptop-down; }
30
+ @else if $breakpoint == tablet { $breakpoint: variables.$tablet-down; }
31
+ @else if $breakpoint == mobile { $breakpoint: variables.$mobile-down; }
32
+ @else if $breakpoint == mobile-sm { $breakpoint: variables.$mobile-sm-down; }
33
+ }
34
+
35
+ @media ($value: $breakpoint) {
36
+ @content;
37
+ }
38
+ }
39
+
40
+ @mixin responsive-touch {
41
+ @media (pointer:coarse) {
42
+ @content;
43
+ }
44
+ }
45
+
46
+ @mixin responsive-click {
47
+ @media not (pointer:coarse) {
48
+ @content;
49
+ }
50
+ }
51
+
52
+ @mixin responsive-touch-landscape {
53
+ @media only screen and (max-device-width: variables.$laptop-down) and (orientation: landscape) {
54
+ @content;
55
+ }
56
+ }
57
+
58
+ // —————————————————————————————————————————————————————————————————
59
+ // font
60
+ // —————————————————————————————————————————————————————————————————
61
+
62
+ // @mixin fontface($font-name, $font-file, $font-weight, $font-style) {
63
+
64
+ // @font-face {
65
+ // font-family: $font-name;
66
+ // src: url(variables.$fonts-path + $font-file + '.woff2') format('woff2');
67
+ // font-weight: $font-weight;
68
+ // font-style: $font-style;
69
+ // font-display: swap;
70
+ // }
71
+ // }
72
+
73
+ @mixin text-ellipsis() {
74
+ white-space: nowrap;
75
+ overflow: hidden;
76
+ text-overflow: ellipsis;
77
+ }
78
+
79
+ // —————————————————————————————————————————————————————————————————
80
+ // form
81
+ // —————————————————————————————————————————————————————————————————
82
+
83
+ @mixin placeholder {
84
+ :-moz-placeholder { @content; }
85
+ ::-moz-placeholder { @content; }
86
+ :-ms-input-placeholder { @content; }
87
+ ::-webkit-input-placeholder { @content; }
88
+ }
89
+
90
+ // —————————————————————————————————————————————————————————————————
91
+ // misc
92
+ // —————————————————————————————————————————————————————————————————
93
+
94
+ @mixin calc($property, $expression) {
95
+ #{$property}: -webkit-calc(#{$expression});
96
+ #{$property}: calc(#{$expression});
97
+ }
98
+
99
+ @mixin background($position, $size) {
100
+ background-position: $position;
101
+ -webkit-background-size: $size;
102
+ background-size: $size;
103
+ background-repeat: no-repeat;
104
+ }
105
+
106
+ @mixin pseudo-element($content: "", $top: 0, $right: 0, $bottom: 0, $left: 0, $width: 100%, $height: 100%) {
107
+ content: $content;
108
+ position: absolute;
109
+ top: $top;
110
+ right: $right;
111
+ bottom: $bottom;
112
+ left: $left;
113
+ width: $width;
114
+ height: $height;
115
+ }
116
+
117
+ @mixin hover {
118
+ &:hover, &:active, &:focus {
119
+ @content;
120
+ }
121
+ }
122
+
123
+ @mixin keyframes($name) {
124
+ @-webkit-keyframes #{$name} {
125
+ @content;
126
+ }
127
+ @-moz-keyframes #{$name} {
128
+ @content;
129
+ }
130
+ @-ms-keyframes #{$name} {
131
+ @content;
132
+ }
133
+ @keyframes #{$name} {
134
+ @content;
135
+ }
136
+ }
137
+
138
+ @mixin transition($time, $properties...) {
139
+ $transition: ();
140
+ $will-change: ();
141
+ @each $property in $properties {
142
+ $transition: list.append(
143
+ $transition, ($property $time), $separator: comma
144
+ );
145
+ $will-change: list.append(
146
+ $will-change, ($property), $separator: comma
147
+ );
148
+ }
149
+ transition: $transition;
150
+ will-change: $will-change;
151
+ }
152
+
153
+ // fallback for clamp css function
154
+ @mixin clamp($property, $min-size, $scaler, $max-size, $viewport: tablet) {
155
+ #{$property}: clamp($min-size, $scaler, $max-size);
156
+
157
+ // @include responsive(up, $viewport) {
158
+ // #{$property}: $max-size;
159
+ // }
160
+
161
+ // @include responsive(down, $viewport) {
162
+ // #{$property}: $min-size;
163
+ // }
164
+ }
@@ -0,0 +1,145 @@
1
+ @use 'variables';
2
+
3
+ // —————————————————————————————————————————————————————————————————
4
+ // custom (for IE)
5
+ // The new CSS Reset - version 1.2.0 (last updated 23.7.2021)
6
+ // Remove inputs icons
7
+ // —————————————————————————————————————————————————————————————————
8
+
9
+ // —————————————————————————————————————————————————————————————————
10
+ // custom (for IE)
11
+ // —————————————————————————————————————————————————————————————————
12
+
13
+ body,
14
+ html {
15
+ margin: 0;
16
+ accent-color: variables.$primary;
17
+ }
18
+
19
+ h1, h2, h3, h4, h5, h6, p {
20
+ margin: 0;
21
+ }
22
+
23
+ // remove visited link styling
24
+ button, a {
25
+ color: inherit;
26
+ }
27
+
28
+ // remove space under picture tag
29
+ picture {
30
+ display: flex;
31
+ }
32
+
33
+ // —————————————————————————————————————————————————————————————————
34
+ // The new CSS Reset - version 1.2.0 (last updated 23.7.2021)
35
+ // —————————————————————————————————————————————————————————————————
36
+
37
+ // Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
38
+ *:where(:not(iframe, canvas, img, svg, video, pre):not(svg *)) {
39
+ all: unset;
40
+ display: revert;
41
+ }
42
+
43
+ // Preferred box-sizing value
44
+ *,
45
+ *::before,
46
+ *::after {
47
+ box-sizing: border-box;
48
+ }
49
+
50
+ // Remove list styles (bullets/numbers) in case you use it with normalize.css
51
+ ol, ul {
52
+ list-style: none;
53
+ }
54
+
55
+ // For images to not be able to exceed their container
56
+ img {
57
+ max-width: 100%;
58
+ }
59
+
60
+ // Removes spacing between cells in tables
61
+ table {
62
+ border-collapse: collapse;
63
+ }
64
+
65
+ // Revert the 'white-space' property for textarea elements on Safari
66
+ textarea {
67
+ white-space: revert;
68
+ }
69
+
70
+ // Add focus styles
71
+ a[href],
72
+ area[href],
73
+ input,
74
+ input[type="checkbox"],
75
+ input[type='radio'],
76
+ select,
77
+ textarea,
78
+ button,
79
+ iframe,
80
+ [tabindex],
81
+ [contentEditable=true] {
82
+ outline: revert;
83
+
84
+ &:focus {
85
+ outline: 2px solid currentColor;
86
+ }
87
+ }
88
+
89
+ // —————————————————————————————————————————————————————————————————
90
+ // Remove inputs icons
91
+ // —————————————————————————————————————————————————————————————————
92
+
93
+ // Remove default arrow for input[type=number] in Webkit browsers (Chrome, Safari, etc.)
94
+ input[type="number"]::-webkit-outer-spin-button,
95
+ input[type="number"]::-webkit-inner-spin-button {
96
+ opacity: 0;
97
+ margin: 0;
98
+ }
99
+
100
+ // Remove default arrow for input[type=number] in Firefox
101
+ input[type="number"] {
102
+ -moz-appearance: textfield;
103
+ appearance: textfield;
104
+ }
105
+
106
+ // Remove default calendar and time picker icons in Webkit browsers
107
+ input[type="date"]::-webkit-calendar-picker-indicator,
108
+ input[type="time"]::-webkit-calendar-picker-indicator {
109
+ opacity: 0;
110
+ }
111
+
112
+ // Remove default calendar icon in Edge and IE
113
+ input[type="date"]::-ms-clear,
114
+ input[type="date"]::-ms-input-placeholder {
115
+ opacity: 0;
116
+ }
117
+
118
+ input[type="time"]::-ms-clear,
119
+ input[type="time"]::-ms-input-placeholder {
120
+ opacity: 0;
121
+ }
122
+
123
+ // Remove default calendar and time picker icons in Mozilla Firefox
124
+ input[type="date"] {
125
+ -moz-appearance: textfield;
126
+ appearance: textfield;
127
+ }
128
+
129
+ input[type="time"] {
130
+ -moz-appearance: textfield;
131
+ appearance: textfield;
132
+ }
133
+
134
+ // For additional browser support
135
+ input[type="date"],
136
+ input[type="time"] {
137
+ appearance: none;
138
+ -webkit-appearance: none;
139
+ -moz-appearance: none;
140
+ }
141
+
142
+ // Hide the clear button in Edge
143
+ input::-ms-clear {
144
+ opacity: 0;
145
+ }
@@ -0,0 +1,252 @@
1
+ @use 'sass:color';
2
+ @use 'sass:string';
3
+
4
+ // —————————————————————————————————————————————————————————————————
5
+ // dependencies
6
+ // color palette
7
+ // spacing
8
+ // typography
9
+ // breakpoints
10
+ // misc
11
+ // components
12
+ // —————————————————————————————————————————————————————————————————
13
+
14
+ // —————————————————————————————————————————————————————————————————
15
+ // dependencies
16
+ // —————————————————————————————————————————————————————————————————
17
+
18
+ // $fonts-path: './assets/fonts/' !default;
19
+ // $icons-path: './assets/icons/' !default;
20
+
21
+ // —————————————————————————————————————————————————————————————————
22
+ // color palette
23
+ // —————————————————————————————————————————————————————————————————
24
+
25
+ // main
26
+
27
+ $main: #FFFFFF !default;
28
+ $contrast: #000A1E !default;
29
+
30
+ // grey
31
+
32
+ $grey-90: color.mix($contrast, $main, 90%) !default;
33
+ $grey-80: color.mix($contrast, $main, 80%) !default;
34
+ $grey-70: color.mix($contrast, $main, 70%) !default;
35
+ $grey-60: color.mix($contrast, $main, 60%) !default;
36
+ $grey-50: color.mix($contrast, $main, 50%) !default;
37
+ $grey-40: color.mix($contrast, $main, 40%) !default;
38
+ $grey-30: color.mix($contrast, $main, 30%) !default;
39
+ $grey-20: color.mix($contrast, $main, 20%) !default;
40
+ $grey-10: color.mix($contrast, $main, 10%) !default;
41
+ $grey-5: color.mix($contrast, $main, 5%) !default;
42
+
43
+ // background
44
+
45
+ $background-default: $grey-5 !default;
46
+ $background-paper: $main !default;
47
+
48
+ // text
49
+
50
+ $text: $contrast !default;
51
+ $text-alt: rgba($text, 0.5) !default;
52
+ $text-disabled: rgba($text, 0.25) !default;
53
+
54
+ $text-contrast: $main !default;
55
+ $text-contrast-alt: rgba($text-contrast, 0.6) !default;
56
+ $text-contrast-disabled: rgba($text-contrast, 0.3) !default;
57
+
58
+ // brand
59
+
60
+ $primary: #3C6BF4 !default;
61
+ $primary-light: color.mix($main, $primary, 70%) !default;
62
+ $primary-dark: color.mix($contrast, $primary, 50%) !default;
63
+ $primary-contrast: $text-contrast !default;
64
+
65
+ $secondary: #9E6D04 !default;
66
+ $secondary-light: color.mix($main, $secondary, 70%) !default;
67
+ $secondary-dark: color.mix($contrast, $secondary, 50%) !default;
68
+ $secondary-contrast: $text-contrast !default;
69
+
70
+ // feedback
71
+
72
+ $success: #27AE60 !default;
73
+ $success-light: color.mix($main, $success, 80%) !default;
74
+ $success-dark: color.mix($contrast, $success, 60%) !default;
75
+ $success-contrast: $text-contrast !default;
76
+
77
+ $info: #17A0CC !default;
78
+ $info-light: color.mix($main, $info, 80%) !default;
79
+ $info-dark: color.mix($contrast, $info, 60%) !default;
80
+ $info-contrast: $text-contrast !default;
81
+
82
+ $warning: #FFDC46 !default;
83
+ $warning-light: color.mix($main, $warning, 80%) !default;
84
+ $warning-dark: color.mix($contrast, $warning, 60%) !default;
85
+ $warning-contrast: $text !default;
86
+
87
+ $error: #EB5757 !default;
88
+ $error-light: color.mix($main, $error, 80%) !default;
89
+ $error-dark: color.mix($contrast, $error, 60%) !default;
90
+ $error-contrast: $text-contrast !default;
91
+
92
+ // others
93
+
94
+ $border-color: rgba($text, 0.2) !default;
95
+ $border: 1px solid $border-color !default;
96
+ $border-color-contrast: rgba($text-contrast, 0.3) !default;
97
+ $border-contrast: 1px solid $border-color-contrast !default;
98
+
99
+ $hover: rgba($text, 0.08) !default;
100
+ $hover-contrast: rgba($text-contrast, 0.08) !default;
101
+
102
+ $overlay: rgba($text-contrast, 0.8) !default;
103
+ $overlay-contrast: rgba($text, 0.2) !default;
104
+
105
+ $input-background: rgba($text, 0.05);
106
+
107
+ // —————————————————————————————————————————————————————————————————
108
+ // spacing
109
+ // —————————————————————————————————————————————————————————————————
110
+
111
+ $col: calc(100%/12);
112
+
113
+ $spacing-xxs: 0.125rem !default;
114
+ $spacing-xs: 0.25rem !default;
115
+ $spacing-sm: 0.5rem !default;
116
+ $spacing-md: 1rem !default;
117
+ $spacing-lg: 2rem !default;
118
+ $spacing-xl: 4rem !default;
119
+ $spacing-xxl: 7rem !default;
120
+
121
+ $max-width-subtitle: 27.5rem !default;
122
+ $max-width-editor: 40rem !default;
123
+ $max-width-form: 40rem !default;
124
+
125
+ $navbar-height: 4rem !default;
126
+ $navbar-height-sm: 3rem !default;
127
+ $nav-item: $spacing-md !default;
128
+
129
+ // —————————————————————————————————————————————————————————————————
130
+ // typography
131
+ // —————————————————————————————————————————————————————————————————
132
+
133
+ // Functions to unquote and remove spaces
134
+ // @function str-replace($string, $search, $replace: "") {
135
+ // $index: string.index($string, $search);
136
+
137
+ // @if $index {
138
+ // @return str-replace(
139
+ // string.slice($string, 1, $index - 1) + $replace + string.slice($string, $index + string.length($search), string.length($string)),
140
+ // $search,
141
+ // $replace
142
+ // );
143
+ // }
144
+
145
+ // @return $string;
146
+ // }
147
+ // @function clean-string($string) {
148
+ // @return str-replace(string.unquote($string), " ");
149
+ // }
150
+
151
+ // typefaces
152
+ $font: "Source Sans Pro" !default;
153
+ // $font-clean: clean-string($font);
154
+ $font-fallback: "Arial, sans-serif" !default;
155
+ $font-code: monospace !default;
156
+
157
+ // weight
158
+
159
+ $font-regular: 400 !default;
160
+ $font-bold: 700 !default;
161
+
162
+ // styles
163
+
164
+ $h1-size: 3rem !default;
165
+ $h1-weight: $font-bold !default;
166
+ $h1-line-height: 1.25 !default;
167
+
168
+ $h2-size: 2.5rem !default;
169
+ $h2-weight: $font-bold !default;
170
+ $h2-line-height: 1.25 !default;
171
+
172
+ $h3-size: 2rem !default;
173
+ $h3-weight: $font-bold !default;
174
+ $h3-line-height: 1.25 !default;
175
+
176
+ $h4-size: 1.75rem !default;
177
+ $h4-weight: $font-bold !default;
178
+ $h4-line-height: 1.25 !default;
179
+
180
+ $h5-size: 1.5rem !default;
181
+ $h5-weight: $font-bold !default;
182
+ $h5-line-height: 1.25 !default;
183
+
184
+ $h6-size: 1.25rem !default;
185
+ $h6-weight: $font-bold !default;
186
+ $h6-line-height: 1.25 !default;
187
+
188
+ $subtitle-size: 1.125rem !default;
189
+ $subtitle-weight: $font-regular !default;
190
+ $subtitle-line-height: 1.5 !default;
191
+
192
+ $body-size: 1rem !default;
193
+ $body-weight: $font-regular !default;
194
+ $body-line-height: 1.5 !default;
195
+
196
+ $caption-size: 0.875rem !default;
197
+ $caption-weight: $font-regular !default;
198
+ $caption-line-height: 1.5 !default;
199
+
200
+ $overline-size: 0.75rem !default;
201
+ $overline-weight: $font-regular !default;
202
+ $overline-line-height: 1.5 !default;
203
+
204
+ // —————————————————————————————————————————————————————————————————
205
+ // breakpoints
206
+ // —————————————————————————————————————————————————————————————————
207
+
208
+ $desktop-lg: 1440px !default;
209
+ $desktop-lg-down: calc(#{$desktop-lg} - 0.02px);
210
+
211
+ $desktop: 1280px !default;
212
+ $desktop-down: calc(#{$desktop} - 0.02px);
213
+
214
+ $laptop: 1024px !default;
215
+ $laptop-down: calc(#{$laptop} - 0.02px);
216
+
217
+ $tablet: 768px !default;
218
+ $tablet-down: calc(#{$tablet} - 0.02px);
219
+
220
+ $mobile: 568px !default;
221
+ $mobile-down: calc(#{$mobile} - 0.02px);
222
+
223
+ $mobile-sm: 350px !default;
224
+ $mobile-sm-down: calc(#{$mobile-sm} - 0.02px);
225
+
226
+ // —————————————————————————————————————————————————————————————————
227
+ // misc
228
+ // —————————————————————————————————————————————————————————————————
229
+
230
+ // box-shadow
231
+
232
+ $box-shadow: 0 0 .5rem 0 rgba($text, 0.2) !default;
233
+
234
+ // transition
235
+
236
+ $transition-md: 0.4s ease 0s !default;
237
+ $transition-lg: 0.8s ease 0s !default;
238
+
239
+ // border-radius
240
+
241
+ $border-radius-sm: .25rem !default;
242
+ $border-radius-md: .5rem !default;
243
+ $border-radius-lg: 1rem !default;
244
+
245
+ // —————————————————————————————————————————————————————————————————
246
+ // components
247
+ // —————————————————————————————————————————————————————————————————
248
+
249
+ // input
250
+
251
+ $input-height: 2.5rem;
252
+ $checkbox-width: 1.5rem;
@@ -0,0 +1,132 @@
1
+ @use '../common/mixins';
2
+ @use '../common/variables';
3
+
4
+ // —————————————————————————————————————————————————————————————————
5
+ // elements
6
+ // size
7
+ // transparent
8
+ // active
9
+ // —————————————————————————————————————————————————————————————————
10
+
11
+ // —————————————————————————————————————————————————————————————————
12
+ // elements
13
+ // —————————————————————————————————————————————————————————————————
14
+
15
+ .accordion {
16
+ width: 100%;
17
+
18
+ &__item {
19
+ position: relative;
20
+ background-color: variables.$hover;
21
+ width: 100%;
22
+ }
23
+
24
+ &__control,
25
+ &__content {
26
+ transition: padding variables.$transition-md;
27
+ will-change: padding;
28
+ }
29
+
30
+ &__control {
31
+ display: flex;
32
+ align-items: center;
33
+ width: 100%;
34
+ cursor: pointer;
35
+
36
+ &:after {
37
+ transition: transform variables.$transition-md;
38
+ will-change: transform;
39
+ position: absolute;
40
+ height: variables.$spacing-md;
41
+ width: variables.$spacing-md;
42
+ transform-origin: center 60%;
43
+ pointer-events: none;
44
+ }
45
+ }
46
+
47
+ &__content {
48
+ max-height: 0;
49
+ overflow: hidden;
50
+ transition: max-height variables.$transition-md;
51
+ will-change: max-height;
52
+ }
53
+ }
54
+
55
+ // —————————————————————————————————————————————————————————————————
56
+ // size
57
+ // —————————————————————————————————————————————————————————————————
58
+
59
+ @mixin accordion-size($proportion, $size) {
60
+
61
+ .accordion {
62
+
63
+ &__item {
64
+ border-radius: calc($size*2/3);
65
+
66
+ &:not(:last-child) { margin-bottom: calc($size/3); }
67
+ &--active { padding-bottom: $size; }
68
+ }
69
+
70
+ &__control {
71
+ padding: $size $size*1.5;
72
+
73
+ &:after {
74
+ top: $size;
75
+ right: $size*1.25;
76
+ }
77
+ }
78
+
79
+ &__header {
80
+
81
+ @if $proportion == sm { margin-bottom: -1px; }
82
+ @if $proportion == lg { margin: -1px 0 -2px 0; }
83
+ }
84
+
85
+ &__content {
86
+ padding: 0 $size*1.5;
87
+ overflow: hidden;
88
+ }
89
+ }
90
+
91
+ &.accordion--transparent .accordion__item--active:not(:first-child) {
92
+ margin-top: calc($size/3);
93
+ }
94
+ }
95
+
96
+ .accordion {
97
+
98
+ @include accordion-size(md, variables.$spacing-sm);
99
+ &--sm { @include accordion-size(sm, variables.$spacing-xs); }
100
+ &--lg { @include accordion-size(lg, variables.$spacing-md); }
101
+ }
102
+
103
+ // —————————————————————————————————————————————————————————————————
104
+ // transparent
105
+ // —————————————————————————————————————————————————————————————————
106
+
107
+ .accordion--transparent {
108
+
109
+ .accordion__item {
110
+ transition: background-color variables.$transition-md, margin variables.$transition-md;
111
+ will-change: background-color, margin;
112
+ background-color: transparent;
113
+
114
+ @include mixins.hover { background-color: variables.$hover; }
115
+ &--active { background-color: variables.$hover; }
116
+
117
+ &:not(:last-child):not(.accordion__item--active) {
118
+ margin-bottom: 0;
119
+ }
120
+ }
121
+ }
122
+
123
+ // —————————————————————————————————————————————————————————————————
124
+ // active
125
+ // —————————————————————————————————————————————————————————————————
126
+
127
+ .accordion__item--active {
128
+
129
+ .accordion__control:after {
130
+ transform: rotate(180deg);
131
+ }
132
+ }