Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 1011 Bytes

README.md

File metadata and controls

57 lines (44 loc) · 1011 Bytes

PostCSS Theme Shorthand Build Status

PostCSS plugin that allows the use of "light-" and "dark-" property prefixes for themeing.

.thing {
	light-color: white;
	dark-color: black;
	color: red;
	light-background: black;
	dark-background: white;
}

.ballon, .garage {
	dark-color: red;
	light-color: blue;
}
:global(.theme-light) .thing {
	color: white;
	background: black;
}

:global(.theme-dark) .thing {
	color: black;
	background: white;
}

.thing {
	color: red;
}

:global(.theme-dark) .ballon, :global(.theme-dark) .garage {
	color: red;
}

:global(.theme-light) .ballon, :global(.theme-light) .garage {
	color: blue;
}

.ballon, .garage {
}

Usage

postcss([ require('postcss-theme-shorthand') ])

See PostCSS docs for examples for your environment.