Skip to content

Commit

Permalink
fix: import order of windicss
Browse files Browse the repository at this point in the history
  • Loading branch information
upupming committed Nov 3, 2021
1 parent 7e383d3 commit a7adc41
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 89 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ jobs:
with:
branch: gh-pages # The branch the action should deploy to.
folder: vue3-compact-template # The folder the action should deploy.
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'
86 changes: 41 additions & 45 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,61 +48,57 @@ import IconGitHub from '~icons/mdi/github'
</template>

<style lang="less">
@layer base {
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
text-decoration: none;
color: hsl(160deg 100% 37% / 100%);
transition: 0.4s;
}
a {
text-decoration: none;
color: hsl(160deg 100% 37% / 100%);
transition: 0.4s;
}
a:hover {
background-color: hsl(160deg 100% 37% / 20%);
}
a:hover {
background-color: hsl(160deg 100% 37% / 20%);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
position: relative;
font-weight: normal;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
position: relative;
font-weight: normal;
}
:root {
--color-border: rgb(60 60 60 / 12%);
--section-gap: 160px;
}
:root {
--color-border: rgb(60 60 60 / 12%);
--section-gap: 160px;
}
@layer components {
.nav-item {
@apply py-1 px-2 hover:bg-[#42b983dd] bg-[#42b983ee] active:bg-[#42b983ff] text-white rounded;
}
.nav-item {
@apply py-1 px-2 hover:bg-[#42b983dd] bg-[#42b983ee] active:bg-[#42b983ff] text-white rounded;
}
.router-link-exact-active {
@apply font-bold;
}
.router-link-exact-active {
@apply font-bold;
}
.btn {
@apply px-4 py-1 rounded inline-block
bg-teal-600 text-white cursor-pointer
hover:bg-teal-700
disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50;
}
.btn {
@apply px-4 py-1 rounded inline-block
bg-teal-600 text-white cursor-pointer
hover:bg-teal-700
disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50;
}
.icon-btn {
@apply inline-block cursor-pointer select-none
opacity-75 transition duration-200 ease-in-out
hover:opacity-100 hover:text-teal-600;
.icon-btn {
@apply inline-block cursor-pointer select-none
opacity-75 transition duration-200 ease-in-out
hover:opacity-100 hover:text-teal-600;
font-size: 0.9em;
}
font-size: 0.9em;
}
</style>
34 changes: 16 additions & 18 deletions src/components/TemplateIntroduction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,24 @@ const counter = useCounterStore()
</div>
</template>

<style scoped>
@layer base {
a {
color: #42b983;
}
<style>
a {
color: #42b983;
}
label {
margin: 0 0.5em;
font-weight: bold;
}
label {
margin: 0 0.5em;
font-weight: bold;
}
code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px;
color: #304455;
}
code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px;
color: #304455;
}
p {
@apply my-4;
}
p {
@apply my-4;
}
</style>
38 changes: 18 additions & 20 deletions src/components/WelcomeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,25 @@
</div>
</template>

<style scoped>
@layer base {
h3 {
font-size: 1.2rem;
font-weight: 500;
margin-bottom: 0.4rem;
color: #2c3e50;
}
<style>
h3 {
font-size: 1.2rem;
font-weight: 500;
margin-bottom: 0.4rem;
color: #2c3e50;
}
i {
display: flex;
place-items: center;
place-content: center;
top: calc(50% - 25px);
left: -26px;
position: absolute;
border: 1px solid var(--color-border);
border-radius: 8px;
width: 50px;
height: 50px;
}
i {
display: flex;
place-items: center;
place-content: center;
top: calc(50% - 25px);
left: -26px;
position: absolute;
border: 1px solid var(--color-border);
border-radius: 8px;
width: 50px;
height: 50px;
}
.item {
Expand Down
13 changes: 7 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
import { routes } from './routes'

// CSS must be imported before .vue files to ensure that the styles defined in .vue files cam overwrite the default base styles
// windicss layers
import 'virtual:windi-base.css'
import 'virtual:windi-components.css'
Expand All @@ -14,6 +9,12 @@ import 'virtual:windi-utilities.css'
// windicss devtools support (dev only)
import 'virtual:windi-devtools'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
import { routes } from './routes'

const router = createRouter({
// 4. Provide the history implementation to use. We are using the hash history for simplicity here.
history: createWebHashHistory(),
Expand Down

0 comments on commit a7adc41

Please sign in to comment.