diff --git a/src/assets/style/reset.css b/src/assets/style/reset.css new file mode 100644 index 0000000..9301bd3 --- /dev/null +++ b/src/assets/style/reset.css @@ -0,0 +1,67 @@ +/* src/assets/styles/reset.css */ +/* 常用的现代 CSS Reset */ +:where(:root) { + line-height: 1.5; + -webkit-text-size-adjust: 100%; +} + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +:where(html) { + -moz-tab-size: 4; + tab-size: 4; +} + +:where(body) { + font-family: + system-ui, + -apple-system, + sans-serif; +} + +:where(a) { + background-color: transparent; + color: inherit; + text-decoration: none; +} + +:where(img, picture, svg, video, canvas) { + display: block; + max-width: 100%; +} + +/* 移除列表默认样式 */ +:where(ul, ol) { + list-style: none; +} + +/* 表单元素重置 */ +:where(input, button, textarea, select) { + font: inherit; + color: inherit; + border: none; + background: none; +} + +/* 表格重置 */ +:where(table) { + border-collapse: collapse; + border-spacing: 0; +} + +/* 隐藏不可见但可访问的元素 */ +:where([hidden]) { + display: none !important; +} + +/* 现代 focus 样式 */ +:focus-visible { + outline: 2px solid currentColor; + outline-offset: 2px; +} diff --git a/src/main.js b/src/main.js index 05fad48..7d79477 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,10 @@ -import { createApp } from 'vue' -import App from './App.vue' -import ElementPlus from 'element-plus' +import { createApp } from "vue"; +import App from "./App.vue"; +import ElementPlus from "element-plus"; +import "./assets/style/reset.css"; +import router from "./router"; -import router from './router' - -const app = createApp(App) -app.use(ElementPlus) -app.use(router) -app.mount('#app') \ No newline at end of file +const app = createApp(App); +app.use(ElementPlus); +app.use(router); +app.mount("#app"); diff --git a/src/style.css b/src/style.css deleted file mode 100644 index e69de29..0000000