@kaze-style/core
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -1,1 +0,1 @@ | ||
import{checkStyleOrder as b}from"./utils/checkStyleOrder";import{combinedQuery as y}from"./utils/combinedQuery";import{compileCss as O}from"./utils/compileCss";import{compileKeyFrameCss as j}from"./utils/compileKeyFrameCss";import{hashClassName as u}from"./utils/hashClassName";import{hashSelector as N}from"./utils/hashSelector";import{hyphenateProperty as h}from"./utils/hyphenateProperty";import{isCssValue as g}from"./utils/isCssValue";import{isLayerSelector as C}from"./utils/isLayerSelector";import{isMediaQuerySelector as S}from"./utils/isMediaQuerySelector";import{isNestedSelector as d}from"./utils/isNestedSelector";import{isObject as R}from"./utils/isObject";import{isShortHandProperty as K}from"./utils/isShortHandProperty";import{isSupportQuerySelector as Q}from"./utils/isSupportQuerySelector";import{normalizeNestedProperty as k}from"./utils/normalizeNestedProperty";import{omit as z}from"./utils/omit";import{resolveShortHandStyle as A}from"./utils/resolveShortHandStyle";const i=({style:p,pseudo:o="",atRules:e={media:"",layer:"",support:""},resolvedStyle:t={classNameObject:{},cssRuleObjects:[]}})=>{for(const l in p){const r=l,m=p[r];if(g(m))if(K(r)){const s=A(r,m);i({style:Object.assign(z(p,[r]),s),pseudo:o,atRules:e,resolvedStyle:t})}else{const s=h(r),a=u({pseudo:o,atRules:e,property:s,styleValue:m}),c=N({pseudo:o,atRules:e,property:s}),n=O({className:a,pseudo:o,atRules:e,property:s,styleValue:m}),f=b({atRules:e,pseudo:o});t.cssRuleObjects.push({cssRule:n,order:f}),Object.assign(t.classNameObject,{[c]:a})}else if(r==="animationName"){const s=m,{keyframesRule:a,keyframeName:c}=j(s);t.cssRuleObjects.push({cssRule:a,order:"keyframes"}),Object.assign(t.classNameObject,{[c]:c}),i({style:{animationName:c},pseudo:o,atRules:e,resolvedStyle:t})}else if(R(m))if(S(r)){const s=y(e.media,r.slice(6).trim());i({style:m,pseudo:o,atRules:Object.assign({},e,{media:s}),resolvedStyle:t})}else if(C(r)){const s=(e.layer?`${e.layer}.`:"")+r.slice(6).trim();i({style:m,pseudo:o,atRules:Object.assign({},e,{layer:s}),resolvedStyle:t})}else if(Q(r)){const s=y(e.support,r.slice(9).trim());i({style:m,pseudo:o,atRules:Object.assign({},e,{support:s}),resolvedStyle:t})}else d(r)&&i({style:m,pseudo:o+k(r),atRules:e,resolvedStyle:t})}return t};export{i as resolveStyle}; | ||
import{checkStyleOrder as b}from"./utils/checkStyleOrder";import{combinedQuery as y}from"./utils/combinedQuery";import{compileCss as O}from"./utils/compileCss";import{compileKeyFrameCss as j}from"./utils/compileKeyFrameCss";import{hashClassName as u}from"./utils/hashClassName";import{hashSelector as N}from"./utils/hashSelector";import{hyphenateProperty as h}from"./utils/hyphenateProperty";import{isCssValue as g}from"./utils/isCssValue";import{isLayerSelector as C}from"./utils/isLayerSelector";import{isMediaQuerySelector as S}from"./utils/isMediaQuerySelector";import{isNestedSelector as d}from"./utils/isNestedSelector";import{isObject as R}from"./utils/isObject";import{isShortHandProperty as K}from"./utils/isShortHandProperty";import{isSupportQuerySelector as Q}from"./utils/isSupportQuerySelector";import{normalizeNestedProperty as k}from"./utils/normalizeNestedProperty";import{omit as z}from"./utils/omit";import{resolveShortHandStyle as A}from"./utils/resolveShortHandStyle";const i=({style:p,pseudo:o="",atRules:e={media:"",layer:"",support:""},resolvedStyle:t={classNameObject:{},cssRuleObjects:[]}})=>{for(const l in p){const r=l,m=p[r];if(g(m))if(K(r)){const s=A(r,m);i({style:Object.assign(z(p,[r]),s),pseudo:o,atRules:e,resolvedStyle:t})}else{const s=h(r),a=u({pseudo:o,atRules:e,property:s,styleValue:m}),c=N({pseudo:o,atRules:e,property:s}),n=O({className:a,pseudo:o,atRules:e,property:s,styleValue:m}),f=b({atRules:e,pseudo:o});t.cssRuleObjects.push({cssRule:n,order:f}),Object.assign(t.classNameObject,{[c]:a})}else if(r==="animationName"){const s=m,{keyframesRule:a,keyframeName:c}=j(s);t.cssRuleObjects.push({cssRule:a,order:"keyframes"}),Object.assign(t.classNameObject,{[c]:c}),i({style:{animationName:c},pseudo:o,atRules:e,resolvedStyle:t})}else if(R(m))if(S(r)){const s=y(e.media,r.slice(6).trim());i({style:m,pseudo:o,atRules:Object.assign({},e,{media:s}),resolvedStyle:t})}else if(C(r)){const s=(e.layer?`${e.layer}.`:"")+r.slice(6).trim();i({style:m,pseudo:o,atRules:Object.assign({},e,{layer:s}),resolvedStyle:t})}else if(Q(r)){const s=y(e.support,r.slice(9).trim());i({style:m,pseudo:o,atRules:Object.assign({},e,{support:s}),resolvedStyle:t})}else d(r)&&i({style:m,pseudo:k(r,o),atRules:e,resolvedStyle:t})}return t};export{i as resolveStyle}; |
@@ -1,1 +0,1 @@ | ||
const $=({className:t,pseudo:p,atRules:e,property:o,styleValue:i})=>{let s="",r="";return p?s=`.${t}${p.replace(/&/g,`.${t}`)}`:s=`.${t}`,Array.isArray(i)?r=`${s}{${o}:${i.join(" ")};}`:r=`${s}{${o}:${i};}`,e.media&&(r=`@media ${e.media} {${r}}`),e.layer&&(r=`@layer ${e.layer} {${r}}`),e.support&&(r=`@supports ${e.support} {${r}}`),r};export{$ as compileCss}; | ||
const l=({className:i,pseudo:p,atRules:e,property:o,styleValue:t})=>{let s="",r="";return p?s=`${p.replace(/&/g,`.${i}`)}`:s=`.${i}`,Array.isArray(t)?r=`${s}{${o}:${t.join(" ")};}`:r=`${s}{${o}:${t};}`,e.media&&(r=`@media ${e.media} {${r}}`),e.layer&&(r=`@layer ${e.layer} {${r}}`),e.support&&(r=`@supports ${e.support} {${r}}`),r};export{l as compileCss}; |
@@ -1,1 +0,1 @@ | ||
export declare const normalizeNestedProperty: (nestedProperty: string) => string; | ||
export declare const normalizeNestedProperty: (nestedProperty: string, nowProperty: string) => string; |
@@ -1,1 +0,1 @@ | ||
const i=r=>r.charAt(0)==="&"?r.slice(1):r;export{i as normalizeNestedProperty}; | ||
const s=(i,c)=>{let l=c;return c!==""?l+=i.charAt(0)==="&"?i.slice(1):i:l=i.includes("&")===!0?i:"&"+i,l};export{s as normalizeNestedProperty}; |
{ | ||
"name": "@kaze-style/core", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Taishi Naritomi", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68915