css-engine-test-pb 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/compiler.js CHANGED
@@ -51,7 +51,16 @@ export class StyleCompiler {
51
51
  if (isPseudoSelector(key) && value) {
52
52
  const pseudoStyles = this.buildCSSBlock(value);
53
53
  if (pseudoStyles) {
54
- css += `.${className}${key} { ${pseudoStyles} }\n`;
54
+ if (key.includes(',')) {
55
+ const selectors = key
56
+ .split(',')
57
+ .map(s => `.${className}${s.trim()}`)
58
+ .join(', ');
59
+ css += `${selectors} { ${pseudoStyles} }\n`;
60
+ }
61
+ else {
62
+ css += `.${className}${key} { ${pseudoStyles} }\n`;
63
+ }
55
64
  }
56
65
  }
57
66
  }
@@ -71,7 +80,16 @@ export class StyleCompiler {
71
80
  if (isPseudoSelector(nestedKey) && nestedValue) {
72
81
  const pseudoStyles = this.buildCSSBlock(nestedValue);
73
82
  if (pseudoStyles) {
74
- mediaCss += `.${className}${nestedKey} { ${pseudoStyles} }\n`;
83
+ if (nestedKey.includes(',')) {
84
+ const selectors = nestedKey
85
+ .split(',')
86
+ .map(s => `.${className}${s.trim()}`)
87
+ .join(', ');
88
+ mediaCss += `${selectors} { ${pseudoStyles} }\n`;
89
+ }
90
+ else {
91
+ mediaCss += `.${className}${nestedKey} { ${pseudoStyles} }\n`;
92
+ }
75
93
  }
76
94
  }
77
95
  }
@@ -93,7 +111,17 @@ export class StyleCompiler {
93
111
  const kebabProperty = camelToKebab(property);
94
112
  const hashInput = `${kebabProperty}:${value}${pseudo || ''}${media || ''}`;
95
113
  const className = createClassName(hashInput);
96
- const selector = pseudo ? `.${className}${pseudo}` : `.${className}`;
114
+ let selector;
115
+ if (pseudo && pseudo.includes(',')) {
116
+ const selectors = pseudo
117
+ .split(',')
118
+ .map(s => `.${className}${s.trim()}`)
119
+ .join(', ');
120
+ selector = selectors;
121
+ }
122
+ else {
123
+ selector = pseudo ? `.${className}${pseudo}` : `.${className}`;
124
+ }
97
125
  const cssRule = `${selector} { ${kebabProperty}: ${value}; }`;
98
126
  const bucket = determineBucket(pseudo, media);
99
127
  let cssText = cssRule;
@@ -1,7 +1,2 @@
1
- import { CSSValue } from '../types';
2
- export declare function borderColor(value: CSSValue): {
3
- borderTopColor: CSSValue;
4
- borderRightColor: CSSValue;
5
- borderBottomColor: CSSValue;
6
- borderLeftColor: CSSValue;
7
- };
1
+ import { CSSValue, CSSProperties } from '../types';
2
+ export declare function borderColor(value: CSSValue): CSSProperties;
package/dist/types.d.ts CHANGED
@@ -62,11 +62,27 @@ export interface CSSProperties {
62
62
  borderStyle?: CSSValue;
63
63
  borderColor?: CSSValue;
64
64
  borderRadius?: CSSValue;
65
+ borderTopColor?: CSSValue;
66
+ borderRightColor?: CSSValue;
67
+ borderBottomColor?: CSSValue;
68
+ borderLeftColor?: CSSValue;
65
69
  opacity?: CSSValue;
66
70
  boxShadow?: CSSValue;
67
71
  transform?: CSSValue;
68
72
  transition?: CSSValue;
73
+ transitionDuration?: CSSValue;
74
+ transitionProperty?: CSSValue;
75
+ transitionTimingFunction?: CSSValue;
76
+ transitionDelay?: CSSValue;
69
77
  animation?: CSSValue;
78
+ animationDuration?: CSSValue;
79
+ animationTimingFunction?: CSSValue;
80
+ animationDelay?: CSSValue;
81
+ animationIterationCount?: CSSValue;
82
+ animationDirection?: CSSValue;
83
+ animationFillMode?: CSSValue;
84
+ animationPlayState?: CSSValue;
85
+ animationName?: CSSValue;
70
86
  overflow?: CSSValue;
71
87
  overflowX?: CSSValue;
72
88
  overflowY?: CSSValue;
@@ -87,6 +103,14 @@ export interface CSSPseudos {
87
103
  '::before'?: CSSProperties;
88
104
  '::after'?: CSSProperties;
89
105
  '::placeholder'?: CSSProperties;
106
+ ':hover:active'?: CSSProperties;
107
+ ':active:focus-visible'?: CSSProperties;
108
+ ':hover:focus-visible'?: CSSProperties;
109
+ ':hover:active, :hover:focus-visible'?: CSSProperties;
110
+ ':hover:active,:hover:focus-visible'?: CSSProperties;
111
+ ':hover:active, :active:focus-visible'?: CSSProperties;
112
+ ':hover:active,:active:focus-visible'?: CSSProperties;
113
+ [key: `${':' | '::'}${string}`]: CSSProperties | undefined;
90
114
  }
91
115
  export interface CSSMediaQueries {
92
116
  '@media (min-width: 480px)'?: CSSProperties & CSSPseudos;
@@ -95,6 +119,7 @@ export interface CSSMediaQueries {
95
119
  '@media (min-width: 1440px)'?: CSSProperties & CSSPseudos;
96
120
  '@media (prefers-color-scheme: dark)'?: CSSProperties & CSSPseudos;
97
121
  '@media (prefers-reduced-motion: reduce)'?: CSSProperties & CSSPseudos;
122
+ [key: `@media ${string}`]: (CSSProperties & CSSPseudos) | undefined;
98
123
  }
99
124
  export type StyleRule = CSSProperties & CSSPseudos & CSSMediaQueries;
100
125
  export type StyleDefinition = StyleRule | (() => StyleRule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-engine-test-pb",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",