-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathstyles.scss
267 lines (217 loc) · 5.43 KB
/
styles.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// Please take note of the order in which these are imported
@import 'tailwindcss/base.css' layer(tailwind-base);
@import 'primeicons/primeicons.css';
@import 'tailwindcss/components.css' layer(tailwind-utilities);
@import 'tailwindcss/utilities.css' layer(tailwind-utilities);
html {
font-size: calc(14 / 16 * 1rem);
}
body {
@apply bg-grey-100 font-body text-black;
overflow-y: scroll; /* Always show scrollbars to avoid page skipping about */
}
:root {
// primeng uses this variable on all of its components by default
// and it does not work if we set it within the 'primeng' layer
--font-family: theme(fontFamily.body);
}
@layer tailwind-base {
h1 {
@apply font-bold txt-h-1;
}
h2 {
@apply font-bold txt-h-2;
}
h3 {
@apply font-bold txt-h-3;
}
strong,
b {
@apply font-semibold;
}
p a,
p .p-button-link {
@apply text-blue-500;
@apply underline;
}
}
.mention-menu {
@apply shadow-menu;
li {
.mention-item {
@apply py-2 font-semibold text-black txt-body-m #{!important};
}
&.mention-active {
@apply bg-purple-100;
a {
background: inherit !important;
}
}
}
}
// PrimeNG Component overrides
// Rule-of-thumb: Override only from any specific component class-name(i.e. `.p-component-X`) 'down'.
// Following the pattern:
//
// .p-component-X {
// .p-component-X-element {
// // Override styles here
// }
// }
//
// So there will only be ONE section/grouping per PrimeNG component.
//
@layer primeng-customisations {
$toolbar-height: calc(48 / 14 * 1rem);
.p-button {
.p-button-label {
@apply txt-system-bold-m;
}
&.p-button-sm {
@apply txt-system-s;
}
&.p-button-link {
@apply p-0;
}
}
.p-card {
@apply text-black;
.p-card-title {
@apply pb-2 pl-2 font-bold text-black txt-h-2;
}
}
.p-drawer {
color: inherit;
.p-drawer-header {
@apply pl-3;
height: $toolbar-height - 2;
.p-drawer-icon {
margin-inline-start: 0;
height: 33px;
width: 33px;
}
}
.p-drawer-content {
padding-inline-start: 0;
padding-inline-end: 0;
}
}
.p-toolbar {
@apply rounded-none border-x-0 border-t-0 border-b-purple bg-navy py-0;
height: $toolbar-height;
flex-wrap: nowrap !important;
.p-toolbar-group-start {
white-space: nowrap;
overflow: hidden;
}
}
.p-datatable {
// Apply these styles ONLY when the table is INSIDE a Card
.p-card & {
.p-datatable-header {
@apply px-0 pb-4 pt-0;
}
.p-paginator {
@apply border-b-0 pb-0 pt-4;
.p-paginator-current {
@apply me-auto ms-0 ps-0 txt-system-s;
}
}
}
.p-datatable-thead > tr > th {
@apply bg-grey-50 text-black;
}
.p-datatable-sortable-column {
&:not(.p-datatable-column-sorted),
&.p-datatable-column-sorted {
@apply bg-grey-50 text-black;
&:hover,
&:focus-within {
@apply bg-purple-100 text-purple-700;
}
}
&.p-datatable-column-sorted {
.p-sortable-column-icon {
@apply text-purple-700;
}
}
}
// Styling for the filter button when active
// Currently broken: /~https://github.com/primefaces/primeng/issues/16576
// .p-datatable-column-filter-button.p-column-filter-menu-button-active,
// .p-datatable-column-filter-button.p-column-filter-menu-button-active:hover,
// .p-datatable-column-filter-button.p-column-filter-menu-button-active:focus {
// @apply bg-purple-100 text-purple-700;
// }
}
.p-chip .p-chip-label {
@apply font-semibold txt-body-m;
}
// All form-inputs should be full-width, a wrapper should be in control of the width.
.p-password,
.p-select,
.p-multiselect {
@apply w-full;
.p-select-overlay,
.p-multiselect-overlay {
@apply max-w-full;
}
.p-paginator & {
@apply w-auto;
}
}
.p-password {
.p-password-input {
@apply font-mono; // Improve readability and spot typos between similar characters (o,O,0 or i,l,L,1 etc.)
}
}
.p-multiselect {
// Prevent contents being cut off, always wrap and align checkboxes to the top
.p-multiselect-item {
@apply items-start text-wrap;
}
}
// To be able to remove this rule we need to be able to mark all form fields as "dirty" instead of "touched" on form submit
// Waiting for this to be merged & released in angular: /~https://github.com/angular/angular/pull/58663#issuecomment-2476844180
.p-inputwrapper,
.p-textarea,
.p-checkbox-box,
.p-inputtext {
&.ng-touched.ng-invalid,
[formcontrolname].ng-touched.ng-invalid & {
border-color: theme('colors.red.500') !important;
}
}
.p-contextmenu,
.p-menu {
@apply w-auto;
.p-menuitem-text {
@apply whitespace-nowrap;
}
}
.p-fileupload.p-fileupload-advanced {
@apply rounded-[16px] border border-dashed border-grey-500;
.ng-touched.ng-invalid & {
@apply border-red-500;
}
.p-fileupload-header,
p-progressbar {
display: none;
}
.p-fileupload-filename,
.p-fileupload-filename + div {
@apply txt-system-s;
}
.p-fileupload-filename ~ * {
@apply grow-0;
}
}
.p-progress-spinner-svg .p-progress-spinner-circle {
@apply stroke-purple-700 #{!important};
}
.p-toast {
.p-toast-close-button {
@apply text-grey-700;
}
}
}