1.0.2 • Published 2 years ago

@daltontan/postcss-breakpoints v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

PostCSS Breakpoints

Generate classes that activate at defined widths.

Plugin syntax:

@generate-breakpoints (<name>: <width>; ...) {
	<classes>...
}

Example

Input:

@generate-breakpoints (desktop: 1280px; tablet: 1024px) {
	.test, .foobar {
		font: bold;
		& .nest {
			border: none;
		}
	}
}

Output:

@media (min-width: 1280px) {
	.desktop-test, .desktop-foobar {
		font: bold;
		& .nest {
			border: none;
		}
	}
}
@media (min-width: 1024px) {
	.tablet-test, .tablet-foobar {
		font: bold;
		& .nest {
			border: none;
		}
	}
}
.test, .foobar {
	font: bold;
	& .nest {
		border: none;
	}
}

Usage

Install plugin.

npm i @daltontan/postcss-breakpoints

Add to you PostCSS config:

module.exports = {
	plugins: [
		require('@daltontan/postcss-breakpoints'),
	]
}
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago