From: Haoqun Jiang Date: Tue, 12 Jul 2022 10:16:18 +0000 (+0800) Subject: refactor: move global styles to `main.css`; use only scoped styles in `App.vue` X-Git-Tag: v3.2.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e08d04e562abc105a0445b442ccc3c12f850c4a1;p=thirdparty%2Fvuejs%2Fcreate-vue.git refactor: move global styles to `main.css`; use only scoped styles in `App.vue` - `base.css` contains CSS resets and variables - `main.css` is the global styles of the app, to be imported by `main.js` - `App.vue` only contains the styles for the root `App` component --- diff --git a/template/base/src/assets/main.css b/template/base/src/assets/main.css new file mode 100644 index 00000000..c133f915 --- /dev/null +++ b/template/base/src/assets/main.css @@ -0,0 +1,35 @@ +@import "./base.css"; + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} + +@media (min-width: 1024px) { + body { + display: flex; + place-items: center; + } + + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } +} diff --git a/template/code/default/src/App.vue b/template/code/default/src/App.vue index b0b6901b..633a5dfe 100644 --- a/template/code/default/src/App.vue +++ b/template/code/default/src/App.vue @@ -17,17 +17,7 @@ import TheWelcome from './components/TheWelcome.vue' - diff --git a/template/code/router/src/App.vue b/template/code/router/src/App.vue index 460e5b29..3ebaac91 100644 --- a/template/code/router/src/App.vue +++ b/template/code/router/src/App.vue @@ -20,17 +20,7 @@ import HelloWorld from '@/components/HelloWorld.vue' - diff --git a/template/code/typescript-router/src/App.vue b/template/code/typescript-router/src/App.vue index 7de68e9b..ebf59d59 100644 --- a/template/code/typescript-router/src/App.vue +++ b/template/code/typescript-router/src/App.vue @@ -20,17 +20,7 @@ import HelloWorld from '@/components/HelloWorld.vue' -