@rolemodel/optics 0.2.3
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/.eslintrc.json +14 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- package/.github/pull_request_template.md +30 -0
- package/.github/workflows/linting.yml +38 -0
- package/.github/workflows/publish-storybook.yml +26 -0
- package/.github/workflows/release-package.yml +33 -0
- package/.prettierignore +0 -0
- package/.prettierrc.json +8 -0
- package/.storybook/ModeSwitcher.jsx +98 -0
- package/.storybook/documentation.scss +65 -0
- package/.storybook/main.js +10 -0
- package/.storybook/manager.js +22 -0
- package/.storybook/preview.js +12 -0
- package/.storybook/rolemodelTheme.js +10 -0
- package/.stylelintrc.json +15 -0
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/build_token_json.js +149 -0
- package/dist/css/optics.css +2586 -0
- package/dist/css/optics.css.map +1 -0
- package/dist/scss/addons/rails-modal-and-panel/index.scss +2 -0
- package/dist/scss/addons/rails-modal-and-panel/modal.scss +86 -0
- package/dist/scss/addons/rails-modal-and-panel/panel.scss +36 -0
- package/dist/scss/addons/tom-select.scss +77 -0
- package/dist/scss/components/alert.scss +158 -0
- package/dist/scss/components/badge.scss +80 -0
- package/dist/scss/components/button.scss +235 -0
- package/dist/scss/components/button_group.scss +35 -0
- package/dist/scss/components/card.scss +65 -0
- package/dist/scss/components/flash.scss +58 -0
- package/dist/scss/components/form.scss +178 -0
- package/dist/scss/components/icon.scss +109 -0
- package/dist/scss/components/index.scss +10 -0
- package/dist/scss/components/sidebar.scss +255 -0
- package/dist/scss/components/table.scss +132 -0
- package/dist/scss/core/base.scss +95 -0
- package/dist/scss/core/layout.scss +36 -0
- package/dist/scss/core/tokens/base_tokens.scss +251 -0
- package/dist/scss/core/tokens/dark_mode_tokens.scss +324 -0
- package/dist/scss/core/tokens/index.scss +3 -0
- package/dist/scss/core/tokens/scale_color_tokens.scss +303 -0
- package/dist/scss/core/utilities.scss +548 -0
- package/dist/scss/optics.scss +13 -0
- package/dist/scss/recipes/16six-sidebar.scss +97 -0
- package/dist/scss/recipes/domains-sidebar.scss +60 -0
- package/dist/tokens/tokens.json +391 -0
- package/package.json +80 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.btn-group {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
.btn,
|
|
6
|
+
.btn-primary,
|
|
7
|
+
.btn-secondary,
|
|
8
|
+
.btn-delete {
|
|
9
|
+
+ .btn,
|
|
10
|
+
+ .btn-primary,
|
|
11
|
+
+ .btn-secondary,
|
|
12
|
+
+ .btn-delete {
|
|
13
|
+
margin-left: 1px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:not(:first-child, :last-child) {
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:first-child:not(:last-child) {
|
|
21
|
+
border-bottom-right-radius: 0;
|
|
22
|
+
border-top-right-radius: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:last-child:not(:first-child) {
|
|
26
|
+
border-bottom-left-radius: 0;
|
|
27
|
+
border-top-left-radius: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.btn-group-toolbar {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
%card-global {
|
|
2
|
+
position: relative;
|
|
3
|
+
border-radius: var(--rm-radius-medium);
|
|
4
|
+
background-color: var(--rm-color-background);
|
|
5
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color);
|
|
6
|
+
color: var(--rm-color-on-background);
|
|
7
|
+
contain: paint;
|
|
8
|
+
font-size: var(--rm-font-medium);
|
|
9
|
+
line-height: var(--rm-line-height-base);
|
|
10
|
+
|
|
11
|
+
// Modifiers
|
|
12
|
+
&.card--condensed {
|
|
13
|
+
@include spacing-scales;
|
|
14
|
+
|
|
15
|
+
--rm-space-scale-unit: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.card--shadow-x-small {
|
|
19
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color), var(--rm-shadow-x-small);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.card--shadow-small {
|
|
23
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color), var(--rm-shadow-small);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.card--shadow-medium {
|
|
27
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color), var(--rm-shadow-medium);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.card--shadow-large {
|
|
31
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color), var(--rm-shadow-large);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.card--shadow-x-large {
|
|
35
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color), var(--rm-shadow-x-large);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Elements
|
|
39
|
+
.card__header,
|
|
40
|
+
.card__body,
|
|
41
|
+
.card__footer {
|
|
42
|
+
padding: var(--rm-space-medium);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.card__header {
|
|
46
|
+
h1,
|
|
47
|
+
h2,
|
|
48
|
+
h3,
|
|
49
|
+
h4,
|
|
50
|
+
h5,
|
|
51
|
+
h6 {
|
|
52
|
+
margin: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card {
|
|
58
|
+
@extend %card-global;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card-padded {
|
|
62
|
+
@extend %card-global;
|
|
63
|
+
|
|
64
|
+
padding: var(--rm-space-medium);
|
|
65
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
%flash-global {
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: var(--rm-z-index-alert-group);
|
|
4
|
+
top: var(--rm-space-large);
|
|
5
|
+
right: var(--rm-space-large);
|
|
6
|
+
display: inline-grid;
|
|
7
|
+
width: auto;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
padding: var(--rm-space-x-small) var(--rm-space-medium);
|
|
11
|
+
border-color: var(--rm-color-on-background);
|
|
12
|
+
border-radius: var(--rm-radius-small);
|
|
13
|
+
border-left-width: var(--rm-border-width-x-large);
|
|
14
|
+
border-left-style: solid;
|
|
15
|
+
animation: rm-slide-in-out-flash var(--rm-transition-flash) normal forwards;
|
|
16
|
+
background: var(--rm-color-background);
|
|
17
|
+
box-shadow: var(--rm-shadow-x-small);
|
|
18
|
+
color: var(--rm-color-on-background);
|
|
19
|
+
font-size: var(--rm-font-small);
|
|
20
|
+
gap: var(--rm-space-small);
|
|
21
|
+
grid-auto-flow: column;
|
|
22
|
+
|
|
23
|
+
// Modifiers
|
|
24
|
+
&.flash--notice {
|
|
25
|
+
border-color: var(--rm-color-alerts-notice-base);
|
|
26
|
+
color: var(--rm-color-alerts-notice-base);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.flash--info {
|
|
30
|
+
border-color: var(--rm-color-alerts-info-base);
|
|
31
|
+
color: var(--rm-color-alerts-info-base);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.flash--alert {
|
|
35
|
+
border-color: var(--rm-color-alerts-danger-base);
|
|
36
|
+
color: var(--rm-color-alerts-danger-base);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.flash--warning {
|
|
40
|
+
border-color: var(--rm-color-alerts-warning-base);
|
|
41
|
+
color: var(--rm-color-alerts-warning-base);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Elements
|
|
45
|
+
.flash__message-type {
|
|
46
|
+
color: var(--rm-color-on-background);
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.flash__message {
|
|
51
|
+
color: var(--rm-color-on-background);
|
|
52
|
+
font-size: var(--rm-font-x-small);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.flash {
|
|
57
|
+
@extend %flash-global;
|
|
58
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
%standard-input {
|
|
2
|
+
// Private API (don't touch these)
|
|
3
|
+
--__rm-input-height: var(--rm-input-height-large);
|
|
4
|
+
|
|
5
|
+
display: block;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-width: var(--__rm-input-height);
|
|
8
|
+
height: var(--__rm-input-height);
|
|
9
|
+
padding: var(--rm-space-small) var(--rm-space-medium);
|
|
10
|
+
border: none;
|
|
11
|
+
border-radius: var(--rm-radius-large);
|
|
12
|
+
background-color: var(--rm-color-neutral-plus-max);
|
|
13
|
+
box-shadow: var(--rm-border-all) var(--rm-border-color);
|
|
14
|
+
color: var(--rm-color-neutral-on-plus-max);
|
|
15
|
+
cursor: text;
|
|
16
|
+
font-size: var(--rm-font-small);
|
|
17
|
+
font-weight: var(--rm-font-weight-light);
|
|
18
|
+
line-height: var(--rm-line-height-base);
|
|
19
|
+
|
|
20
|
+
&.form-control--read-only {
|
|
21
|
+
height: fit-content;
|
|
22
|
+
background-color: var(--rm-color-neutral-plus-seven);
|
|
23
|
+
background-image: none;
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
color: var(--rm-color-neutral-on-plus-seven);
|
|
26
|
+
cursor: unset;
|
|
27
|
+
|
|
28
|
+
&[type='color'] {
|
|
29
|
+
height: var(--__rm-input-height);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
%dropdown-arrow {
|
|
35
|
+
padding-right: var(--rm-space-3x-large);
|
|
36
|
+
appearance: none;
|
|
37
|
+
background: var(--rm-form-dropdown-arrow) center right no-repeat;
|
|
38
|
+
background-position-x: calc(100% - ((var(--rm-space-3x-large) / 2) - (var(--rm-form-dropdown-arrow-width) / 2)));
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.form-label {
|
|
43
|
+
color: var(--rm-color-on-background);
|
|
44
|
+
font-size: var(--rm-font-small);
|
|
45
|
+
font-weight: var(--rm-font-weight-normal);
|
|
46
|
+
letter-spacing: var(--rm-letter-spacing-label);
|
|
47
|
+
line-height: var(--rm-line-height-base);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.form-control {
|
|
51
|
+
&:not([type='radio'], [type='checkbox']) {
|
|
52
|
+
@extend %standard-input;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&[type='color'] {
|
|
56
|
+
@extend %dropdown-arrow;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&[type='radio'],
|
|
60
|
+
&[type='checkbox'] {
|
|
61
|
+
width: var(--rm-space-large);
|
|
62
|
+
height: var(--rm-space-large);
|
|
63
|
+
align-self: center;
|
|
64
|
+
margin: 0;
|
|
65
|
+
accent-color: var(--rm-color-primary-base);
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
|
|
68
|
+
& + .form__label {
|
|
69
|
+
grid-column: 2 / 3;
|
|
70
|
+
grid-row: 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:disabled {
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:focus,
|
|
79
|
+
&:focus-within,
|
|
80
|
+
&:focus-visible,
|
|
81
|
+
&:active {
|
|
82
|
+
box-shadow: 0 0 0 var(--rm-border-width-large) var(--rm-color-primary-plus-four), var(--rm-input-focus);
|
|
83
|
+
outline: none;
|
|
84
|
+
|
|
85
|
+
&:hover:not(:disabled) {
|
|
86
|
+
box-shadow: 0 0 0 var(--rm-border-width-large) var(--rm-color-primary-plus-four), var(--rm-input-focus);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
select.form-control:not([multiple], [type='radio'], [type='checkbox']) {
|
|
92
|
+
@extend %dropdown-arrow;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
select.form-control[multiple] {
|
|
96
|
+
min-height: calc(2 * var(--__rm-input-height));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
textarea.form-control {
|
|
100
|
+
@extend %standard-input;
|
|
101
|
+
|
|
102
|
+
min-width: var(--__rm-input-height);
|
|
103
|
+
max-width: 100%;
|
|
104
|
+
min-height: var(--__rm-input-height);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.form-group--error {
|
|
108
|
+
/* stylelint-disable no-descending-specificity */
|
|
109
|
+
.form-control {
|
|
110
|
+
box-shadow: var(--rm-border-all) var(--rm-color-alerts-danger-minus-three);
|
|
111
|
+
|
|
112
|
+
&[type='radio'],
|
|
113
|
+
&[type='checkbox'] {
|
|
114
|
+
box-shadow: none;
|
|
115
|
+
|
|
116
|
+
& + label {
|
|
117
|
+
color: var(--rm-color-alerts-danger-minus-three);
|
|
118
|
+
font-weight: var(--rm-font-weight-bold);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/* stylelint-enable no-descending-specificity */
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.form-error {
|
|
126
|
+
width: fit-content;
|
|
127
|
+
padding: var(--rm-space-2x-small) var(--rm-space-x-small);
|
|
128
|
+
border-radius: var(--rm-radius-medium);
|
|
129
|
+
background: var(--rm-color-alerts-danger-plus-seven);
|
|
130
|
+
color: var(--rm-color-alerts-danger-on-plus-seven);
|
|
131
|
+
font-size: var(--rm-font-x-small);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.form-hint {
|
|
135
|
+
display: block;
|
|
136
|
+
font-size: var(--rm-font-small);
|
|
137
|
+
font-style: italic;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.form-error-summary {
|
|
141
|
+
padding: var(--rm-space-large);
|
|
142
|
+
border-radius: var(--rm-radius-large);
|
|
143
|
+
margin-bottom: var(--rm-space-large);
|
|
144
|
+
background-color: var(--rm-color-alerts-danger-plus-seven);
|
|
145
|
+
box-shadow: var(--rm-border-all) var(--rm-color-alerts-danger-on-plus-seven);
|
|
146
|
+
color: var(--rm-color-alerts-danger-on-plus-seven);
|
|
147
|
+
|
|
148
|
+
h2 {
|
|
149
|
+
font-size: var(--rm-font-medium);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
ul {
|
|
153
|
+
margin-bottom: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.form-group {
|
|
158
|
+
display: grid;
|
|
159
|
+
padding: var(--rm-space-small) 0;
|
|
160
|
+
gap: var(--rm-space-x-small);
|
|
161
|
+
grid-auto-rows: auto;
|
|
162
|
+
grid-template-columns: auto 1fr;
|
|
163
|
+
|
|
164
|
+
// Group Alignment
|
|
165
|
+
/* stylelint-disable no-descending-specificity */
|
|
166
|
+
.form-label,
|
|
167
|
+
.form-error,
|
|
168
|
+
.form-hint,
|
|
169
|
+
.form-control:not([type='radio'], [type='checkbox']) {
|
|
170
|
+
grid-column: 1 / 3;
|
|
171
|
+
}
|
|
172
|
+
/* stylelint-enable no-descending-specificity */
|
|
173
|
+
|
|
174
|
+
.form-control[type='radio'],
|
|
175
|
+
.form-contorl[type='checkbox'] {
|
|
176
|
+
grid-column: 1 / 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Look up icons at: https://fonts.google.com/icons?icon.set=Material+Symbols
|
|
2
|
+
// Instead of hosting the font files locally which requires the compiler to handle them, we pull the icons
|
|
3
|
+
// from Googles CDN like we do for our other fonts
|
|
4
|
+
// https://developers.google.com/fonts/docs/material_symbols#variable_font_with_google_fonts
|
|
5
|
+
|
|
6
|
+
@import 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200';
|
|
7
|
+
|
|
8
|
+
.material-symbols-outlined,
|
|
9
|
+
.material-symbols {
|
|
10
|
+
--rm-mso-fill: 0;
|
|
11
|
+
--rm-mso-weight: var(--rm-font-weight-normal);
|
|
12
|
+
--rm-mso-grade: 0;
|
|
13
|
+
--rm-mso-optical-sizing: 20;
|
|
14
|
+
|
|
15
|
+
font-size: var(--rm-font-medium);
|
|
16
|
+
font-variation-settings: 'FILL' var(--rm-mso-fill), 'wght' var(--rm-mso-weight), 'GRAD' var(--rm-mso-grade),
|
|
17
|
+
'opsz' var(--rm-mso-optical-sizing);
|
|
18
|
+
line-height: var(--rm-line-height-densest);
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Fill
|
|
23
|
+
.icon--outlined {
|
|
24
|
+
--rm-mso-fill: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.icon--filled {
|
|
28
|
+
--rm-mso-fill: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Weight
|
|
32
|
+
.icon--weight-light {
|
|
33
|
+
--rm-mso-weight: var(--rm-font-weight-light);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon--weight-normal {
|
|
37
|
+
--rm-mso-weight: var(--rm-font-weight-normal);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon--weight-semi-bold {
|
|
41
|
+
--rm-mso-weight: var(--rm-font-weight-semi-bold);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon--weight-bold {
|
|
45
|
+
--rm-mso-weight: var(--rm-font-weight-bold);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Emphasis
|
|
49
|
+
.icon--low-emphasis {
|
|
50
|
+
--rm-mso-grade: -20;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.icon--normal-emphasis {
|
|
54
|
+
--rm-mso-grade: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.icon--high-emphasis {
|
|
58
|
+
--rm-mso-grade: 200;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Size
|
|
62
|
+
.icon--medium {
|
|
63
|
+
font-size: var(--rm-font-medium);
|
|
64
|
+
|
|
65
|
+
--rm-mso-optical-sizing: 20;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.icon--large {
|
|
69
|
+
font-size: var(--rm-font-large);
|
|
70
|
+
|
|
71
|
+
--rm-mso-optical-sizing: 40;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.icon--x-large {
|
|
75
|
+
font-size: var(--rm-font-x-large);
|
|
76
|
+
|
|
77
|
+
--rm-mso-optical-sizing: 48;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.custom-icons {
|
|
81
|
+
display: inline-block;
|
|
82
|
+
width: var(--rm-font-x-large);
|
|
83
|
+
height: var(--rm-font-x-large);
|
|
84
|
+
|
|
85
|
+
&.icon--medium {
|
|
86
|
+
font-size: var(--rm-font-small);
|
|
87
|
+
|
|
88
|
+
--rm-mso-optical-sizing: 20;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.icon--large {
|
|
92
|
+
width: var(--rm-font-large);
|
|
93
|
+
height: var(--rm-font-large);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.icon--x-large {
|
|
97
|
+
width: var(--rm-font-2x-large);
|
|
98
|
+
height: var(--rm-font-2x-large);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.custom-icons svg {
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.icon-link {
|
|
108
|
+
line-height: 0;
|
|
109
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
@mixin sidebar-rail-global {
|
|
2
|
+
// Private API
|
|
3
|
+
--__rm-sidebar-width: var(--_rm-sidebar-rail-width);
|
|
4
|
+
|
|
5
|
+
// Elements
|
|
6
|
+
.sidebar__content {
|
|
7
|
+
gap: var(--_rm-sidebar-link-spacing);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.sidebar__section-title,
|
|
11
|
+
.sidebar__section-divider {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sidebar__item {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--rm-space-2x-small);
|
|
18
|
+
|
|
19
|
+
.sidebar__item-icon {
|
|
20
|
+
padding: var(--rm-space-2x-small) var(--rm-space-medium);
|
|
21
|
+
transition: var(--_rm-sidebar-transition);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:hover .sidebar__item-icon {
|
|
25
|
+
background-color: var(--_rm-sidebar-icon-background-hover-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.active .sidebar__item-icon {
|
|
29
|
+
background-color: var(--_rm-sidebar-icon-background-active-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.sidebar__item-label {
|
|
33
|
+
font-size: var(--rm-font-x-small);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin sidebar-drawer-global {
|
|
39
|
+
// Private API
|
|
40
|
+
--__rm-sidebar-width: var(--_rm-sidebar-drawer-width);
|
|
41
|
+
|
|
42
|
+
.sidebar__content {
|
|
43
|
+
padding: 0 var(--_rm-sidebar-spacing);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sidebar__section-title {
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
height: var(--rm-input-height-large);
|
|
49
|
+
padding: var(--rm-space-small) var(--rm-space-medium);
|
|
50
|
+
color: var(--_rm-sidebar-text-color);
|
|
51
|
+
font-size: var(--rm-font-small);
|
|
52
|
+
font-weight: var(--rm-font-weight-bold);
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sidebar__section-divider {
|
|
58
|
+
border-bottom: var(--rm-border-width) solid var(--_rm-sidebar-text-color);
|
|
59
|
+
margin: 0 var(--_rm-sidebar-spacing);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sidebar__item {
|
|
63
|
+
height: var(--rm-input-height-large);
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
padding: var(--rm-space-x-small) var(--rm-space-medium);
|
|
66
|
+
border-radius: var(--rm-radius-pill);
|
|
67
|
+
gap: var(--_rm-sidebar-link-spacing);
|
|
68
|
+
|
|
69
|
+
&:hover,
|
|
70
|
+
&.active {
|
|
71
|
+
transition: var(--_rm-sidebar-transition);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
background-color: var(--_rm-sidebar-icon-background-hover-color);
|
|
76
|
+
color: var(--_rm-sidebar-icon-text-hover-color);
|
|
77
|
+
|
|
78
|
+
.sidebar__item-icon {
|
|
79
|
+
color: var(--_rm-sidebar-icon-text-hover-color);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.active {
|
|
84
|
+
background-color: var(--_rm-sidebar-icon-background-active-color);
|
|
85
|
+
color: var(--_rm-sidebar-icon-text-active-color);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
%sidebar-global {
|
|
91
|
+
// Public API
|
|
92
|
+
// Normal
|
|
93
|
+
--_rm-sidebar-background-color: var(--rm-color-neutral-plus-seven);
|
|
94
|
+
--_rm-sidebar-text-color: var(--rm-color-neutral-on-plus-seven);
|
|
95
|
+
|
|
96
|
+
// Active
|
|
97
|
+
--_rm-sidebar-icon-background-active-color: var(--rm-color-neutral-plus-three);
|
|
98
|
+
--_rm-sidebar-icon-text-active-color: var(--rm-color-neutral-on-plus-three);
|
|
99
|
+
|
|
100
|
+
// Hover
|
|
101
|
+
--_rm-sidebar-icon-background-hover-color: var(--rm-color-neutral-plus-four);
|
|
102
|
+
--_rm-sidebar-icon-text-hover-color: var(--rm-color-neutral-on-plus-four);
|
|
103
|
+
|
|
104
|
+
// Width
|
|
105
|
+
--_rm-sidebar-rail-width: 8.8rem;
|
|
106
|
+
--_rm-sidebar-drawer-width: 25rem;
|
|
107
|
+
|
|
108
|
+
// Spacing
|
|
109
|
+
--_rm-sidebar-spacing: var(--rm-space-medium);
|
|
110
|
+
--_rm-sidebar-link-spacing: var(--rm-space-large);
|
|
111
|
+
|
|
112
|
+
// Animation
|
|
113
|
+
--_rm-sidebar-transition: all var(--rm-transition-navigation) ease-in-out;
|
|
114
|
+
|
|
115
|
+
// Private API
|
|
116
|
+
--__rm-sidebar-width: var(--_rm-sidebar-drawer-width);
|
|
117
|
+
|
|
118
|
+
display: flex;
|
|
119
|
+
width: var(--__rm-sidebar-width);
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
padding: var(--_rm-sidebar-spacing) 0;
|
|
122
|
+
background-color: var(--_rm-sidebar-background-color);
|
|
123
|
+
color: var(--_rm-sidebar-text-color);
|
|
124
|
+
gap: var(--_rm-sidebar-spacing);
|
|
125
|
+
overflow-y: auto;
|
|
126
|
+
transition: var(--_rm-sidebar-transition);
|
|
127
|
+
|
|
128
|
+
// Elements
|
|
129
|
+
.sidebar__brand {
|
|
130
|
+
display: block;
|
|
131
|
+
padding: 0 var(--_rm-sidebar-spacing);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.sidebar__content {
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
flex-grow: 1;
|
|
138
|
+
|
|
139
|
+
&.sidebar__content--start {
|
|
140
|
+
justify-content: start;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.sidebar__content--center {
|
|
144
|
+
justify-content: center;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.sidebar__content--end {
|
|
148
|
+
justify-content: end;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.sidebar__item {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
color: var(--_rm-sidebar-text-color);
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
text-align: center;
|
|
158
|
+
text-decoration: none;
|
|
159
|
+
|
|
160
|
+
&:visited {
|
|
161
|
+
color: var(--_rm-sidebar-text-color);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:hover,
|
|
165
|
+
&.active {
|
|
166
|
+
.sidebar__item-icon {
|
|
167
|
+
--rm-mso-weight: var(--rm-font-weight-bold);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&:hover .sidebar__item-icon {
|
|
172
|
+
color: var(--_rm-sidebar-text-color);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.sidebar__item-icon {
|
|
176
|
+
/* stylelint-disable scss/at-extend-no-missing-placeholder */
|
|
177
|
+
@extend .icon--x-large;
|
|
178
|
+
/* stylelint-enable scss/at-extend-no-missing-placeholder */
|
|
179
|
+
|
|
180
|
+
--rm-mso-weight: var(--rm-font-weight-medium);
|
|
181
|
+
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: center;
|
|
185
|
+
border-radius: var(--rm-radius-pill);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.sidebar__item-label {
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
max-width: 90%;
|
|
191
|
+
font-weight: var(--rm-font-weight-medium);
|
|
192
|
+
letter-spacing: var(--rm-letter-spacing-navigation);
|
|
193
|
+
line-height: var(--rm-line-height-dense);
|
|
194
|
+
text-overflow: ellipsis;
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Modifiers
|
|
200
|
+
&.sidebar--drawer:not(.sidebar--responsive) {
|
|
201
|
+
@include sidebar-drawer-global;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&.sidebar--drawer.sidebar--responsive {
|
|
205
|
+
@media (width > $breakpoint-medium) {
|
|
206
|
+
@include sidebar-drawer-global;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media (width <= $breakpoint-medium) {
|
|
210
|
+
@include sidebar-rail-global;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.sidebar--rail {
|
|
215
|
+
@include sidebar-rail-global;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.sidebar {
|
|
220
|
+
@extend %sidebar-global;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Primary
|
|
224
|
+
.sidebar-primary {
|
|
225
|
+
@extend %sidebar-global;
|
|
226
|
+
|
|
227
|
+
// Normal
|
|
228
|
+
--_rm-sidebar-background-color: var(--rm-color-primary-plus-seven);
|
|
229
|
+
--_rm-sidebar-text-color: var(--rm-color-primary-on-plus-seven);
|
|
230
|
+
|
|
231
|
+
// Active
|
|
232
|
+
--_rm-sidebar-icon-background-active-color: var(--rm-color-primary-plus-three);
|
|
233
|
+
--_rm-sidebar-icon-text-active-color: var(--rm-color-primary-on-plus-three);
|
|
234
|
+
|
|
235
|
+
// Hover
|
|
236
|
+
--_rm-sidebar-icon-background-hover-color: var(--rm-color-primary-plus-four);
|
|
237
|
+
--_rm-sidebar-icon-text-hover-color: var(--rm-color-primary-on-plus-four);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Subtle Primary
|
|
241
|
+
.sidebar-subtle-primary {
|
|
242
|
+
@extend %sidebar-global;
|
|
243
|
+
|
|
244
|
+
// Normal
|
|
245
|
+
--_rm-sidebar-background-color: var(--rm-color-primary-plus-max);
|
|
246
|
+
--_rm-sidebar-text-color: var(--rm-color-primary-on-plus-max);
|
|
247
|
+
|
|
248
|
+
// Active
|
|
249
|
+
--_rm-sidebar-icon-background-active-color: var(--rm-color-primary-plus-three);
|
|
250
|
+
--_rm-sidebar-icon-text-active-color: var(--rm-color-primary-on-plus-three);
|
|
251
|
+
|
|
252
|
+
// Hover
|
|
253
|
+
--_rm-sidebar-icon-background-hover-color: var(--rm-color-primary-plus-four);
|
|
254
|
+
--_rm-sidebar-icon-text-hover-color: var(--rm-color-primary-on-plus-four);
|
|
255
|
+
}
|