Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-sorting

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-sorting - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

3

CHANGELOG.md

@@ -5,2 +5,5 @@ # Change Log

## 1.6.1
* Fixed a regression in 1.6.0. Sort order with item like `@include media` didn't found rules like `@include media(">=desk") {}`.
## 1.6.0

@@ -7,0 +10,0 @@ * Add special comments to disable processing for some part in style sheet

23

index.js

@@ -80,12 +80,25 @@ var postcss = require('postcss');

var atruleName = '@' + node.name;
var sortNameExtended;
var atruleParameter;
// If atRule has a parameter like @mixin name or @include name, sort by this parameter
var atruleParameter = (/^[\w-\(\)]+/).exec(node.params);
// If atRule has a parameter like `@mixin name` or `@include name`, sort by this parameter
if (node.params) {
atruleParameter = node.params;
sortNameExtended = atruleName + ' ' + atruleParameter;
if (atruleParameter && atruleParameter.length) {
var sortNameExtended = atruleName + ' ' + atruleParameter[0];
// check if there is a whole parameter in the config, e. g. `media("<=desk")`
if (order[sortNameExtended]) {
return sortNameExtended;
}
// check if there is a part of parameter in the config, e. g. `media` from `media("<=desk")`
atruleParameter = (/^[\w-]+/).exec(atruleParameter);
if (atruleParameter && atruleParameter.length) {
sortNameExtended = atruleName + ' ' + atruleParameter[0];
if (order[sortNameExtended]) {
return sortNameExtended;
}
}
}

@@ -92,0 +105,0 @@

{
"name": "postcss-sorting",
"version": "1.6.0",
"version": "1.6.1",
"description": "PostCSS plugin to sort rules content with specified order.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc