@tamagui/web
Advanced tools
Comparing version 1.16.6 to 1.17.0
@@ -49,7 +49,4 @@ "use strict"; | ||
const isDarkOrLightBase = themeName === "dark" || themeName === "light"; | ||
const selectorsSet = new Set( | ||
names.map((name) => { | ||
return `${CNP}${name}`; | ||
}) | ||
); | ||
const baseSelectors = names.map((name) => `${CNP}${name}`); | ||
const selectorsSet = new Set(baseSelectors); | ||
if (hasDarkLight) { | ||
@@ -120,2 +117,11 @@ for (const subName of names) { | ||
} | ||
if (config.selectionStyles) { | ||
const selectionSelectors = baseSelectors.map((s) => `${s} ::selection`).join(", "); | ||
const rules = config.selectionStyles(theme); | ||
const styles = Object.entries(rules).map( | ||
([k, v]) => `${k === "backgroundColor" ? "background" : k}:${(0, import_createVariable.variableToString)(v)}` | ||
).join(";"); | ||
const css2 = `${selectionSelectors} {${styles}}`; | ||
cssRuleSets.push(css2); | ||
} | ||
return cssRuleSets; | ||
@@ -122,0 +128,0 @@ } |
@@ -26,7 +26,4 @@ import { simpleHash } from "@tamagui/helpers"; | ||
const isDarkOrLightBase = themeName === "dark" || themeName === "light"; | ||
const selectorsSet = new Set( | ||
names.map((name) => { | ||
return `${CNP}${name}`; | ||
}) | ||
); | ||
const baseSelectors = names.map((name) => `${CNP}${name}`); | ||
const selectorsSet = new Set(baseSelectors); | ||
if (hasDarkLight) { | ||
@@ -97,2 +94,11 @@ for (const subName of names) { | ||
} | ||
if (config.selectionStyles) { | ||
const selectionSelectors = baseSelectors.map((s) => `${s} ::selection`).join(", "); | ||
const rules = config.selectionStyles(theme); | ||
const styles = Object.entries(rules).map( | ||
([k, v]) => `${k === "backgroundColor" ? "background" : k}:${variableToString(v)}` | ||
).join(";"); | ||
const css2 = `${selectionSelectors} {${styles}}`; | ||
cssRuleSets.push(css2); | ||
} | ||
return cssRuleSets; | ||
@@ -99,0 +105,0 @@ } |
{ | ||
"name": "@tamagui/web", | ||
"version": "1.16.6", | ||
"version": "1.17.0", | ||
"source": "src/index.ts", | ||
@@ -30,9 +30,9 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/compose-refs": "1.16.6", | ||
"@tamagui/constants": "1.16.6", | ||
"@tamagui/helpers": "1.16.6", | ||
"@tamagui/normalize-css-color": "1.16.6", | ||
"@tamagui/use-did-finish-ssr": "1.16.6", | ||
"@tamagui/use-event": "1.16.6", | ||
"@tamagui/use-force-update": "1.16.6" | ||
"@tamagui/compose-refs": "1.17.0", | ||
"@tamagui/constants": "1.17.0", | ||
"@tamagui/helpers": "1.17.0", | ||
"@tamagui/normalize-css-color": "1.17.0", | ||
"@tamagui/use-did-finish-ssr": "1.17.0", | ||
"@tamagui/use-event": "1.17.0", | ||
"@tamagui/use-force-update": "1.17.0" | ||
}, | ||
@@ -43,3 +43,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@tamagui/build": "1.16.6", | ||
"@tamagui/build": "1.17.0", | ||
"@testing-library/react": "^13.4.0", | ||
@@ -46,0 +46,0 @@ "csstype": "^3.0.10", |
@@ -44,7 +44,4 @@ import { simpleHash } from '@tamagui/helpers' | ||
const isDarkOrLightBase = themeName === 'dark' || themeName === 'light' | ||
const selectorsSet = new Set( | ||
names.map((name) => { | ||
return `${CNP}${name}` | ||
}) | ||
) | ||
const baseSelectors = names.map((name) => `${CNP}${name}`) | ||
const selectorsSet = new Set(baseSelectors) | ||
@@ -145,2 +142,14 @@ // since we dont specify dark/light in classnames we have to do an awkward specificity war | ||
if (config.selectionStyles) { | ||
const selectionSelectors = baseSelectors.map((s) => `${s} ::selection`).join(', ') | ||
const rules = config.selectionStyles(theme) | ||
const styles = Object.entries(rules) | ||
.map( | ||
([k, v]) => `${k === 'backgroundColor' ? 'background' : k}:${variableToString(v)}` | ||
) | ||
.join(';') | ||
const css = `${selectionSelectors} {${styles}}` | ||
cssRuleSets.push(css) | ||
} | ||
return cssRuleSets | ||
@@ -147,0 +156,0 @@ } |
@@ -250,2 +250,9 @@ import type { StyleObject } from '@tamagui/helpers'; | ||
/** | ||
* Web-only: define text-selection CSS | ||
*/ | ||
selectionStyles?: (theme: ThemeParsed) => { | ||
backgroundColor?: ColorStyleProp; | ||
color?: ColorStyleProp; | ||
}; | ||
/** | ||
* *Advanced use case* For all CSS extracted views, this has no effect. | ||
@@ -252,0 +259,0 @@ * |
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
288
1420961
768
29456
+ Added@tamagui/compose-refs@1.17.0(transitive)
+ Added@tamagui/constants@1.17.0(transitive)
+ Added@tamagui/helpers@1.17.0(transitive)
+ Added@tamagui/normalize-css-color@1.17.0(transitive)
+ Added@tamagui/simple-hash@1.17.0(transitive)
+ Added@tamagui/use-did-finish-ssr@1.17.0(transitive)
+ Added@tamagui/use-event@1.17.0(transitive)
+ Added@tamagui/use-force-update@1.17.0(transitive)
- Removed@tamagui/compose-refs@1.16.6(transitive)
- Removed@tamagui/constants@1.16.6(transitive)
- Removed@tamagui/helpers@1.16.6(transitive)
- Removed@tamagui/normalize-css-color@1.16.6(transitive)
- Removed@tamagui/simple-hash@1.16.6(transitive)
- Removed@tamagui/use-did-finish-ssr@1.16.6(transitive)
- Removed@tamagui/use-event@1.16.6(transitive)
- Removed@tamagui/use-force-update@1.16.6(transitive)
Updated@tamagui/compose-refs@1.17.0
Updated@tamagui/constants@1.17.0
Updated@tamagui/helpers@1.17.0
Updated@tamagui/use-event@1.17.0