Top Related Projects
A modern alternative to CSS resets
A tiny modern CSS reset
A best-practices CSS foundation
A drop-in collection of CSS styles to make simple websites just a little nicer
MVP.css — Minimalist classless CSS stylesheet for HTML elements
:cherry_blossom: a minimal css framework/theme.
Quick Overview
Modern-normalize is a CSS reset and normalization library that provides a consistent starting point for styling across different browsers. It's a modernized version of the popular normalize.css, focusing on newer browsers and removing outdated styles.
Pros
- Lightweight and minimal, only including essential normalizations
- Targets modern browsers, reducing unnecessary code for older versions
- Regularly updated to keep pace with browser changes
- Easy to integrate into existing projects
Cons
- May not provide sufficient normalization for projects supporting older browsers
- Some developers might prefer more opinionated resets
- Limited customization options out of the box
- Might conflict with other CSS reset libraries if not used carefully
Code Examples
- Importing modern-normalize in CSS:
@import 'modern-normalize';
/* Your custom styles here */
- Using modern-normalize with a CSS preprocessor like Sass:
@import 'modern-normalize/modern-normalize.css';
// Your custom styles here
- Including modern-normalize via CDN:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-normalize/modern-normalize.min.css">
Getting Started
To use modern-normalize in your project, follow these steps:
-
Install via npm:
npm install modern-normalize
-
Import in your main CSS file:
@import 'modern-normalize';
-
Alternatively, include via CDN in your HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-normalize/modern-normalize.min.css">
-
Start building your custom styles on top of the normalized base.
Competitor Comparisons
A modern alternative to CSS resets
Pros of normalize.css
- Broader browser support, including older versions
- More comprehensive normalization of HTML elements
- Longer-standing project with a larger community
Cons of normalize.css
- Larger file size, potentially impacting performance
- Includes unnecessary styles for modern browsers
- Less frequent updates compared to modern-normalize
Code Comparison
normalize.css:
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
modern-normalize:
*,::after,::before{box-sizing:border-box}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
}
modern-normalize focuses on modern browsers, resulting in a smaller file size and more targeted normalization. It includes newer CSS properties like box-sizing
and tab-size
, which are not present in normalize.css.
normalize.css offers broader compatibility but at the cost of increased file size and potentially outdated styles. It normalizes more HTML elements, which can be beneficial for projects requiring support for older browsers.
modern-normalize is more lightweight and frequently updated, making it ideal for projects targeting modern browsers. However, it may not provide sufficient normalization for projects that need to support older browser versions.
The choice between these two libraries depends on the project's specific requirements, target audience, and browser support needs.
A tiny modern CSS reset
Pros of minireset.css
- More lightweight and minimalistic approach
- Focuses on resetting default styles without adding opinionated defaults
- Easier to customize and build upon for specific project needs
Cons of minireset.css
- Less comprehensive browser normalization
- May require more manual styling for cross-browser consistency
- Doesn't address some modern browser features and elements
Code Comparison
minireset.css:
html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
blockquote,
figure,
fieldset,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0;
}
modern-normalize:
*,
::before,
::after {
box-sizing: border-box;
}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
}
The code comparison shows that minireset.css takes a more aggressive approach to resetting default styles, while modern-normalize focuses on normalizing behavior across browsers and addressing modern web standards. modern-normalize provides a more nuanced approach to cross-browser consistency, while minireset.css offers a clean slate for custom styling.
A best-practices CSS foundation
Pros of sanitize.css
- More comprehensive normalization, covering a wider range of elements and properties
- Includes additional features like form control styling and typography improvements
- Actively maintained with frequent updates and community contributions
Cons of sanitize.css
- Larger file size due to more extensive coverage
- May require more customization to override certain styles if not desired
- Potentially more opinionated in some style choices
Code Comparison
sanitize.css:
textarea {
resize: vertical;
}
[hidden] {
display: none;
}
:root {
-moz-tab-size: 4;
tab-size: 4;
}
modern-normalize:
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
Both projects aim to provide a solid foundation for web development by normalizing browser styles. sanitize.css offers a more comprehensive approach with additional features, while modern-normalize focuses on a minimal, modern baseline. The choice between the two depends on project requirements, desired level of customization, and performance considerations.
A drop-in collection of CSS styles to make simple websites just a little nicer
Pros of water.css
- Provides a complete, ready-to-use CSS framework for quick styling
- Offers a classless design, allowing for easy implementation without modifying HTML
- Includes dark mode support out of the box
Cons of water.css
- Larger file size due to more comprehensive styling
- Less flexibility for customization compared to a minimal reset
- May require overriding styles for more complex designs
Code Comparison
modern-normalize:
*, ::before, ::after {
box-sizing: border-box;
}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
water.css:
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
max-width: 800px;
margin: 20px auto;
padding: 0 10px;
color: #363636;
background: #ffffff;
}
modern-normalize focuses on normalizing browser defaults, while water.css provides a complete styling solution. modern-normalize is more lightweight and flexible, ideal for custom designs. water.css offers quick, attractive styling without classes, suitable for rapid prototyping or simple projects.
MVP.css — Minimalist classless CSS stylesheet for HTML elements
Pros of MVP
- More comprehensive styling, including pre-styled elements and utility classes
- Includes a dark mode option out of the box
- Offers a wider range of pre-built components and layouts
Cons of MVP
- Larger file size due to more extensive styling
- Less focused on normalization and more on providing a complete CSS framework
- May require more customization to achieve a unique design
Code Comparison
MVP:
:root {
--border-radius: 5px;
--box-shadow: 2px 2px 10px;
--color: #118bee;
--color-accent: #118bee15;
--color-bg: #fff;
--color-bg-secondary: #e9e9e9;
--color-secondary: #920de9;
--color-secondary-accent: #920de90b;
--color-shadow: #f4f4f4;
--color-text: #000;
--color-text-secondary: #999;
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
--hover-brightness: 1.2;
--justify-important: center;
--justify-normal: left;
--line-height: 1.5;
--width-card: 285px;
--width-card-medium: 460px;
--width-card-wide: 800px;
--width-content: 1080px;
}
modern-normalize:
*,
::before,
::after {
box-sizing: border-box;
}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
}
:cherry_blossom: a minimal css framework/theme.
Pros of Sakura
- Provides a complete, opinionated CSS framework for quick, elegant styling
- Focuses on typography and readability, especially for text-heavy sites
- Offers a classless design, allowing for easy implementation without modifying HTML
Cons of Sakura
- Less flexible and customizable compared to Modern Normalize
- May require overriding styles for more complex layouts or designs
- Larger file size due to its comprehensive nature
Code Comparison
Modern Normalize:
*, ::before, ::after {
box-sizing: border-box;
}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
Sakura:
html {
font-size: 62.5%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
body {
font-size: 1.8rem;
line-height: 1.618;
max-width: 38em;
margin: auto;
color: #4a4a4a;
background-color: #f9f9f9;
padding: 13px;
}
Modern Normalize focuses on normalizing browser styles, while Sakura provides a complete styling solution with predefined typography and layout rules.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Differences from normalize.css
- Smaller
- Includes only normalizations for the latest Chrome, Firefox, and Safari
- Sets
box-sizing: border-box
- Improves consistency of default fonts
- Sets a more readable tab size
- Fully tested
- Maintained
If you have questions about the source, check out the original source and this for details.
The goal of this project is to make itself obsolete.
Browser support
- Latest Chrome
- Latest Firefox
- Latest Safari
Install
npm install modern-normalize
Download
CDN
Usage
@import 'node_modules/modern-normalize/modern-normalize.css';
or
<link rel="stylesheet" href="node_modules/modern-normalize/modern-normalize.css">
FAQ
Can you provide Sass, Less, etc, ports?
There's absolutely no reason to have separate ports for these. They are just CSS supersets and can import CSS directly.
Related
- sass-extras - Useful utilities for working with Sass
Top Related Projects
A modern alternative to CSS resets
A tiny modern CSS reset
A best-practices CSS foundation
A drop-in collection of CSS styles to make simple websites just a little nicer
MVP.css — Minimalist classless CSS stylesheet for HTML elements
:cherry_blossom: a minimal css framework/theme.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot