From 0992f8108086796f45049ea02ab07cf2ac72290c Mon Sep 17 00:00:00 2001 From: akai Date: Wed, 19 May 2021 17:09:55 +0800 Subject: [PATCH] feat: [style] remove reboot.less BREAKING CHANGE --- gulpfile.js | 6 +- src/components/Chat/style.less | 4 + src/styles/chatui.less | 3 - src/styles/index.less | 6 +- src/styles/reboot.less | 357 --------------------------------- 5 files changed, 6 insertions(+), 370 deletions(-) delete mode 100644 src/styles/chatui.less delete mode 100644 src/styles/reboot.less diff --git a/gulpfile.js b/gulpfile.js index 58ed55ee..0bb4c955 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,11 +15,7 @@ const paths = { }; function fullStyle(cb) { - gulp - .src(['./src/styles/index.less', './src/styles/chatui.less']) - .pipe(less()) - .pipe(postcss()) - .pipe(gulp.dest(paths.dest.dist)); + gulp.src('./src/styles/index.less').pipe(less()).pipe(postcss()).pipe(gulp.dest(paths.dest.dist)); cb(); } diff --git a/src/components/Chat/style.less b/src/components/Chat/style.less index 54803804..ccb1b6fd 100644 --- a/src/components/Chat/style.less +++ b/src/components/Chat/style.less @@ -18,6 +18,10 @@ flex-direction: column; height: 100%; background: var(--light-1); + color: @body-color; + font-family: @font-family-base; + line-height: @line-height-base; + -webkit-tap-highlight-color: transparent; } .ChatFooter { diff --git a/src/styles/chatui.less b/src/styles/chatui.less deleted file mode 100644 index 44507fb4..00000000 --- a/src/styles/chatui.less +++ /dev/null @@ -1,3 +0,0 @@ -@import 'index'; - -@global-style: false; diff --git a/src/styles/index.less b/src/styles/index.less index a3afb420..98e44624 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -1,11 +1,7 @@ @import 'var'; @import 'root'; - -& when (@global-style = true) { - @import 'reboot'; -} - @import 'utils'; + @import '../components/Avatar/style'; @import '../components/Backdrop/style'; @import '../components/Bubble/style'; diff --git a/src/styles/reboot.less b/src/styles/reboot.less deleted file mode 100644 index 9102125f..00000000 --- a/src/styles/reboot.less +++ /dev/null @@ -1,357 +0,0 @@ -@import 'var'; - -/* Base on normalize.css and Bootstrap */ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`. - */ - -*, -*::before, -*::after { - box-sizing: border-box; -} - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - * 3. Change the default tap highlight to be completely transparent in iOS. - */ - -html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -webkit-tap-highlight-color: transparent; /* 3 */ -} - -/* Sections - ========================================================================== */ - -/** - * 1. Remove the margin in all browsers. - * 2. As a best practice, apply a default `background-color`. - */ - -body { - margin: 0; /* 1 */ - background-color: @body-bg; /* 2 */ - font-family: @font-family-base; - font-size: @font-size-base; - font-weight: @font-weight-base; - line-height: @line-height-base; - color: @body-color; -} - -/** - * Render the `main` element consistently in IE. - */ - -main { - display: block; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/* Typography - ========================================================================== */ - -/** - * 1. Remove margins from headings - */ - -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 0; /* 1 */ - font-weight: 400; -} - -/** - * Reset margins on paragraphs - */ - -p { - margin: 0; -} - -ul, -ol { - margin: 0; - padding: 0; - list-style-type: none; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * 1. Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; /* 1 */ - color: @link-color; - text-decoration: @link-decoration; -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/* Embedded content - ========================================================================== */ - -/** - * 1. Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; /* 1 */ - vertical-align: middle; -} - -/** - * 1. Workaround for the SVG overflow bug in IE10/11 is still required. - * See https://github.com/twbs/bootstrap/issues/26878 - */ - -svg { - overflow: hidden; /* 1 */ - vertical-align: middle; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Remove the default `border-radius` that macOS Chrome adds. - * Details at https://github.com/twbs/bootstrap/issues/24093 - * 2. Work around a Firefox/IE bug where the transparent `button` background - * results in a loss of the default `button` focus styles. - * Credit: https://github.com/suitcss/base/ - */ - -button { - border-radius: 0; /* 1 */ - - &:focus { - outline: 1px dotted; /* 2 */ - outline: 5px auto -webkit-focus-ring-color; /* 2 */ - } -} - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { - /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { - /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type='button'], -[type='reset'], -[type='submit'] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type='button']::-moz-focus-inner, -[type='reset']::-moz-focus-inner, -[type='submit']::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type='button']:-moz-focusring, -[type='reset']:-moz-focusring, -[type='submit']:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * 1. Remove the default vertical scrollbar in IE 10+. - * 2. Textareas should really only resize vertically so they don't break their (horizontal) containers. - */ - -textarea { - overflow: auto; /* 1 */ - resize: none; /* 2 */ -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type='checkbox'], -[type='radio'] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type='number']::-webkit-inner-spin-button, -[type='number']::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type='search'] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type='search']::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none !important; -} - -/** - * Suppress the focus outline on elements that cannot be accessed via keyboard. - * This prevents an unwanted focus outline from appearing around elements that - * might still respond to pointer events. - * Credit: https://github.com/suitcss/base - */ - -[tabindex='-1']:focus { - outline: 0 !important; -} - -:focus, -button:focus { - outline: 0; -}