Skip to content

Commit

Permalink
feat: 🎸 add Normalize.css reest
Browse files Browse the repository at this point in the history
Issues: #132
  • Loading branch information
streamich committed Jun 13, 2018
1 parent 01eb9b9 commit fe8fee1
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 1 deletion.
99 changes: 99 additions & 0 deletions addon/__tests__/__snapshots__/reset.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,105 @@ Object {
}
`;

exports[`reset Normalize 1`] = `
Object {
"::-webkit-file-upload-button": Object {
"-webkit-appearance": "button",
"font": "inherit",
},
"[type=\\"number\\"]::-webkit-inner-spin-button,[type=\\"number\\"]::-webkit-outer-spin-button": Object {
"height": "auto",
},
"[type=\\"search\\"]": Object {
"-webkit-appearance": "textfield",
"outlineOffset": "-2px",
},
"[type=\\"search\\"]::-webkit-search-decoration": Object {
"-webkit-appearance": "none",
},
"b,strong": Object {
"fontWeight": "bolder",
},
"body": Object {
"margin": 0,
},
"button,[type=\\"button\\"],[type=\\"reset\\"],[type=\\"submit\\"]": Object {
"-webkit-appearance": "button",
},
"button,input": Object {
"overflow": "visible",
},
"button,input,optgroup,select,textarea": Object {
"fontFamily": "inherit",
"fontSize": "100%",
"lineHeight": 1.15,
"margin": 0,
},
"button,select": Object {
"textTransform": "none",
},
"button:-moz-focusring,[type=\\"button\\"]:-moz-focusring,[type=\\"reset\\"]:-moz-focusring,[type=\\"submit\\"]:-moz-focusring": Object {
"outline": "1px dotted ButtonText",
},
"button::-moz-focus-inner,[type=\\"button\\"]::-moz-focus-inner,[type=\\"reset\\"]::-moz-focus-inner,[type=\\"submit\\"]::-moz-focus-inner": Object {
"borderStyle": "none",
"padding": 0,
},
"code,kbd,samp": Object {
"fontFamily": "monospace, monospace",
"fontSize": "1em",
},
"fieldset": Object {
"padding": "0.35em 0.75em 0.625em",
},
"h1": Object {
"fontSize": "2em",
"margin": "0.67em 0",
},
"hr": Object {
"boxSizing": "content-box",
"height": 0,
"overflow": "visible",
},
"html": Object {
"-webkit-text-size-adjust": "100%",
"lineHeight": 1.15,
},
"legend": Object {
"boxSizing": "border-box",
"display": "table",
"maxWidth": "100%",
"padding": 0,
"whiteSpace": "normal",
},
"pre": Object {
"fontFamily": "monospace, monospace",
"fontSize": "1em",
},
"progress": Object {
"verticalAlign": "baseline",
},
"small": Object {
"fontSize": "80%",
},
"sub": Object {
"bottom": "-0.25em",
},
"sub,sup": Object {
"fontSize": "75%",
"lineHeight": 0,
"position": "relative",
"verticalAlign": "baseline",
},
"summary": Object {
"display": "list-item",
},
"sup": Object {
"top": "-0.5em",
},
}
`;

exports[`reset PoorMan 1`] = `
Object {
"a img, :link img, :visited img": Object {
Expand Down
3 changes: 2 additions & 1 deletion addon/__tests__/reset.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ var resets = [
'Tantek',
'Tripoli',
'Universal',
'Yahoo'
'Yahoo',
'Normalize',
];

describe('reset', function () {
Expand Down
107 changes: 107 additions & 0 deletions addon/reset/Normalize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
'use strict';

exports.addon = function (renderer) {
if (process.env.NODE_ENV !== 'production') {
require('../__dev__/warnOnMissingDependencies')('reset', renderer, ['put']);
}

// Adopted from https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css
var css = {
html: {
lineHeight: 1.15,
'-webkit-text-size-adjust': '100%',
},
body: {
margin: 0,
},
h1: {
fontSize: '2em',
margin: '0.67em 0',
},
hr: {
boxSizing: 'content-box',
height: 0,
overflow: 'visible',
},
pre: {
fontFamily: 'monospace, monospace',
fontSize: '1em',
},
'b,strong': {
fontWeight: 'bolder',
},
'code,kbd,samp': {
fontFamily: 'monospace, monospace',
fontSize: '1em',
},
'small': {
fontSize: '80%',
},
'sub,sup': {
fontSize: '75%',
lineHeight: 0,
position: 'relative',
verticalAlign: 'baseline',
},
sub: {
bottom: '-0.25em',
},
sup: {
top: '-0.5em',
},
'button,input,optgroup,select,textarea': {
fontFamily: 'inherit',
fontSize: '100%',
lineHeight: 1.15,
margin: 0,
},
'button,input': {
overflow: 'visible',
},
'button,select': {
textTransform: 'none',
},
'button,[type="button"],[type="reset"],[type="submit"]': {
'-webkit-appearance': 'button',
},
'button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner': {
borderStyle: 'none',
padding: 0,
},
'button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring': {
outline: '1px dotted ButtonText',
},
fieldset: {
padding: '0.35em 0.75em 0.625em',
},
legend: {
boxSizing: 'border-box',
display: 'table',
maxWidth: '100%',
padding: 0,
whiteSpace: 'normal',
},
progress: {
verticalAlign: 'baseline',
},
'[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button': {
height: 'auto',
},
'[type="search"]': {
'-webkit-appearance': 'textfield',
outlineOffset: '-2px',
},
'[type="search"]::-webkit-search-decoration': {
'-webkit-appearance': 'none',
},
'::-webkit-file-upload-button': {
'-webkit-appearance': 'button',
font: 'inherit',
},
summary: {
display: 'list-item',
},
};

renderer.put('', css);
};

0 comments on commit fe8fee1

Please sign in to comment.