Skip to content
Open
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
43 changes: 0 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/benchmarks/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const styles = StyleSheet.create({
color: colors.deepGray
},
picker: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
appearance: 'none',
opacity: 0,
width: '100%'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ import { StyleSheet } from 'react-native';
A very common pattern is to create overlays with position absolute and zero positioning, so `absoluteFill` can be used for convenience and to reduce duplication of these repeated styles.
{% endcall %}

{% call macro.prop('absoluteFillObject', '?Object') %}
Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be used to create a customized entry in a StyleSheet.
{% endcall %}

{% call macro.prop('hairlineWidth', '?Object') %}
Equal to 1px. This is not implemented using screen density as browsers may round sub-pixel values down to `0`, causing the line not to be rendered.
{% endcall %}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-web/src/exports/CheckBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const styles = StyleSheet.create({
borderColor: '#AAB8C2'
},
nativeControl: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
height: '100%',
margin: 0,
appearance: 'none',
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-web/src/exports/Image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const styles = StyleSheet.create({
resizeMode: null
},
image: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
backgroundColor: 'transparent',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
Expand All @@ -408,7 +408,7 @@ const styles = StyleSheet.create({
zIndex: -1
},
accessibilityImage$raw: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
height: '100%',
opacity: 0,
width: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ describe('StyleSheet', () => {
`);
});

test('absoluteFillObject', () => {
expect(StyleSheet.absoluteFillObject).toMatchInlineSnapshot(`
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
`);
});

describe('create', () => {
test('returns original style objects', () => {
const style = StyleSheet.create({ root: { position: 'absolute' } });
Expand Down
14 changes: 3 additions & 11 deletions packages/react-native-web/src/exports/StyleSheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,9 @@ function compileAndInsertReset(style, key) {

/* ----- API ----- */

const absoluteFillObject = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
};

const absoluteFill = create({ x: { ...absoluteFillObject } }).x;
const absoluteFill = create({
x: { position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 }
}).x;

/**
* create
Expand Down Expand Up @@ -168,7 +162,6 @@ function StyleSheet(styles: any, options?: Options = {}): StyleProps {
}

StyleSheet.absoluteFill = absoluteFill;
StyleSheet.absoluteFillObject = absoluteFillObject;
StyleSheet.create = create;
StyleSheet.compose = compose;
StyleSheet.flatten = flatten;
Expand All @@ -184,7 +177,6 @@ if (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
export type IStyleSheet = {
(styles: $ReadOnlyArray<any>, options?: Options): StyleProps,
absoluteFill: Object,
absoluteFillObject: Object,
create: typeof create,
compose: typeof compose,
flatten: typeof flatten,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-web/src/exports/Switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const styles = StyleSheet.create({
},
track: {
forcedColorAdjust: 'none',
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
height: '70%',
margin: 'auto',
transitionDuration: '0.1s',
Expand All @@ -224,7 +224,7 @@ const styles = StyleSheet.create({
insetInlineStart: '100%'
},
nativeControl: {
...StyleSheet.absoluteFillObject,
...StyleSheet.absoluteFill,
height: '100%',
margin: 0,
appearance: 'none',
Expand Down