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

@ant-design/cssinjs

Package Overview
Dependencies
Maintainers
10
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ant-design/cssinjs - npm Package Compare versions

Comparing version 0.0.0-alpha.37 to 0.0.0-alpha.38

14

es/useStyleRegister.js

@@ -71,4 +71,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

var mergedKey = key.trim(); // 拆分多个选择器
var mergedKey = key.trim(); // Whether treat child as root. In most case it is false.
var nextRoot = false; // 拆分多个选择器
if ((root || injectHash) && hashId) {

@@ -85,5 +87,13 @@ if (mergedKey.startsWith('@')) {

}
} else if (root && !hashId && (mergedKey === '&' || mergedKey === '')) {
// In case of `{ '&': { a: { color: 'red' } } }` or `{ '': { a: { color: 'red' } } }` without hashId,
// we will get `&{a:{color:red;}}` or `{a:{color:red;}}` string for stylis to compile.
// But it does not conform to stylis syntax,
// and finally we will get `{color:red;}` as css, which is wrong.
// So we need to remove key in root, and treat child `{ a: { color: 'red' } }` as root.
mergedKey = '';
nextRoot = true;
}
styleStr += "".concat(mergedKey).concat(parseStyle(value, hashId, "".concat(path, " -> ").concat(mergedKey), false, subInjectHash));
styleStr += "".concat(mergedKey).concat(parseStyle(value, hashId, "".concat(path, " -> ").concat(mergedKey), nextRoot, subInjectHash));
} else {

@@ -90,0 +100,0 @@ var _value$value;

@@ -105,4 +105,6 @@ "use strict";

var mergedKey = key.trim(); // 拆分多个选择器
var mergedKey = key.trim(); // Whether treat child as root. In most case it is false.
var nextRoot = false; // 拆分多个选择器
if ((root || injectHash) && hashId) {

@@ -119,5 +121,13 @@ if (mergedKey.startsWith('@')) {

}
} else if (root && !hashId && (mergedKey === '&' || mergedKey === '')) {
// In case of `{ '&': { a: { color: 'red' } } }` or `{ '': { a: { color: 'red' } } }` without hashId,
// we will get `&{a:{color:red;}}` or `{a:{color:red;}}` string for stylis to compile.
// But it does not conform to stylis syntax,
// and finally we will get `{color:red;}` as css, which is wrong.
// So we need to remove key in root, and treat child `{ a: { color: 'red' } }` as root.
mergedKey = '';
nextRoot = true;
}
styleStr += "".concat(mergedKey).concat(parseStyle(value, hashId, "".concat(path, " -> ").concat(mergedKey), false, subInjectHash));
styleStr += "".concat(mergedKey).concat(parseStyle(value, hashId, "".concat(path, " -> ").concat(mergedKey), nextRoot, subInjectHash));
} else {

@@ -124,0 +134,0 @@ var _value$value;

2

package.json
{
"name": "@ant-design/cssinjs",
"version": "0.0.0-alpha.37",
"version": "0.0.0-alpha.38",
"description": "Component level cssinjs resolution for antd",

@@ -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