Skip to content

Commit 3fefac4

Browse files
committed
refactor: migrate CSS @import to JS-side imports (Phase 4c)
Replace style-block @import url() with script-setup side-effect imports across 15 .vue files. Vite extracts shared CSS chunks instead of inlining the file into each consumer's stylesheet, and fallow/jscpd can now follow the dependency graph (the two CSS files no longer surface as "unused"). Behavior-preserving for report-tables.css and compact-form.css since their selectors are already class-prefixed. For schedule-shared.css, the bare h2/h3 element selectors are re-scoped under .clinical-scheduler-container so the rules keep their previous reach now that the file applies globally. Drop the redundant colors.css @import in WeekCell.vue — bootstrap-spa.ts already loads colors via styles/index.css for every SPA.
1 parent f83c4b4 commit 3fefac4

16 files changed

Lines changed: 17 additions & 60 deletions

VueApp/src/ClinicalScheduler/assets/schedule-shared.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
/* Shared typography for schedule pages */
18-
h3 {
18+
.clinical-scheduler-container h3 {
1919
color: var(--ucdavis-black-80);
2020
font-size: 16px;
2121
margin-top: 20px;
@@ -38,7 +38,7 @@ h3 {
3838

3939
/* Mobile responsiveness for main headers */
4040
@media (max-width: 768px) {
41-
h2 {
41+
.clinical-scheduler-container h2 {
4242
font-size: 18px;
4343
}
4444

@@ -93,7 +93,7 @@ h3 {
9393
}
9494

9595
@media (max-width: 480px) {
96-
h2 {
96+
.clinical-scheduler-container h2 {
9797
font-size: 16px;
9898
}
9999
}

VueApp/src/ClinicalScheduler/components/WeekCell.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ const cardClasses = computed(() => {
355355
</script>
356356

357357
<style scoped>
358-
@import url("@/styles/colors.css");
359-
360358
.week-schedule-card {
361359
max-width: 280px;
362360
min-width: 200px;

VueApp/src/ClinicalScheduler/pages/ClinicianScheduleView.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ import { UI_CONFIG } from "../constants/app-constants"
191191
import { isRotationExcluded } from "../constants/rotation-constants"
192192
import { SCHEDULE_MESSAGES, SCHEDULE_LABELS } from "../constants/schedule-config"
193193
import { usePermissionChecks } from "../composables/use-permission-checks"
194+
import "../assets/schedule-shared.css"
194195
195196
// Interface for clinician rotation item
196197
interface ClinicianRotationItem {
@@ -1353,9 +1354,6 @@ watch(
13531354
</script>
13541355

13551356
<style scoped>
1356-
/* Import shared schedule styles */
1357-
@import url("../assets/schedule-shared.css");
1358-
13591357
/* Clinician page specific styling */
13601358
@media (width <= 768px) {
13611359
/* Extra spacing for clinician selector to match rotation page */

VueApp/src/ClinicalScheduler/pages/RotationScheduleView.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ import ClinicianSelector from "../components/ClinicianSelector.vue"
221221
import YearSelector from "../components/YearSelector.vue"
222222
import SchedulerNavigation from "../components/SchedulerNavigation.vue"
223223
import type { WeekItem } from "../components/WeekScheduleCard.vue"
224+
import "../assets/schedule-shared.css"
224225
import StatusBanner from "@/components/StatusBanner.vue"
225226
import RecentSelections from "../components/RecentSelections.vue"
226227
import AccessDeniedCard from "../components/AccessDeniedCard.vue"
@@ -1238,9 +1239,6 @@ onMounted(() => initPage())
12381239
</script>
12391240

12401241
<style scoped>
1241-
/* Import shared schedule styles */
1242-
@import url("../assets/schedule-shared.css");
1243-
12441242
/* No access section */
12451243
.no-access-container {
12461244
display: flex;

VueApp/src/Effort/pages/ClinicalEffort.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ import { useEffortTypeColumns, getEffortTypeLabel, loadEffortTypeLabels } from "
180180
import ExportToolbar from "@/components/ExportToolbar.vue"
181181
import ReportLayout from "../components/ReportLayout.vue"
182182
import type { ClinicalEffortReport } from "../types"
183+
import "../report-tables.css"
183184
184185
const $q = useQuasar()
185186
const route = useRoute()
@@ -309,10 +310,6 @@ async function initPage() {
309310
onMounted(() => initPage())
310311
</script>
311312

312-
<style>
313-
@import url("../report-tables.css");
314-
</style>
315-
316313
<style scoped>
317314
:deep(.report-table tbody tr) {
318315
border-bottom: 1px solid var(--ucdavis-black-20);

VueApp/src/Effort/pages/DeptSummary.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ import ReportFilterForm from "../components/ReportFilterForm.vue"
165165
import ReportLayout from "../components/ReportLayout.vue"
166166
import ReportDeptTabs from "../components/ReportDeptTabs.vue"
167167
import type { DeptSummaryReport } from "../types"
168+
import "../report-tables.css"
168169
169170
const {
170171
termCode,
@@ -187,8 +188,4 @@ const {
187188
})
188189
</script>
189190

190-
<style>
191-
@import url("../report-tables.css");
192-
</style>
193-
194191
<style scoped></style>

VueApp/src/Effort/pages/EvalDetail.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ import ReportFilterForm from "../components/ReportFilterForm.vue"
163163
import ReportLayout from "../components/ReportLayout.vue"
164164
import ReportDeptTabs from "../components/ReportDeptTabs.vue"
165165
import type { EvalDetailReport } from "../types"
166+
import "../report-tables.css"
166167
167168
const { termCode, loading, report, initialFilters, generateReport, handlePrint, handleExcelDownload } =
168169
useReportPage<EvalDetailReport>({
@@ -180,10 +181,6 @@ function formatNullableDecimal(value: number | null): string {
180181
}
181182
</script>
182183

183-
<style>
184-
@import url("../report-tables.css");
185-
</style>
186-
187184
<style scoped>
188185
.col-numeric {
189186
text-align: right;

VueApp/src/Effort/pages/EvalSummary.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ import ReportFilterForm from "../components/ReportFilterForm.vue"
106106
import ReportLayout from "../components/ReportLayout.vue"
107107
import ReportDeptTabs from "../components/ReportDeptTabs.vue"
108108
import type { EvalSummaryReport } from "../types"
109+
import "../report-tables.css"
109110
110111
const { termCode, loading, report, initialFilters, generateReport, handlePrint, handleExcelDownload } =
111112
useReportPage<EvalSummaryReport>({
@@ -119,10 +120,6 @@ function formatDecimal(value: number): string {
119120
}
120121
</script>
121122

122-
<style>
123-
@import url("../report-tables.css");
124-
</style>
125-
126123
<style scoped>
127124
.report-table {
128125
width: 50%;

VueApp/src/Effort/pages/MeritAverage.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ import ReportFilterForm from "../components/ReportFilterForm.vue"
201201
import ReportLayout from "../components/ReportLayout.vue"
202202
import ReportDeptTabs from "../components/ReportDeptTabs.vue"
203203
import type { MeritAverageReport } from "../types"
204+
import "../report-tables.css"
204205
205206
const {
206207
termCode,
@@ -223,10 +224,6 @@ const {
223224
})
224225
</script>
225226

226-
<style>
227-
@import url("../report-tables.css");
228-
</style>
229-
230227
<style scoped>
231228
.term-cell {
232229
font-size: 0.85em;

VueApp/src/Effort/pages/MeritDetail.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ import ReportFilterForm from "../components/ReportFilterForm.vue"
195195
import ReportLayout from "../components/ReportLayout.vue"
196196
import ReportDeptTabs from "../components/ReportDeptTabs.vue"
197197
import type { MeritDetailReport } from "../types"
198+
import "../report-tables.css"
198199
199200
const {
200201
termCode,
@@ -216,8 +217,4 @@ const {
216217
})
217218
</script>
218219

219-
<style>
220-
@import url("../report-tables.css");
221-
</style>
222-
223220
<style scoped></style>

0 commit comments

Comments
 (0)