Skip to content

Commit 5961910

Browse files
author
Travis Palmer
committed
Coincide 0.4.2 NPM release (minor mistakes published in 0.4.1) minor fixes
1 parent 3290985 commit 5961910

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v0.4.2
4+
- [Infinite recursion detection improvements, widespread minor corrections](https://github.com/travco/postcss-extend/releases/tag/v0.4.2)
5+
6+
## v0.4.0
7+
- [All-intended-features release as 'postcss-extend'](https://github.com/travco/postcss-extend/releases/tag/v0.4.0)
8+
39
## v0.3.1
410
- Ensure that unused defining at-rules and erroneous extending at-rules are removed from generated CSS.
511

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Use this plugin to:
88
- Define an 'silent' extendable selector — a "placeholder selector" — to which you can (from anywhere in the doc), add concrete selectors from other rule sets.
9-
- Add concrete selectors from one rule (containing the `@extend`) to all rule sets with the selector specified (or a sub class of the one specified).
9+
- Add concrete selectors from one rule (containing the `@extend`) to all rule sets with the selector specified (or a subclass of the one specified).
1010
- Pull-in declarations in rulesets (most) anywhere in the doc (by a selector) from within `@media` statements (semi-safely)
1111
- Extend existing media-conscious rulesets, even if some of them are within `@media` statements.
1212

@@ -49,8 +49,6 @@ In regards to the concerns people have with Sass's `@extend`, and the problems t
4949
> **A Note on "mixins" & "extends"**: Mixins copy declarations from an abstract definition into a concrete rule set. These `@extend`s (normally) clone a concrete rule set's selector(s) and add them to an abstract placeholder selector, or another existing rule. *This* plugin enables extends. If you would like to use mixins, as well — or instead — have a look at [`postcss-mixins`](https://github.com/postcss/postcss-mixins).
5050
5151
## Installation
52-
This is just a fork, not an NPM module yet :(, it's also still in development, the origin is here, use it in the mean-time:
53-
5452
```
5553
npm install postcss-extend --save
5654
```
@@ -112,11 +110,11 @@ You can also use its alias `@define-extend'.
112110
```
113111
Both rules and placeholders are extended in much the same fashion, the only real difference is that placeholders can be named most anything, whereas rules need to be extended via the same syntax in the css. For example, to extend a 'foo' class it'd be `@extend .foo`
114112

115-
There is only one overarching `@extend` guideline to obey: `@extend` must *not* occur at the root level, it only can be used inside rule sets.
113+
There is only one overarching `@extend` guideline to obey: `@extend` must **not** occur at the root level, it only can be used inside rule sets.
116114

117115
#### Extending Sub Classes and Sub Elements
118116

119-
Whenever extending a rule or placeholder, you are also automatically trying to extend any sub classes or elements that have *exactly* what you selected (before a space, `.`, `:`, or `#`). For example:
117+
Whenever extending a rule or placeholder, you are also automatically trying to extend any subclasses or elements that have *exactly* what you selected (before a space, `.`, `:`, or `#`). For example:
120118
```css
121119
.potato {
122120
color: white;
@@ -195,7 +193,7 @@ Notice how `.spud` only takes in declarations it doesn't already have from `.pot
195193

196194
##### External Sub classes
197195

198-
So what does it do when sub classes of the extended rule are also outside `@media`?
196+
So what does it do when subclasses of the extended rule are also outside `@media`?
199197
```css
200198
.potato {
201199
float: left;
@@ -352,10 +350,10 @@ console.log(outputCss);
352350
Or take advantage of [any of the myriad of other ways to consume PostCSS](https://github.com/postcss/postcss#usage), and follow the plugin instructions they provide.
353351

354352
## Quirks
355-
As with any piece of code it's got a few quirks. Behaviors that are not intended, and not enforced, and may disappear (or be forcively altered) with the next release, so it's useful to be aware of them.
353+
As with any piece of code it's got a few quirks. Behaviors that are not intended, and not enforced, and may disappear (or be forcibly altered) with the next release, so it's useful to be aware of them.
356354

357355
**Order of Processing** : Currently, all of the `@extend`s being processed are run in a sequential manner from the top to the bottom of the doc. This keeps thing relatively snappy, but makes it so that we have to do conditional-recursion on not-yet-declared-or-extended rules. This leads to some blatant inefficiencies when processing badly formed CSS. So if you want to keep processing time down, write good CSS.
358356

359357
**Non-logical means of extension for `@media`** : As anyone who's aware of the complications discussed in the [SASS issue about extending across `@media`](https://github.com/sass/sass/issues/1050) would know. There is no way (known) of extending when `@media` rules are involved that is both 'clean and simple' and 'logically correct with how `@extend` is used elsewhere'. The way this plugin operates, and it's logical meaning, is a blatant compromise so that it has both common use cases and easier implementation. While the current implementations will not change (without flags), such things as extending an `@media` from within an `@media` does nothing, this could possibly change in the future.
360358

361-
##### Originally a fork of davidtheclark's [postcss-simple-extend](https://github.com/davidtheclark/postcss-simple-extend) (extended) by way of the included [MIT License](https://github.com/travco/postcss-extend/blob/master/LICENSE)
359+
##### Originally a fork of davidtheclark's [postcss-simple-extend](https://github.com/davidtheclark/postcss-simple-extend) (extended) by way of the included [MIT License](https://github.com/travco/postcss-extend/blob/master/LICENSE)

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var postcss = require('postcss');
66
module.exports = postcss.plugin('postcss-simple-extend', function simpleExtend() {
77

88
return function(css, result) {
9-
var definingAtRules = ['define-placeholder', 'define-extend'];
9+
var definingAtRules = ['define-placeholder', 'define-extend', 'extend-define'];
1010
var extendingAtRules = ['extend'];
1111
var recurseStack = [];
1212

@@ -42,6 +42,7 @@ module.exports = postcss.plugin('postcss-simple-extend', function simpleExtend()
4242
targetNode.selector = selectorAccumulator.join(', ');
4343
}
4444
});
45+
4546
//simplification process to find definitions in the future
4647
function processDefinition(atRule) {
4748
if (isBadDefinitionLocation(atRule)) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"email": "[email protected]"
66
},
77
"license": "MIT",
8-
"version": "0.4.0",
8+
"version": "0.4.2",
99
"description": "Simple extends for PostCSS",
1010
"homepage": "https://github.com/travco/postcss-extend",
1111
"repository": {

0 commit comments

Comments
 (0)