Git Product home page Git Product logo

nondestructive-reset.css's Introduction

Non-destructive Reset CSS

What's new?

This is a old reset css looks like:

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-style: normal;
  font-weight: normal;
  font-size: 100%;
  vertical-align: baseline;
}

Or worse:

* {
  margin: 0;
  padding: 0;
  border: 0;
  font-style: normal;
  font-weight: normal;
  font-size: 16px;
  vertical-align: baseline;
}

These are totally destructive methods. And the result is terrible. We need a better way.

How about this way?

.h1 {
  margin: 0;
  font-size: 1em;
  font-weight: inherit;
}

It's Non-destructive. You can opt-in or out of a per-element basis.

Opt-in

<h1 class="h1">

Opt-out

<h1>

Too much hassle?

There's a Jade mixin for that.

mixin h1
  h1.h1&attributes(attributes)
    block

You can call it like this:

+body
  +h1 Title here
  +p  Easy right?

Installation

  • Download
  • Bower: $ bower install nondestructive-reset.css

Test your own

$ git clone https://github.com/BYODKM/nondestructive-reset.css.git
$ cd nondestructive-reset.css
$ npm install
$ grunt

Recommendation

Use this reset.css with normalize.css and should normalize first.

Supported Browsers

  • IE 9+
  • Others

License

MIT

nondestructive-reset.css's People

Contributors

byodkm avatar

Stargazers

hkawaida avatar yoshimana avatar Ryosuke Miyamoto avatar Keisuke Mori avatar Alex Zinchenko avatar  avatar S. Suzuki avatar Tomoyuki Kashiro avatar  avatar K. Syo avatar Kota Fullsour avatar Yuta Hayakawa avatar Old account avatar Ryo Inoue avatar  avatar

Watchers

James Cloos avatar Keisuke Mori avatar  avatar

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.