Skip to content

Commit 5ead841

Browse files
fix: ensure default ionic css is added before user overrides (#570)
1 parent 4c7ff8e commit 5ead841

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

playground/assets/css/ionic.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:root {
2+
--ion-color-primary: #6030ff;
3+
--ion-color-primary-rgb: 96, 48, 255;
4+
--ion-color-primary-contrast: #ffffff;
5+
--ion-color-primary-contrast-rgb: 255, 255, 255;
6+
--ion-color-primary-shade: #542ae0;
7+
--ion-color-primary-tint: #7045ff;
8+
}

playground/nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default defineNuxtConfig({
22
modules: ['@nuxtjs/ionic'],
3+
css: ['~/assets/css/ionic.css'],
34
ionic: {
45
// integrations: {
56
// icons: true,

src/parts/css.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export const useCSSSetup = () => {
55

66
const setupCore = () => {
77
// Core CSS required for Ionic components to work properly
8-
nuxt.options.css.push('@ionic/vue/css/core.css')
8+
nuxt.options.css.unshift('@ionic/vue/css/core.css')
99
}
1010

1111
const setupBasic = () => {
1212
// Basic CSS for apps built with Ionic
13-
nuxt.options.css.push(
13+
nuxt.options.css.unshift(
1414
'@ionic/vue/css/normalize.css',
1515
'@ionic/vue/css/structure.css',
1616
'@ionic/vue/css/typography.css',
@@ -19,7 +19,7 @@ export const useCSSSetup = () => {
1919

2020
const setupUtilities = () => {
2121
// Optional CSS utils that can be commented out
22-
nuxt.options.css.push(
22+
nuxt.options.css.unshift(
2323
'@ionic/vue/css/padding.css',
2424
'@ionic/vue/css/float-elements.css',
2525
'@ionic/vue/css/text-alignment.css',

0 commit comments

Comments
 (0)