Skip to content

Commit 218118b

Browse files
committed
chore: setup scss
1 parent 89f6610 commit 218118b

15 files changed

Lines changed: 4527 additions & 143 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ vendor-bs5: ## update bootstrap5 theme
3535

3636
vendor: vendor-tailwind vendor-bulma vendor-pico vendor-bs5 ## update all vendor files
3737

38-
watch-%: ## track and compile changes in typescript of specified theme
38+
watch-theme-bare:
39+
npx sass ckanext/theming/themes/bare/assets/scss/style.scss ckanext/theming/themes/bare/assets/style.css -w
40+
41+
watch-script-%: ## track and compile changes in typescript of specified theme
3942
npx tsc -p tsconfig.$*.json -w

ckanext/theming/themes/bare/assets/grid.css renamed to ckanext/theming/themes/bare/assets/scss/_grid.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "base/_variables" as v;
2+
13
/* GRID WRAPPER */
24
.grid {
35
display: grid;
@@ -23,7 +25,7 @@
2325
.col-12 { grid-column: span 12; }
2426

2527
/* BREAKPOINTS */
26-
@media (min-width: 576px) { /* sm */
28+
@media (min-width: v.$breakpoint-sm) { /* sm */
2729
.col-sm-1 { grid-column: span 1; }
2830
.col-sm-2 { grid-column: span 2; }
2931
.col-sm-3 { grid-column: span 3; }
@@ -38,7 +40,7 @@
3840
.col-sm-12 { grid-column: span 12; }
3941
}
4042

41-
@media (min-width: 768px) { /* md */
43+
@media (min-width: v.$breakpoint-md) { /* md */
4244
.col-md-1 { grid-column: span 1; }
4345
.col-md-2 { grid-column: span 2; }
4446
.col-md-3 { grid-column: span 3; }
@@ -53,7 +55,7 @@
5355
.col-md-12 { grid-column: span 12; }
5456
}
5557

56-
@media (min-width: 992px) { /* lg */
58+
@media (min-width: v.$breakpoint-lg) { /* lg */
5759
.col-lg-1 { grid-column: span 1; }
5860
.col-lg-2 { grid-column: span 2; }
5961
.col-lg-3 { grid-column: span 3; }
@@ -68,7 +70,7 @@
6870
.col-lg-12 { grid-column: span 12; }
6971
}
7072

71-
@media (min-width: 1200px) { /* xl */
73+
@media (min-width: v.$breakpoint-xl) { /* xl */
7274
.col-xl-1 { grid-column: span 1; }
7375
.col-xl-2 { grid-column: span 2; }
7476
.col-xl-3 { grid-column: span 3; }
@@ -83,7 +85,7 @@
8385
.col-xl-12 { grid-column: span 12; }
8486
}
8587

86-
@media (min-width: 1400px) { /* xxl */
88+
@media (min-width: v.$breakpoint-xxl) { /* xxl */
8789
.col-xxl-1 { grid-column: span 1; }
8890
.col-xxl-2 { grid-column: span 2; }
8991
.col-xxl-3 { grid-column: span 3; }
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
/* Accessibility enhancements */
2+
3+
/* Focus management */
4+
*:focus {
5+
outline: var(--focus-width) var(--focus-style) var(--focus-color);
6+
outline-offset: 2px;
7+
}
8+
9+
*:focus:not(:focus-visible) {
10+
outline: none;
11+
}
12+
13+
*:focus-visible {
14+
outline: var(--focus-width) var(--focus-style) var(--focus-color);
15+
outline-offset: 2px;
16+
box-shadow: var(--focus-box-shadow);
17+
}
18+
19+
/* High contrast mode support */
20+
@media (prefers-contrast: high) {
21+
* {
22+
border-color: CanvasText !important;
23+
}
24+
25+
.btn {
26+
border: 2px solid CanvasText !important;
27+
}
28+
29+
a {
30+
text-decoration: underline !important;
31+
}
32+
}
33+
34+
/* Reduced motion support */
35+
@media (prefers-reduced-motion: reduce) {
36+
*,
37+
*::before,
38+
*::after {
39+
animation-duration: 0.01ms !important;
40+
animation-iteration-count: 1 !important;
41+
transition-duration: 0.01ms !important;
42+
}
43+
}
44+
45+
/* Screen reader only content */
46+
.sr-only {
47+
position: absolute !important;
48+
width: 1px !important;
49+
height: 1px !important;
50+
padding: 0 !important;
51+
margin: -1px !important;
52+
overflow: hidden !important;
53+
clip: rect(0, 0, 0, 0) !important;
54+
white-space: nowrap !important;
55+
border: 0 !important;
56+
}
57+
58+
/* Visually hidden but accessible to screen readers */
59+
.visually-hidden {
60+
position: absolute !important;
61+
width: 1px !important;
62+
height: 1px !important;
63+
padding: 0 !important;
64+
margin: -1px !important;
65+
overflow: hidden !important;
66+
clip: rect(0, 0, 0, 0) !important;
67+
white-space: nowrap !important;
68+
border: 0 !important;
69+
}
70+
71+
/* Skip link for keyboard navigation */
72+
.skip-to-content {
73+
position: absolute;
74+
top: -40px;
75+
left: 6px;
76+
background: var(--color-primary);
77+
color: var(--color-white);
78+
padding: 8px;
79+
z-index: 10000;
80+
text-decoration: none;
81+
}
82+
83+
.skip-to-content:focus {
84+
top: 6px;
85+
}
86+
87+
/* Better contrast for links */
88+
a {
89+
color: var(--text-link);
90+
text-decoration: underline;
91+
text-decoration-thickness: 1px;
92+
text-underline-offset: 2px;
93+
}
94+
95+
a:hover,
96+
a:focus-visible {
97+
text-decoration-thickness: 2px;
98+
text-underline-offset: 3px;
99+
}
100+
101+
/* Alerts for screen readers */
102+
.alert--sr {
103+
position: absolute !important;
104+
width: 1px !important;
105+
height: 1px !important;
106+
padding: 0 !important;
107+
margin: -1px !important;
108+
overflow: hidden !important;
109+
clip: rect(0, 0, 0, 0) !important;
110+
white-space: nowrap !important;
111+
border: 0 !important;
112+
}
113+
114+
/* ARIA live regions */
115+
[aria-live="polite"],
116+
[aria-live="assertive"] {
117+
position: absolute !important;
118+
width: 1px !important;
119+
height: 1px !important;
120+
padding: 0 !important;
121+
margin: -1px !important;
122+
overflow: hidden !important;
123+
clip: rect(0, 0, 0, 0) !important;
124+
white-space: nowrap !important;
125+
border: 0 !important;
126+
}
127+
128+
/* Semantic landmark roles */
129+
[role="banner"] {
130+
display: block;
131+
}
132+
133+
[role="navigation"] {
134+
display: block;
135+
}
136+
137+
[role="main"] {
138+
display: block;
139+
}
140+
141+
[role="contentinfo"] {
142+
display: block;
143+
}
144+
145+
/* Table accessibility */
146+
table {
147+
border-collapse: collapse;
148+
width: 100%;
149+
}
150+
151+
th {
152+
font-weight: var(--font-weight-bold);
153+
text-align: left;
154+
vertical-align: top;
155+
}
156+
157+
caption {
158+
font-weight: var(--font-weight-bold);
159+
margin-bottom: 0.5rem;
160+
text-align: left;
161+
}
162+
163+
/* Input validation accessibility */
164+
input[aria-invalid="true"],
165+
select[aria-invalid="true"],
166+
textarea[aria-invalid="true"] {
167+
border: 2px solid var(--color-danger);
168+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
169+
}
170+
171+
input[aria-invalid="true"]:focus,
172+
select[aria-invalid="true"]:focus,
173+
textarea[aria-invalid="true"]:focus {
174+
box-shadow: var(--focus-box-shadow), inset 0 1px 2px rgba(0, 0, 0, 0.1);
175+
}
176+
177+
/* Icon accessibility */
178+
.icon {
179+
display: inline-block;
180+
width: 1em;
181+
height: 1em;
182+
vertical-align: -0.125em;
183+
fill: currentColor;
184+
}
185+
186+
.icon:focus {
187+
outline: var(--focus-width) var(--focus-style) var(--focus-color);
188+
}
189+
190+
/* Better button focus */
191+
.btn:focus,
192+
button:focus,
193+
input[type="submit"]:focus,
194+
input[type="button"]:focus {
195+
box-shadow: var(--focus-box-shadow);
196+
}

0 commit comments

Comments
 (0)