Skip to content
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: 1 addition & 1 deletion apps/website/docs/api/02-css/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following tables represent the compatibility status of the strict CSS API fo
| backdropFilter | ❌ | ❌ | |
| backfaceVisibility | ✅ | ✅ | |
| backgroundColor | ✅ | ✅ | |
| backgroundImage | ❌ | ❌ | |
| backgroundImage | 🟡 Partial | 🟡 Partial | Support for linear and radial gradients in React Native |
| backgroundOrigin | ❌ | ❌ | |
| backgroundPosition | ❌ | ❌ | |
| backgroundRepeat | ❌ | ❌ | |
Expand Down
3 changes: 3 additions & 0 deletions packages/react-strict-dom/src/native/stylex/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ function processStyle(
);
}
continue;
} else if (propName === 'backgroundImage') {
result.experimental_backgroundImage = styleValue;
continue;
}
// Workaround unsupported objectFit values
else if (propName === 'objectFit' && styleValue === 'none') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const allowedStyleKeySet = new Set<string>([
'aspectRatio',
'backfaceVisibility',
'backgroundColor',
'backgroundImage',
'blockSize',
'borderBottomColor',
'borderBottomLeftRadius',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ exports[`properties: general animationDuration 1`] = `
}
`;

exports[`properties: general backgroundImage 1`] = `
{
"style": {
"experimental_backgroundImage": "linear-gradient(to bottom right, yellow, green)",
},
}
`;

exports[`properties: general borderColor 1`] = `
{
"style": {
Expand Down
5 changes: 2 additions & 3 deletions packages/react-strict-dom/tests/css-test.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,10 @@ describe('properties: general', () => {
test('backgroundImage', () => {
const styles = css.create({
root: {
backgroundImage: 'url(https://placehold.it/300/300)'
backgroundImage: 'linear-gradient(to bottom right, yellow, green)'
}
});
css.props.call(mockOptions, styles.root);
expect(console.warn).toHaveBeenCalled();
expect(css.props.call(mockOptions, styles.root)).toMatchSnapshot();
});

test('borderColor', () => {
Expand Down