Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Allow additional -webkit- properties #28

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/docs/components/StylexAnimatedLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ const styles = stylex.create({
},
mask1: {
maskImage: 'linear-gradient(125deg, white 30%, transparent 65%)',
// eslint-disable-next-line @stylexjs/valid-styles
WebkitMaskImage: 'linear-gradient(125deg, white 30%, transparent 65%)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to polyfill properties by outputting prefixed versions, rather than requiring developers to include them?

},
mask2: {
maskImage: 'linear-gradient(80deg, white 30%, transparent 65%)',
// eslint-disable-next-line @stylexjs/valid-styles
WebkitMaskImage: 'linear-gradient(80deg, white 30%, transparent 65%)',
},
dotPath: {
Expand Down
4 changes: 0 additions & 4 deletions apps/docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,9 @@ const styles = stylex.create({
backgroundColor: '#d6249f',
backgroundImage:
'radial-gradient(circle at 30% 107%, #ddd477 0%, #ddd477 5%, #fd5949 45%,#d6249f 60%, #285AEB 90%)',
// eslint-disable-next-line @stylexjs/valid-styles
WebkitBackgroundClip: 'text',
// eslint-disable-next-line @stylexjs/valid-styles
WebkitTextFillColor: 'transparent',
// eslint-disable-next-line @stylexjs/valid-styles
backgroundClip: 'text',
// eslint-disable-next-line @stylexjs/valid-styles
textFillColor: 'transparent',
},
threads: {},
Expand Down
26 changes: 20 additions & 6 deletions packages/eslint-plugin/src/stylex-valid-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,12 @@ const backfaceVisibility = makeUnionRule(
// type background = string | finalBgLayer;
const backgroundAttachment = attachment;
const backgroundBlendMode = blendMode;
const backgroundClip = box;
const backgroundClip = makeUnionRule(
'border-box',
'padding-box',
'content-box',
'text',
);
const backgroundColor = color;
const backgroundImage = makeUnionRule(makeLiteralRule('none'), isString);
const backgroundOrigin = box;
Expand Down Expand Up @@ -1540,6 +1545,19 @@ const SupportedVendorSpecificCSSProperties = {
WebkitAppearance: makeLiteralRule('textfield'),
WebkitTapHighlightColor: color,
WebkitOverflowScrolling: makeLiteralRule('touch'),

WebkitMaskImage: maskImage,

WebkitTextFillColor: color,
textFillColor: color,
WebkitTextStrokeWidth: borderWidth,
WebkitTextStrokeColor: color,
WebkitBackgroundClip: makeUnionRule(
'border-box',
'padding-box',
'content-box',
'text',
),
};

/* eslint-disable object-shorthand */
Expand All @@ -1552,11 +1570,7 @@ const CSSProperties = {
alignSelf: alignSelf,
alignmentBaseline: alignmentBaseline,
all: all,
animationComposition: makeUnionRule(
makeLiteralRule('replace'),
makeLiteralRule('add'),
makeLiteralRule('accumulate'),
),
animationComposition: makeUnionRule('replace', 'add', 'accumulate'),
animationDelay: animationDelay,
animationDirection: animationDirection,
animationDuration: animationDuration,
Expand Down
Loading
Loading