Skip to content

Commit

Permalink
feat: 引入 postcss-nested
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Aug 26, 2024
1 parent 844adee commit 606b8ef
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 22 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"plop": "^4.0.1",
"postcss": "^8.4.41",
"postcss-mobile-forever": "^4.1.5",
"postcss-nested": "^6.2.0",
"sass": "^1.77.8",
"simple-git-hooks": "^2.11.1",
"stylelint": "^16.8.1",
Expand Down
4 changes: 2 additions & 2 deletions plop-templates/component/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ defineOptions({
</div>
</template>

<style lang="scss" scoped>
// 样式
<style scoped>
/* 样式 */
</style>
4 changes: 2 additions & 2 deletions plop-templates/page/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ definePage({
</PageLayout>
</template>

<style lang="scss" scoped>
// 样式
<style scoped>
/* 样式 */
</style>
26 changes: 17 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export default {
plugins: {
'autoprefixer': {},
'postcss-nested': {},
'postcss-mobile-forever': {
viewportWidth: 375,
maxDisplayWidth: 600,
Expand All @@ -8,6 +10,5 @@ export default {
'van-popup',
],
},
'autoprefixer': {},
},
}
6 changes: 3 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ const enableAppSetting = import.meta.env.VITE_APP_SETTING === 'true'
</Provider>
</template>

<style lang="scss" scoped>
<style scoped>
.app-setting {
--at-apply: text-white dark-text-dark bg-ui-primary;
--uno: text-white dark-text-dark bg-ui-primary;
position: fixed;
top: 70%;
Expand Down Expand Up @@ -108,7 +108,7 @@ const enableAppSetting = import.meta.env.VITE_APP_SETTING === 'true'
transform: translateY(100%);
}
// 主内容区动画
/* 主内容区动画 */
.fade-enter-active {
transition: 0.2s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body {
box-sizing: inherit;
}

// 全局样式
/* 全局样式 */
#app {
overflow: hidden auto;
font-size: 14px;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/PageLayout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function handleBackTopClick() {
</div>
</template>
<style lang="scss" scoped>
<style scoped>
.navbar {
position: fixed;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'virtual:svg-icons-register'
import 'virtual:uno.css'

// 全局样式
import '@/assets/styles/globals.scss'
import '@/assets/styles/globals.css'

const app = createApp(App)

Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRouter, createWebHashHistory } from 'vue-router/auto'
import { routes } from 'vue-router/auto-routes'
import path from 'path-browserify'
import { useNProgress } from '@vueuse/integrations/useNProgress'
import '@/assets/styles/nprogress.scss'
import '@/assets/styles/nprogress.css'
import useSettingsStore from '@/store/modules/settings'
import useUserStore from '@/store/modules/user'
import useKeepAliveStore from '@/store/modules/keepAlive'
Expand Down
2 changes: 1 addition & 1 deletion src/views/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function testAccount(account: string) {
</PageLayout>
</template>

<style lang="scss" scoped>
<style scoped>
.svg {
position: absolute;
bottom: 0;
Expand Down

0 comments on commit 606b8ef

Please sign in to comment.