当前位置: 首页 > news >正文

vue3 集成 Sass

创建全局默认样式
在src 文件夹下 创建 styles 并创建 index.scss 引入到项目

import '@/styles/index.scss'

配置scss 全局变量 @import “./src/styles/variable.scss”; 冒号不能少不然会报错

export default defineConfig({plugins: [vue(),createSvgIconsPlugin({// 指定需要缓存的图标文件夹iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],// 指定symbolId格式symbolId: 'icon-[dir]-[name]',})],// 配置 @ 导入resolve: {alias: {"@": path.resolve("./src")}},// 配置scss 全局配置变量css: {preprocessorOptions: {scss: {javascriptEnabled: true,additionalData: '@import "./src/styles/variable.scss";',}}}
})

清除全局样式 reset.scss

/*** ENGINE* v0.2 | 20150615* License: none (public domain)*/*,*:after,*:before {box-sizing: border-box;outline: none;}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {font: inherit;font-size: 100%;margin: 0;padding: 0;vertical-align: baseline;border: 0;}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {display: block;}body {line-height: 1;}ol,ul {list-style: none;}blockquote,q {quotes: none;&:before,&:after {content: '';content: none;}}sub,sup {font-size: 75%;line-height: 0;position: relative;vertical-align: baseline;}sup {top: -.5em;}sub {bottom: -.25em;}table {border-spacing: 0;border-collapse: collapse;}input,textarea,button {font-family: inhert;font-size: inherit;color: inherit;}select {text-indent: .01px;text-overflow: '';border: 0;border-radius: 0;-webkit-appearance: none;-moz-appearance: none;}select::-ms-expand {display: none;}code,pre {font-family: monospace, monospace;font-size: 1em;}

http://www.mrgr.cn/news/7070.html

相关文章:

  • Python-基础-函数
  • “易碎”的留守农村人,都在被AI智能监控“兜住”
  • ELK日志系统
  • docker容器数据卷、数据卷基本案例
  • C# 一个队列两个线程,一个线程入,一个线程出,数据不一致的原因
  • 区间合并+并查集
  • linux增删用户
  • 蓝桥杯编程题讲解
  • linux中对.jar文件的配置文件进行修改
  • 发展数控教育机床提高制造创新能力
  • MS sqlserver备份软件 SQLBackupAndFTP
  • 问答泛单页目录站群通用程序——码山侠
  • 【全网行为管理解决方案】上网行为系统有哪些?
  • [运算放大器系列]四、PT100和热电偶采集电路分析
  • 【从问题中去学习k8s】k8s中的常见面试题(夯实理论基础)(十六)
  • 设计模式反模式及UML图示常见误用案例分析
  • 设计模式—代理模式
  • 【深度学习】LLaMA-Factory 大模型微调工具, 微调GLM-4-9B-Chat-1M ,Docker (4)
  • 使用微软Detours库进行DLL注入
  • CSS背景与边框——WEB开发系列18