From 2e45a5156fc39d3dfcc65f044e60941e03c673bd Mon Sep 17 00:00:00 2001 From: surunzi Date: Fri, 6 May 2016 15:41:37 +0800 Subject: [PATCH] Add: Reset css --- script/icomoon.js | 3 +-- src/EntryBtn/EntryBtn.scss | 5 +++-- src/icon.css | 2 +- src/index.es6 | 3 ++- src/reset.scss | 44 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 src/reset.scss diff --git a/script/icomoon.js b/script/icomoon.js index 8cf2de0..b5412dd 100644 --- a/script/icomoon.js +++ b/script/icomoon.js @@ -20,8 +20,7 @@ function genCssFile(fontData) data.splice(2, 5, ' src: url(\'data:application/x-font-woff;charset=utf-8;base64,' + fontData + '\') format(\'woff\');'); data = data.join('\n'); - data = data.replace('icon-"', 'eruda-icon-"'); - data = + data = data.replace(/icon-"/g, 'eruda-icon-"'); writeCssFile(data); }); diff --git a/src/EntryBtn/EntryBtn.scss b/src/EntryBtn/EntryBtn.scss index e35edf4..ed1ca44 100644 --- a/src/EntryBtn/EntryBtn.scss +++ b/src/EntryBtn/EntryBtn.scss @@ -1,4 +1,5 @@ -.home-btn { + +.container { .home-btn { width: 40px; height: 40px; background: #000; @@ -18,4 +19,4 @@ &.active { opacity: .8; } -} +} } diff --git a/src/icon.css b/src/icon.css index 0ba1c9d..7e6906d 100644 --- a/src/icon.css +++ b/src/icon.css @@ -5,7 +5,7 @@ font-style: normal; } -[class^="eruda-icon-"], [class*=" icon-"] { +[class^="eruda-icon-"], [class*=" eruda-icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'icomoon' !important; speak: none; diff --git a/src/index.es6 b/src/index.es6 index 70d0a73..144e99f 100644 --- a/src/index.es6 +++ b/src/index.es6 @@ -12,6 +12,7 @@ import util from './lib/util' import config from './lib/config.es6' require('./style.scss'); +require('./reset.scss'); require('./icon.css'); var $container; @@ -57,7 +58,7 @@ settings.separator() function appendContainer() { if (eruda) eruda.destroy(); - util.$('body').append('
'); + util.$('body').append('
'); $container = util.$('#eruda'); } diff --git a/src/reset.scss b/src/reset.scss new file mode 100644 index 0000000..ff803e9 --- /dev/null +++ b/src/reset.scss @@ -0,0 +1,44 @@ +.container { + 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 { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + } + 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; + } + blockquote:before, blockquote:after, + q:before, q:after { + content: ''; + content: none; + } + table { + border-collapse: collapse; + border-spacing: 0; + } +}