postcss-combine-duplicated-selectors

automatically keep css selectors unique.

MIT License

Downloads
361.9K
Stars
95
Committers
13

Bot releases are visible (Hide)

postcss-combine-duplicated-selectors - Postcss 6

Published by ChristianMurphy about 7 years ago

This release removes uses of deprecated postcss 5 methods. (#94 thanks to @XhmikosR)
📓 The new postcss 6 API's no longer guarantee that spacing format will be preserved.
📔 spacing format will no longer be considered breaking as part of the sematic versioning of this package.

postcss-combine-duplicated-selectors - Conventional Commits and Commitizen

Published by ChristianMurphy about 7 years ago

Project now follows the conventional commits standard for commit messages and offers commitizen as a way to generate standard commits in a easy to use command line interface npm run cz.

Documentation has been updated to link to other standards which project adheres to.

postcss-combine-duplicated-selectors - Vendored At Rule Support

Published by ChristianMurphy about 7 years ago

At rules with different vendor prefixes will not be combined. #85

E.G. the following will remain unchanged.

@-webkit-keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
postcss-combine-duplicated-selectors - Property Combination Support

Published by ChristianMurphy over 7 years ago

Duplicated properties can optionally be combined. (#76 thanks to @aldebaran798)

When option is enabled

postcss([require('postcss-combine-duplicated-selectors')({removeDuplicatedProperties: true})])

The following css

.a {
  height: 10px;
  background: orange;
  background: rgba(255, 165, 0, 0.5);
}

will combine into

.a {
  height: 10px; 
  background: rgba(255, 165, 0, 0.5);
}
postcss-combine-duplicated-selectors - General At Rule Support

Published by ChristianMurphy over 7 years ago

Generalizes handling of @media to support @keyframes, @viewport, and other @ rules in CSS.

postcss-combine-duplicated-selectors - Media Query Support

Published by ChristianMurphy almost 8 years ago

@media selectors are now processed separately from global selectors. (#6 thanks to @kristoferjoseph)

Meaning

.example {
  color: blue;
}
.example {
  background: green;
}


@media print {
  .example {
    color: red;
  }
  .example {
    background: yellow;
  }
}

will correctly reduce to

.example {
  color: blue;
  background: green;
}


@media print {
  .example {
    color: red;
    background: yellow;
  }
}
postcss-combine-duplicated-selectors - Selector Parser Cleanup

Published by ChristianMurphy about 8 years ago

More internal normalizations are now handled by postcss-selector-parser

postcss-combine-duplicated-selectors - Command Line Interface

Published by ChristianMurphy over 8 years ago

plugin can now be used with postcss-cli.

postcss-combine-duplicated-selectors - Validate Examples

Published by ChristianMurphy over 8 years ago

Example Javascript in README is now checked against linter.

postcss-combine-duplicated-selectors - Native Javascript 6

Published by ChristianMurphy over 8 years ago

Drops support for Node.js 0.12
Allowing more code to be run natively, and less to be transformed by babel.

postcss-combine-duplicated-selectors - Logical Grouping

Published by ChristianMurphy over 8 years ago

Matching selectors that have different text order but same logical meaning are now grouped.

E.G.

.one.two {} .two.one {}

becomes

.one.two {}

Testing

  • Added tests for different textual ordering
  • Added tests for pseudo classes
  • Added tests for psuedo elements
  • Restructured tests to separate unique selector tests and duplicated selector tests
  • Restructured tests to separate css tests from less/scss tests.

Chores

  • Updated dependencies
  • Added script to ensure release will always have latest built code
postcss-combine-duplicated-selectors - Attribute Selectors

Published by ChristianMurphy over 8 years ago

Matching selectors with attributes can now be combined.
README now includes a usage guide.

Testing

  • Selector attribute tests

Linting

  • Check Javascript import statements for correctness
postcss-combine-duplicated-selectors - Tests and Fixes

Published by ChristianMurphy over 8 years ago

New Tests:

  • Multiple declarations @eirslett
  • Nested selectors
  • Sibling selectors

Fix:

  • Resolved issue with multiple declarations not being copied correctly

Chores:

  • Move tests into test macros
  • Updated project dependencies
postcss-combine-duplicated-selectors - Mixed Spacing

Published by ChristianMurphy over 8 years ago

Plugin can now group selectors with different spacing between each statement.

postcss-combine-duplicated-selectors - Hello World!

Published by ChristianMurphy over 8 years ago

Support for combining groups that have identical selectors.