Git Product home page Git Product logo

reset-css's Introduction

reset.css

An unmodified* copy of Eric Meyer's CSS reset.

Install

With curl:

$ curl -LO "https://unpkg.com/reset-css/reset.css"
$ curl -LO "https://unpkg.com/reset-css/less/reset.less"
$ curl -LO "https://unpkg.com/reset-css/sass/_reset.scss"

With NPM:

$ npm install reset-css

With Yarn:

$ yarn add reset-css

With Bower:

$ bower install reset-css

Usage

HTML:

<link rel="stylesheet" href="/path/to/reset-css/reset.css" />

CSS:

@import '/path/to/reset-css/reset.css';

Via PostCSS and postcss-import:

@import 'reset-css';

Via webpack and css-loader:

import 'reset-css';

Via Less:

@import '/path/to/reset-css/less/reset';

Via Sass:

@import '/path/to/reset-css/sass/reset';

*Changelog

Three changes have been made from the 2011 version, all approved by Mr. Meyer:

  • Added main to list of HTML 5 elements (#7)
  • Added rule to fix hidden attribute on HTML 5 elements (#12)
  • Added menu to list of lists (#17)

Eric Meyer http://meyerweb.com/eric/tools/css/reset/

License: none (public domain)

reset-css's People

Contributors

bkotos avatar fabricionaweb avatar hzlmn avatar jacknumber avatar kl3ryk avatar maennchen avatar runarberg avatar scoobster17 avatar shannonmoeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

reset-css's Issues

Cannot import SCSS version

Having the css and scss version named the same causes sass to throw a wobbly making it impossible to import the scss version in this set up.

@import '_reset'
is invalid and results in
Error: File to import not found or unreadable

The correct method:
@import 'reset'
results in
Error: It's not clear which file to import for @import
As sass doesn't know whether to import the css or sass version.

Reset breaks the hidden-attribute on semantic elements

The CSS reset appears to break the hidden attribute for numerous semantic elements, such as <section>.

For example, <section hidden> leads to a visible element after applying the reset, because the display: block property of that rule apparently trumps the effect of the hidden attribute in terms of specificity.

If it has to reset the display property of semantic block elements - and I'm not convinced that it needs to, because the semantic block elements should have display: block by default - but assuming it has to, it probably needs to include a more specific rule to restore the expected behavior of the hidden attribute, e.g. for example:

section[hidden] {
  display: none;
}

outline styles reset

Although this is supposed to be a copy of reset CSS, but it is possible to add reset styles for outline property for focus state. Happy to send PR across.

Version 3 to 4 (and .scss to .sass)

I'm using webpack 4.10.2 with sass-loader 6.0.7. After updating my include for the new version to have /sass, my build now fails with:

ERROR in Module build failed:
   License: none (public domain)
                                  ^
      Invalid CSS after "...blic domain) */": expected 1 selector or at-rule, was "*/ {}"
      in (myBuildPath)/node_modules/reset-css/sass/_reset.sass (line 3, column 36)

I didn't inspect the file terribly closely, but I believe the only real difference between version 3 and version 4 is that the extension changed. If I manually switch the extension back to .scss, the build succeeds.

Lastly, plugging the file into https://www.sassmeister.com/ switches the comment to look like this:

/* http://meyerweb.com/eric/tools/css/reset/
 * v4.0 | 20180602
 * License: none (public domain)

html, body, div, span, applet, object, iframe,

but then upon compile, it switches to

/* http://meyerweb.com/eric/tools/css/reset/
 * v4.0 | 20180602
 * License: none (public domain) */
html, body, div, span, applet, object, iframe,

(The comment closing characters being the important difference). Manually altering the .sass file to have this comment style ends up breaking the build further down the file (at time, mark, audio, video {), which leads me to believe the extension switch may have been by mistake.

Was the change from .scss to .sass intentional? And if so, is there anything else I should try here?

CSS Logical Properties

CSS Logical Properties, such as margin-block-start, are not overridden.

Quick fix:

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-block-start: 0;
	margin-block-end: 0;
	padding-block-start: 0;
	padding-block-end: 0;
	border-inline-start: 0;
	border-inline-end: 0;
}

`menu` selector is present twice in first rule

There is the menu two time in the first rule:

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, menu, 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,
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video { ... }

The code quality check Sonarqube reports it as code-smell : https://rules.sonarsource.com/css/RSPEC-4666/

Introduced by #17

bower donwload old files.. missing sass

this is what I get

$ bower install shannonmoeller/reset-css
  bower reset-css#*           not-cached git://github.com/shannonmoeller/reset-css.git#*
  bower reset-css#*              resolve git://github.com/shannonmoeller/reset-css.git#*
  bower reset-css#*             download https://github.com/shannonmoeller/reset-css/archive/v2.0.20110126.tar.gz
  bower reset-css#*              extract archive.tar.gz
  bower reset-css#*         invalid-meta reset-css is missing "ignore" entry in bower.json
  bower reset-css#*             resolved git://github.com/shannonmoeller/reset-css.git#2.0.20110126
  bower reset-css#~2.0.20110126  install reset-css#2.0.20110126

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.