npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mass-extinction

v1.3.1

Published

minimal, customizable, CSS reset for tailwind

Downloads

8

Readme

Mass Extinction

a minimal, customizable, CSS reset for tailwind

philosophy, usage, options, FAQ

https://github.com/MathGeniusJodie/mass-extinction

https://www.npmjs.com/package/mass-extinction

philosophy

  • small code size is a priority
  • does more than preflight by fixing some common annoyances
  • lets you pick the resets you want/need if you want to deviate from the sensible defaults
  • is made specifically for a tailwind workflow
  • doesn't reset styles you're going to overwrite anyway, follows normalize's approach of keeping default browser styles in cases where they do no harm
  • relies on inherit to set defaults (like border color) when possible, allowing the use of utility classes

usage

in tailwind.config.js

module.exports = {
	plugins: [require("mass-extinction")],
	corePlugins: {
		preflight: false,
	},
};

in your css

@tailwind base;

options

theme: {
	extinguish: {
		legacy: true,
		boxSizing: false, // "unset" "content-box" "border-box" "inherit"
		layout: false,
		borderColor: false,
		font: true,
		pseudoElements: false,
		placeholders: false,
		images: true,
		forms: false,
		lists: false,
		forElements(element,spec){}
	}
}

legacy:

old browser support (currently only for ie11), doesn't use the unset keyword and changes default styles that are different from other browsers (currently <pre>, <code> and <samp> not inheriting font-size)

layout:

* {
	contain: layout;
}

avoids performance footguns (recommended)

false by default because it's tricky to get consistent styling cross-browser as safari and edge don't support this feature yet, this also breaks the tailwind typography plugin

borderColor

border-color: inherit, allows setting a default border color like in preflight

font

makes all elements inherit font

true by default to match normalize.css but for content-focused websites, you probably don't want form elements to inherit font

pseudoElements:

add reset styles to ::before and ::after

false by default since the tailwindcss workflow rarely uses pseudoelements

pseudoelements should be avoided in general since content belongs in html and there doesn't exist a way to hide purely presentational pseudoelement content from screen readers

must be enabled for the tailwind typography plugin to work

placeholders:

unset placeholder opacity (mostly for firefox)

images:

unset image height (makes images keep aspect ratio)

forms:

removes inconsistent styling in mobile safari

this setting is false by default because if you want consistent styles for form controls it's recommended you use a more complete library like https://github.com/tailwindlabs/tailwindcss-forms that will make this reset redundant

lists:

unstyle <ul> and <ol> elements

this setting is false by default because in most cases you can just use role=list on a <div> if you want an unstyled list

forElements:

function that returns css rules

first argument is the element name as a string

second argument is an object containing the properties of the element according to the html spec (currently just contentModel and display) see the spec.js file for more details

example:

// make flex the default display property for elements that accept flow content
(element, spec) => {
	const rules = {};
	if (
		spec.contentModel == "flow" && spec.display == "block"
	) {
		rules[element] = {
			display: "flex",
			flexDirection: "column",
		};
	}
	return rules;
}

FAQ

why is there no main{display: block} for ie?

if you want to support ie, put role=main on a <div>

why not reset styles for fieldset and legend?

fieldsets should be avoided https://bugs.chromium.org/p/chromium/issues/detail?id=375693, use role=group on a <div> instead

why not add display:none to <template> elements for ie?

if you want to support ie, use script tags instead

why not set cursor:pointer on buttons?

because that's not the semantics that operating systems use