Skip to content

Commit aea4196

Browse files
danielroeantfu
andcommitted
perf: only load vue-data-ui css in components that use it
Co-authored-by: Anthony Fu <github@antfu.me>
1 parent 9216309 commit aea4196

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

app/components/Package/TrendsChart.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,6 +2181,8 @@ watch(selectedMetric, value => {
21812181
</template>
21822182

21832183
<style>
2184+
@import 'vue-data-ui/style.css';
2185+
21842186
.vue-ui-pen-and-paper-actions {
21852187
background: var(--bg-elevated) !important;
21862188
}

app/components/Package/VersionDistribution.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ const chartConfig = computed<VueUiXyConfig>(() => {
672672
</style>
673673

674674
<style>
675+
@import 'vue-data-ui/style.css';
676+
675677
/* Override default placement of the refresh button to have it to the minimap's side */
676678
@media screen and (min-width: 767px) {
677679
#version-distribution .vue-data-ui-refresh-button {

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ const config = computed<VueUiSparklineConfig>(() => {
498498
</style>
499499

500500
<style>
501+
@import 'vue-data-ui/style.css';
502+
501503
/** Overrides */
502504
.vue-ui-sparkline-title span {
503505
padding: 0 !important;

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineNuxtConfig({
3131
storageKey: 'npmx-color-mode',
3232
},
3333

34-
css: ['~/assets/main.css', 'vue-data-ui/style.css'],
34+
css: ['~/assets/main.css'],
3535

3636
runtimeConfig: {
3737
sessionPassword: '',

0 commit comments

Comments
 (0)