Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

lint: no-border-shorthand reaches lab and charts; ChartTooltip's card draws its border in prebuilt CSS (#9442)

Cindy Zhangdabf6a125e3e
diff --git a/eslint.config.js b/eslint.config.js
index bba91b4868..b315b4d018 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -423,6 +423,24 @@ export default defineConfig(
'@astryx/disabled-cursor': 'error',
},
},
+ // StyleX compiles a `border` shorthand unevenly, and @astryxdesign/build's
+ // strict default refuses it, so a lab or charts component written with one
+ // ships without its border in the prebuilt stylesheet. Core already gets the
+ // rule from its config above; lab and charts get it at the same severity
+ // (error in strict mode, warning otherwise).
+ {
+ files: [
+ 'packages/lab/src/**/*.{ts,tsx}',
+ 'packages/charts/src/**/*.{ts,tsx}',
+ ],
+ plugins: {
+ '@astryx': astryxEslintPlugin,
+ },
+ rules: {
+ '@astryx/no-border-shorthand':
+ astryxConfig.rules['@astryx/no-border-shorthand'],
+ },
+ },
// `light-dark()` is the theme layer's mechanism, and reaches lab for the
// same reason the two rules above do: a component that hardcodes a
// light/dark decision is unreachable by every theme, and lab is where the
diff --git a/packages/charts/src/ChartTooltip.tsx b/packages/charts/src/ChartTooltip.tsx
index aff58d45ca..74c27b568d 100644
--- a/packages/charts/src/ChartTooltip.tsx
+++ b/packages/charts/src/ChartTooltip.tsx
@@ -97,7 +97,9 @@ const styles = stylex.create({
// positioning and browser top-layer promotion.
card: {
backgroundColor: colorVars['--color-background-popover'],
- border: `1px solid ${colorVars['--color-border']}`,
+ borderWidth: '1px',
+ borderStyle: 'solid',
+ borderColor: colorVars['--color-border'],
borderRadius: radiusVars['--radius-container'],
paddingBlock: spacingVars['--spacing-2'],
paddingInline: spacingVars['--spacing-3'],
diff --git a/packages/lab/src/MobileTokenizer/MobileTokenizer.test.tsx b/packages/lab/src/MobileTokenizer/MobileTokenizer.test.tsx
index 9fa9d6b47c..638c9f8a68 100644
--- a/packages/lab/src/MobileTokenizer/MobileTokenizer.test.tsx
+++ b/packages/lab/src/MobileTokenizer/MobileTokenizer.test.tsx
@@ -670,13 +670,13 @@ describe('MobileTokenizer (Lab, single-sheet flow)', () => {
const indicatorClasses = stylex
.props(
stylex.create({
- border: {
+ indicator: {
borderColor: {
default: colorVars['--color-border'],
'@media (forced-colors: active)': 'GrayText',
},
},
- }).border,
+ }).indicator,
)
.className!.split(' ')
.filter(name => !name.includes('__'));