Преглед на файлове

Add reset.css into theme-deafult

qingwei.li преди 8 години
родител
ревизия
ed299e9003
променени са 3 файла, в които са добавени 78 реда и са изтрити 11 реда
  1. 5 11
      examples/app.vue
  2. 1 0
      examples/pages/template/index.tpl
  3. 72 0
      packages/theme-default/src/reset.css

+ 5 - 11
examples/app.vue

@@ -1,6 +1,7 @@
 <style lang="css">
   @import 'highlight.js/styles/color-brewer.css';
   @import 'assets/styles/common.css';
+  @import 'packages/theme-default/src/reset.css';
 
   html, body {
     margin: 0;
@@ -13,22 +14,15 @@
   }
 
   body {
-    font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
-    overflow: auto;
-    font-weight: 400;
     -webkit-font-smoothing: antialiased;
   }
 
-  a {
-    color: #4078c0;
-    text-decoration: none;
+  p {
+    margin: 1em 0;
   }
 
-  button, input, select, textarea {
-    font-family: inherit;
-    font-size: inherit;
-    line-height: inherit;
-    color: inherit;
+  a {
+    color: #4078c0;
   }
 
   .hljs {

+ 1 - 0
examples/pages/template/index.tpl

@@ -54,6 +54,7 @@
     h2 {
       font-size: <%= titleSize >px;
       margin: 0;
+      color: #fff;
     }
 
     p {

+ 72 - 0
packages/theme-default/src/reset.css

@@ -0,0 +1,72 @@
+@import './common/var.css';
+
+@reset-global pc;
+body {
+  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
+  font-weight: 400;
+  font-size: var(--font-size-base);
+  color: var(--color-grey);
+}
+
+a {
+  color: var(--color-primary);
+  text-decoration: none;
+
+  &:hover,
+  &:focus {
+    color: tint(var(--color-primary), var(--button-hover-tint-percent));
+  }
+
+  &:active {
+    color: shade(var(--color-primary), var(--button-active-shade-percent));
+  }
+}
+
+h1, h2, h3, h4, h5, h6 {
+  color: var(--font-color-base);
+  font-weight: inherit;
+
+  &:first-child {
+    margin-top: 0;
+  }
+
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+
+h1 {
+  font-size: calc(var(--font-size-base) + 6px);
+}
+
+h2 {
+  font-size: calc(var(--font-size-base) + 4px);
+}
+
+h3 {
+  font-size: calc(var(--font-size-base) + 2px);
+}
+
+h4, h5, h6, p {
+  font-size: inherit;
+}
+
+p {
+  line-height: 1.8;
+
+  &:first-child {
+    margin-top: 0;
+  }
+
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+
+sup, sub {
+  font-size: calc(var(--font-size-base) - 1px);
+}
+
+small {
+  font-size: calc(var(--font-size-base) - 2px);
+}