重置默认css

This commit is contained in:
qumeng039@126.com 2025-06-24 18:02:12 +08:00
parent 2381e0241c
commit c6a0a50e9c
3 changed files with 76 additions and 9 deletions

View File

@ -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;
}

View File

@ -1,10 +1,10 @@
import { createApp } from 'vue' import { createApp } from "vue";
import App from './App.vue' import App from "./App.vue";
import ElementPlus from 'element-plus' 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);
const app = createApp(App) app.use(router);
app.use(ElementPlus) app.mount("#app");
app.use(router)
app.mount('#app')

View File