Socket
Socket
Sign inDemoInstall

postcss-custom-media

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-custom-media - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

6

CHANGELOG.md
# Changes to PostCSS Custom Media
### 7.0.0 (September 12, 2018)
### 7.0.1 (September 14, 2018)
- Fixed: An issue with how opposing queries are resolved.
### 7.0.0 (September 14, 2018)
- Added: New `preserve` option to preserve custom media and atrules using them

@@ -6,0 +10,0 @@ - Added: New `exportTo` function to specify where to export custom media

24

index.cjs.js

@@ -353,4 +353,9 @@ 'use strict';

const replacementMedia = _step.value;
// use the first available modifier unless they cancel each other out
const modifier = media.modifier !== replacementMedia.modifier ? media.modifier || replacementMedia.modifier : '';
const mediaClone = media.clone({
modifier: replacementMedia.modifier === media.modifier && modifierRegExp.test(media.modifier) ? '' : replacementMedia.modifier
modifier,
// conditionally use the raws from the first available modifier
raws: !modifier || media.modifier ? _objectSpread({}, media.raws) : _objectSpread({}, replacementMedia.raws),
type: media.type || replacementMedia.type
});

@@ -361,5 +366,7 @@ mediaClone.nodes.splice(index, 1, ...replacementMedia.clone().nodes.map(node => {

return node;
}));
const retranspiledMedias = String(mediaClone) === String(customMedias[key]) ? [] : transformMedia(mediaClone, customMedias);
})); // remove the currently transformed key to prevent recursion
const nextCustomMedia = getCustomMediasWithoutKey(customMedias, key);
const retranspiledMedias = transformMedia(mediaClone, nextCustomMedia);
if (retranspiledMedias.length) {

@@ -395,5 +402,10 @@ transpiledMedias.push(...retranspiledMedias);

const modifierRegExp = /^not$/i;
const customPseudoRegExp = /\((--[A-z][\w-]*)\)/;
const getCustomMediasWithoutKey = (customMedias, key) => {
const nextCustomMedias = Object.assign({}, customMedias);
delete nextCustomMedias[key];
return nextCustomMedias;
};
var transformAtrules = ((root, customMedia, opts) => {

@@ -422,3 +434,5 @@ root.walkAtRules(mediaAtRuleRegExp, atrule => {

function importCustomMediaFromCSSAST(root) {
return getCustomMedia(root);
return getCustomMedia(root, {
preserve: true
});
}

@@ -425,0 +439,0 @@ /* Import Custom Media from CSS File

{
"name": "postcss-custom-media",
"version": "7.0.0",
"version": "7.0.1",
"description": "Use Custom Media Queries in CSS",

@@ -33,3 +33,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>",

"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/core": "^7.0.1",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",

@@ -36,0 +36,0 @@ "@babel/preset-env": "^7.0.0",

Sorry, the diff of this file is not supported yet

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