Coder Social home page Coder Social logo

fruzepro / sanitize.css Goto Github PK

View Code? Open in Web Editor NEW

This project forked from csstools/sanitize.css

0.0 1.0 0.0 209 KB

Render elements consistently. Style with best practices.

Home Page: https://jonathantneal.github.io/sanitize.css/

License: Other

CSS 46.07% HTML 53.93%

sanitize.css's Introduction

sanitize.css

sanitize.css logo

The best-practices CSS foundation.

npm bower ci gitter

sanitize.css is a CSS library that corrects broken and missing styles in all browsers, preserving useful defaults rather than unstyling everything. It’s developed alongside normalize.css, so every normalization includes the browsers or browser versions being targeted, and every opinionated change is marked and documented.

NPM
npm install --save sanitize.css
Bower
bower install --save sanitize-css
CDN

cdnjs

Features

Backgrounds should not repeat by default
* {
	background-repeat: no-repeat;
}
Box sizing should be inherited and default to border-box
* {
	box-sizing: inherit;
}

html {
	box-sizing: border-box;
}
Cursor should only change to hint non-obvious interfaces
html {
	cursor: default;
}
Regular text should be sans serif with a comfortable line height
html {
	font-family: sans-serif
	line-height: 1.5;
}
Documents should not use a margin for outer padding
body {
	margin: 0;
}
Navigation lists should not include a marker style
nav ol, nav ul {
	list-style: none;
}
Text selections should not include text shadows
::selection {
	text-shadow: none;
}
Media elements should align to the text center of other content
audio, canvas, iframe, img, svg, video {
	vertical-align: middle;
}
SVGs should fallback to their surrounding text color
svg {
	fill: currentColor;
}
Outlines are redundant on hovered links
:hover {
	outline-width: 0;
}
Tables should not include additional border spacing
table {
	border-collapse: collapse;
	border-spacing: 0;
}
Form controls should be fully style-able
button, input, select, textarea {
	background-color: transparent;
	border-style: none;
	color: inherit;
	font-size: 1em;
}
Textarea should only resize vertically by default
textarea {
	resize: vertical;
}
ARIA roles should include visual cursor hints
[aria-busy="true"] {
	cursor: progress;
}

[aria-controls] {
	cursor: pointer;
}

[aria-disabled] {
	cursor: default;
}
Single taps should be dispatched immediately on clickable elements
a, area, button, input, label, select, textarea, [tabindex] {
	-ms-touch-action: manipulation; /* 1 */
	touch-action: manipulation;
}
Visually hidden content should remain accessible
[hidden][aria-hidden="false"] {
	clip: rect(0, 0, 0, 0);
	display: inherit;
	position: absolute;
}

[hidden][aria-hidden="false"]:focus {
	clip: auto;
}

Differences

sanitize.css styles elements more consistently with developers’ expectations and preferences. normalize.css styles elements more consistently between browsers. reset.css unstyles every element. Both sanitize.css and normalize.css are maintained in sync, and both projects correct browser bugs while carefully testing and documenting every change.

Support

At present, sanitize.css supports the current and previous major releases of popular web browsers. When a new version is released, we begin supporting that newer version and stop supporting the third version back. Additionally, many older browsers remain supported without supplementary CSS.

Currently tested and supported browsers in the latest release include Android 4.3-4.4+, Chrome 50-51+, Edge 12-13+, Firefox 46-47+, Internet Explorer 10-11, iOS 7-8+, Opera 37-38+, Safari 8-9+, and Windows Phone 8.1+.

Additionally tested and supported browsers (requiring little supplementary CSS) include Internet Explorer 9 and Safari 7.

License

sanitize.css is dedicated to the public domain.

sanitize.css's People

Contributors

jonathantneal avatar ungoldman avatar sotayamashita avatar bcomnes avatar bjork24 avatar fabianbeiner avatar m-iskw avatar filipelinhares avatar zrothauser avatar metaloha avatar weotch avatar charbelrami avatar brunorios1 avatar zspecza avatar kittygiraudel avatar kaelig avatar m-e-h avatar pascalduez avatar tzi avatar vovanbo avatar ciju avatar machida avatar

Watchers

Fruze Richy 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.