@tamagui/web
Advanced tools
Comparing version 1.108.4 to 1.109.0
@@ -32,5 +32,4 @@ var __defProp = Object.defineProperty; | ||
} | ||
const niceKey = (0, import_helpers.simpleHash)(key); | ||
let name = isFont ? niceKey.slice(0, 2) : i; | ||
if (name = parentPath ? `${parentPath}-${name}` : niceKey, val && typeof val == "object") { | ||
const niceKey = (0, import_helpers.simpleHash)(key, 1e3), name = parentPath && parentPath !== "color" ? `${parentPath}-${niceKey}` : niceKey; | ||
if (val && typeof val == "object") { | ||
res[key] = createVariables( | ||
@@ -37,0 +36,0 @@ tokens[key], |
@@ -37,4 +37,4 @@ "use strict"; | ||
} | ||
var niceKey = (0, import_helpers.simpleHash)(key), name = isFont ? niceKey.slice(0, 2) : i; | ||
if (name = parentPath ? "".concat(parentPath, "-").concat(name) : niceKey, val && (typeof val > "u" ? "undefined" : _type_of(val)) === "object") { | ||
var niceKey = (0, import_helpers.simpleHash)(key, 1e3), name = parentPath && parentPath !== "color" ? "".concat(parentPath, "-").concat(niceKey) : niceKey; | ||
if (val && (typeof val > "u" ? "undefined" : _type_of(val)) === "object") { | ||
res[key] = createVariables(tokens[key], name, !1); | ||
@@ -41,0 +41,0 @@ continue; |
@@ -21,2 +21,3 @@ var __defProp = Object.defineProperty; | ||
var import_helpers = require("@tamagui/helpers"), import_constants = require("../constants/constants"), import_createVariable = require("../createVariable"), import_registerCSSVariable = require("./registerCSSVariable"), import_config = require("../config"); | ||
const darkLight = ["dark", "light"], lightDark = ["light", "dark"]; | ||
function getThemeCSSRules(props) { | ||
@@ -44,3 +45,3 @@ const cssRuleSets = []; | ||
} | ||
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, "")}`, order = isDark ? ["dark", "light"] : ["light", "dark"], [stronger, weaker] = order, numSelectors = Math.round(maxDepth * 1.5); | ||
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, "")}`, order = isDark ? darkLight : lightDark, [stronger, weaker] = order, numSelectors = Math.round(maxDepth * 1.5); | ||
for (let depth = 0; depth < numSelectors; depth++) { | ||
@@ -56,4 +57,4 @@ const isOdd = depth % 2 === 1; | ||
} | ||
const lastParentSelector = parentSelectors[parentSelectors.length - 1], nextChildSelector = childSelector === lastParentSelector ? "" : childSelector; | ||
selectorsSet.add(`${parentSelectors.join(" ")} ${nextChildSelector}`.trim()); | ||
const lastParentSelector = parentSelectors[parentSelectors.length - 1], nextChildSelector = childSelector === lastParentSelector ? "" : childSelector, parentSelectorString = parentSelectors.join(" "); | ||
selectorsSet.add(`${parentSelectorString} ${nextChildSelector}`); | ||
} | ||
@@ -60,0 +61,0 @@ } |
@@ -14,5 +14,4 @@ import { simpleHash } from "@tamagui/helpers"; | ||
} | ||
const niceKey = simpleHash(key); | ||
let name = isFont ? niceKey.slice(0, 2) : i; | ||
if (name = parentPath ? `${parentPath}-${name}` : niceKey, val && typeof val == "object") { | ||
const niceKey = simpleHash(key, 1e3), name = parentPath && parentPath !== "color" ? `${parentPath}-${niceKey}` : niceKey; | ||
if (val && typeof val == "object") { | ||
res[key] = createVariables( | ||
@@ -19,0 +18,0 @@ tokens[key], |
@@ -18,4 +18,4 @@ import { simpleHash } from "@tamagui/helpers"; | ||
} | ||
var niceKey = simpleHash(key), name = isFont ? niceKey.slice(0, 2) : i; | ||
if (name = parentPath ? "".concat(parentPath, "-").concat(name) : niceKey, val && (typeof val > "u" ? "undefined" : _type_of(val)) === "object") { | ||
var niceKey = simpleHash(key, 1e3), name = parentPath && parentPath !== "color" ? "".concat(parentPath, "-").concat(niceKey) : niceKey; | ||
if (val && (typeof val > "u" ? "undefined" : _type_of(val)) === "object") { | ||
res[key] = createVariables(tokens[key], name, !1); | ||
@@ -22,0 +22,0 @@ continue; |
@@ -6,2 +6,3 @@ import { simpleHash } from "@tamagui/helpers"; | ||
import { getSetting } from "../config"; | ||
const darkLight = ["dark", "light"], lightDark = ["light", "dark"]; | ||
function getThemeCSSRules(props) { | ||
@@ -29,3 +30,3 @@ const cssRuleSets = []; | ||
} | ||
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, "")}`, order = isDark ? ["dark", "light"] : ["light", "dark"], [stronger, weaker] = order, numSelectors = Math.round(maxDepth * 1.5); | ||
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, "")}`, order = isDark ? darkLight : lightDark, [stronger, weaker] = order, numSelectors = Math.round(maxDepth * 1.5); | ||
for (let depth = 0; depth < numSelectors; depth++) { | ||
@@ -41,4 +42,4 @@ const isOdd = depth % 2 === 1; | ||
} | ||
const lastParentSelector = parentSelectors[parentSelectors.length - 1], nextChildSelector = childSelector === lastParentSelector ? "" : childSelector; | ||
selectorsSet.add(`${parentSelectors.join(" ")} ${nextChildSelector}`.trim()); | ||
const lastParentSelector = parentSelectors[parentSelectors.length - 1], nextChildSelector = childSelector === lastParentSelector ? "" : childSelector, parentSelectorString = parentSelectors.join(" "); | ||
selectorsSet.add(`${parentSelectorString} ${nextChildSelector}`); | ||
} | ||
@@ -45,0 +46,0 @@ } |
{ | ||
"name": "@tamagui/web", | ||
"version": "1.108.4", | ||
"version": "1.109.0", | ||
"source": "src/index.ts", | ||
@@ -30,14 +30,14 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/compose-refs": "1.108.4", | ||
"@tamagui/constants": "1.108.4", | ||
"@tamagui/helpers": "1.108.4", | ||
"@tamagui/normalize-css-color": "1.108.4", | ||
"@tamagui/timer": "1.108.4", | ||
"@tamagui/types": "1.108.4", | ||
"@tamagui/use-did-finish-ssr": "1.108.4", | ||
"@tamagui/use-event": "1.108.4", | ||
"@tamagui/use-force-update": "1.108.4" | ||
"@tamagui/compose-refs": "1.109.0", | ||
"@tamagui/constants": "1.109.0", | ||
"@tamagui/helpers": "1.109.0", | ||
"@tamagui/normalize-css-color": "1.109.0", | ||
"@tamagui/timer": "1.109.0", | ||
"@tamagui/types": "1.109.0", | ||
"@tamagui/use-did-finish-ssr": "1.109.0", | ||
"@tamagui/use-event": "1.109.0", | ||
"@tamagui/use-force-update": "1.109.0" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.108.4", | ||
"@tamagui/build": "1.109.0", | ||
"@testing-library/react": "^16.0.0", | ||
@@ -44,0 +44,0 @@ "csstype": "^3.0.10", |
@@ -37,2 +37,3 @@ import { simpleHash } from '@tamagui/helpers' | ||
const key = isPrefixed ? keyWithPrefix.slice(1) : keyIn | ||
if (isVariable(val)) { | ||
@@ -42,5 +43,6 @@ res[key] = val | ||
} | ||
const niceKey = simpleHash(key) | ||
let name = isFont ? niceKey.slice(0, 2) : i | ||
name = parentPath ? `${parentPath}-${name}` : niceKey | ||
const niceKey = simpleHash(key, 1000) | ||
const name = | ||
parentPath && parentPath !== 'color' ? `${parentPath}-${niceKey}` : niceKey | ||
if (val && typeof val === 'object') { | ||
@@ -47,0 +49,0 @@ // recurse |
@@ -10,2 +10,5 @@ import { simpleHash } from '@tamagui/helpers' | ||
const darkLight = ['dark', 'light'] | ||
const lightDark = ['light', 'dark'] | ||
export function getThemeCSSRules(props: { | ||
@@ -78,3 +81,3 @@ config: CreateTamaguiProps | ||
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, '')}` | ||
const order = isDark ? ['dark', 'light'] : ['light', 'dark'] | ||
const order = isDark ? darkLight : lightDark | ||
const [stronger, weaker] = order | ||
@@ -107,3 +110,4 @@ const numSelectors = Math.round(maxDepth * 1.5) | ||
// for light/dark/light: | ||
selectorsSet.add(`${parentSelectors.join(' ')} ${nextChildSelector}`.trim()) | ||
const parentSelectorString = parentSelectors.join(' ') | ||
selectorsSet.add(`${parentSelectorString} ${nextChildSelector}`) | ||
// selectorsSet.add( | ||
@@ -135,3 +139,2 @@ // `${parentSelectors.join(' ')} ${nextChildSelector}.is_inversed`.trim() | ||
const fgString = theme.color ? `color:${variableToString(theme.color)}` : '' | ||
const bodyRules = `body{${bgString}${fgString}}` | ||
@@ -138,0 +141,0 @@ const isDark = themeName.startsWith('dark') |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
3099558
49103
+ Added@tamagui/compose-refs@1.109.0(transitive)
+ Added@tamagui/constants@1.109.0(transitive)
+ Added@tamagui/helpers@1.109.0(transitive)
+ Added@tamagui/normalize-css-color@1.109.0(transitive)
+ Added@tamagui/simple-hash@1.109.0(transitive)
+ Added@tamagui/timer@1.109.0(transitive)
+ Added@tamagui/types@1.109.0(transitive)
+ Added@tamagui/use-did-finish-ssr@1.109.0(transitive)
+ Added@tamagui/use-event@1.109.0(transitive)
+ Added@tamagui/use-force-update@1.109.0(transitive)
- Removed@tamagui/compose-refs@1.108.4(transitive)
- Removed@tamagui/constants@1.108.4(transitive)
- Removed@tamagui/helpers@1.108.4(transitive)
- Removed@tamagui/normalize-css-color@1.108.4(transitive)
- Removed@tamagui/simple-hash@1.108.4(transitive)
- Removed@tamagui/timer@1.108.4(transitive)
- Removed@tamagui/types@1.108.4(transitive)
- Removed@tamagui/use-did-finish-ssr@1.108.4(transitive)
- Removed@tamagui/use-event@1.108.4(transitive)
- Removed@tamagui/use-force-update@1.108.4(transitive)
Updated@tamagui/constants@1.109.0
Updated@tamagui/helpers@1.109.0
Updated@tamagui/timer@1.109.0
Updated@tamagui/types@1.109.0
Updated@tamagui/use-event@1.109.0