Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mizok committed Apr 4, 2022
2 parents 3856852 + c1a214f commit 9aa845a
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 2 deletions.
294 changes: 294 additions & 0 deletions src/scss/reset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
@import './main';


* {
padding: 0;
margin: 0;
font-family: $text-font-stack;
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

&:focus {
outline: 0;
}
}

*,
*::before,
*::after {
box-sizing: border-box;
}

/********************* global reset End*********************/

/********************* main HTML Structure reset Start*********************/

html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-ms-text-size-adjust: 100%;
/* 3 */
}

body {
line-height: 1;
color: black;
}

html,
body {
height: 100%;
box-sizing: border-box;
-ms-overflow-style: scrollbar;
}

main {
display: block;
}

article,
aside,
footer,
header,
nav,
section,
figcaption,
figure {
display: block;
}

/********************* main HTML Structure reset End*********************/

/********************* Secondary HTML Element reset Start*********************/

/* tables still need 'cellspacing="0"' in the markup */

table {
border-collapse: collapse;
border-spacing: 0;

caption,
th,
td {
text-align: left;
font-weight: normal;
}

th,
td {
vertical-align: top;
}
}

// ordered-list,unordered-list reset

ol,
ul {
list-style: none;
}

// paragraph reset

p {
color: $text-color;
}

// pre-render reset

pre {
font-family: $text-font-stack;
/* 1 */
font-size: 1em;
/* 2 */
white-space: pre-wrap;
word-break: break-word;
}

/**
* 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 */
}

/**
* Remove the gray background on active links in IE 10.
* Set display : inline-block as default.
*/

a {
background-color: transparent;
display: inline-block;
color: $link-color;
text-decoration: none;
-webkit-text-decoration-skip: objects;

/* 2 */
@include on-event {
color: $text-color;
text-decoration: underline;
}

&[href] {
cursor: pointer;
}
}

/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/

b,
strong {
font-weight: bolder;
}

blockquote,
q {
quotes: none;

&:before,
&:after {
content: "";
content: none;
}
}

/**
* Remove the border on images inside links in IE 10.
*/

img {
border-style: none;
display: inline-block;
width: 100%;
}

/**
* Hide the overflow in IE.
*/

svg:not(:root) {
overflow: hidden;
}

/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/

/********************* Secondary HTML Element reset End*********************/

/******************** Form Element Reset Start********************/

button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
text-transform: none;
}

textarea {
overflow: auto;
resize: none;

&:invalid {
box-shadow: none;
}
}

select {
-webkit-appearance: none;
appearance: none;
border-radius: 0;
}

input {

&:invalid {
box-shadow: none;
}

&[type="password"]::-ms-reveal,
&[type=""]::-ms-clear {
display: none;
}

&:-webkit-input-placeholder,
&:-ms-input-placeholder,
&::-ms-input-placeholder,
&::placeholder {
font: inherit;
}

&[type="checkbox"],
&[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}

&[type="number"]::-webkit-inner-spin-button,
&[type="number"]::-webkit-outer-spin-button {
height: auto;
}

&[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
}

[type="button"],
/* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
/* 2 */
}

label[for] {
cursor: pointer;
}

legend {
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}

/******************** Form Element Reset End********************/

template {
display: none;
}


/********************* global reset Start*********************/
1 change: 0 additions & 1 deletion src/scss/util/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "./variables";
@import "./functions";
@import "./mixins";
@import "./reset";
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getEntriesByParsingTemplateNames = (templatesFolderName,atRoot = true)=>{
entryStyleSheetPath = fs.existsSync(entryStyleSheetPath)?entryStyleSheetPath:undefined;

// import es6-promise and scss util automatically
entryObj[entryName] = ['es6-promise/auto',entryPath,entryStyleSheetPath].filter(function (x: string | undefined) {
entryObj[entryName] = ['es6-promise/auto',entryPath,'./src/scss/reset.scss',entryStyleSheetPath].filter(function (x: string | undefined) {
return x !== undefined;
});

Expand Down

0 comments on commit 9aa845a

Please sign in to comment.