kosbog / sanitize.css

The best-practices CSS foundation

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sanitize.css sanitize.css logo

NPM Version Bower Version CDNJS Version Build Status License Gitter Chat

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

Features

Box sizing should be inherited and default to border-box
* {
	box-sizing: inherit;
}

html {
	box-sizing: border-box;
}
Backgrounds should not repeat by default
* {
	background-repeat: no-repeat;
}
Cursor should only change to hint non-obvious interfaces
html {
	cursor: default;
}
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;
}
Tables should not include additional border spacing
table {
	border-collapse: collapse;
}
Form controls should be easily style-able
button, input, select, textarea {
	background-color: transparent;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}
Textarea should only resize vertically by default
textarea {
	resize: vertical;
}
Single taps should be dispatched immediately on clickable elements
a, area, button, input, label, select, summary, textarea, [tabindex] {
	-ms-touch-action: manipulation;
	touch-action: manipulation;
}
ARIA roles should include visual cursor hints
[aria-busy="true"] {
	cursor: progress;
}

[aria-controls] {
	cursor: pointer;
}

[aria-disabled] {
	cursor: default;
}
Visually hidden content should remain accessible
[aria-hidden="false"][hidden]:not(:focus) {
	clip: rect(0, 0, 0, 0);
	display: inherit;
	position: absolute;
}

Differences

normalize.css and sanitize.css correct browser bugs while carefully testing and documenting changes. normalize.css styles adhere to css specifications. sanitize.css styles adhere to common developer expectations and preferences. reset.css unstyles all elements. Both sanitize.css and normalize.css are maintained in sync.

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.

About

The best-practices CSS foundation

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

License:Other


Languages

Language:HTML 51.8%Language:CSS 48.2%