@codecademy/variance 0.24.1-alpha.ee215d.0 → 0.24.1-alpha.f1251e.0
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/core.js +10 -15
- package/dist/createTheme/createTheme.js +1 -1
- package/package.json +2 -2
package/dist/core.js
CHANGED
|
@@ -115,10 +115,7 @@ export const variance = {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
},
|
|
118
|
-
compose() {
|
|
119
|
-
for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
120
|
-
parsers[_key] = arguments[_key];
|
|
121
|
-
}
|
|
118
|
+
compose(...parsers) {
|
|
122
119
|
return this.createParser(parsers.reduce((carry, parser) => ({
|
|
123
120
|
...carry,
|
|
124
121
|
...parser.config
|
|
@@ -138,10 +135,9 @@ export const variance = {
|
|
|
138
135
|
const staticCss = getStaticCss(cssProps, ['theme',
|
|
139
136
|
// Just in case this gets passed somehow
|
|
140
137
|
...selectors, ...filteredProps]);
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
} = _ref;
|
|
138
|
+
return ({
|
|
139
|
+
theme
|
|
140
|
+
}) => {
|
|
145
141
|
if (cache) return cache;
|
|
146
142
|
const css = parser({
|
|
147
143
|
...cssProps,
|
|
@@ -169,13 +165,12 @@ export const variance = {
|
|
|
169
165
|
},
|
|
170
166
|
createVariant(config) {
|
|
171
167
|
const css = this.createCss(config);
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
} = _ref2;
|
|
168
|
+
return ({
|
|
169
|
+
prop = 'variant',
|
|
170
|
+
defaultVariant,
|
|
171
|
+
base = {},
|
|
172
|
+
variants
|
|
173
|
+
}) => {
|
|
179
174
|
const baseFn = css(base);
|
|
180
175
|
const variantFns = {};
|
|
181
176
|
Object.keys(variants).forEach(key => {
|
|
@@ -3,7 +3,7 @@ import merge from 'lodash/merge';
|
|
|
3
3
|
import { flattenScale } from '../utils/flattenScale';
|
|
4
4
|
import { serializeTokens } from '../utils/serializeTokens';
|
|
5
5
|
class ThemeBuilder {
|
|
6
|
-
#theme =
|
|
6
|
+
#theme = {};
|
|
7
7
|
constructor(baseTheme) {
|
|
8
8
|
this.#theme = baseTheme;
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/variance",
|
|
3
3
|
"description": "Constraint based CSS in JS for building scalable design systems",
|
|
4
|
-
"version": "0.24.1-alpha.
|
|
4
|
+
"version": "0.24.1-alpha.f1251e.0",
|
|
5
5
|
"author": "codecaaron <aaron@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"csstype": "^3.0.7",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"build": "nx build @codecademy/variance"
|
|
33
33
|
},
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "0f44bcb96e2fd718273e901a16ad3a0692e793f9"
|
|
36
36
|
}
|