Skip to content

Commit 2ef8ff5

Browse files
committed
Add logical CSS to examples app
1 parent ea3718d commit 2ef8ff5

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

  • apps/examples/src/components

apps/examples/src/components/App.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const greenPinkTheme = css.createTheme(themeColors, {
5252

5353
const themedStyles = css.create({
5454
container: {
55+
display: 'flex',
5556
flex: 1,
5657
justifyContent: 'center',
5758
backgroundColor: '#bbb',
@@ -323,6 +324,15 @@ function Shell(): React.MixedElement {
323324
</html.div>
324325
</ExampleBlock>
325326

327+
{/* logical styles emulation */}
328+
<ExampleBlock title="CSS Logical">
329+
<html.div>
330+
<html.div style={styles.logicalPadding} />
331+
<html.div style={styles.logicalMargin} />
332+
<html.div style={styles.logicalBorder} />
333+
</html.div>
334+
</ExampleBlock>
335+
326336
{/* CSS positioning (static by default) */}
327337
<ExampleBlock title="CSS Position">
328338
<html.div style={[styles.p50, styles.relative]}>
@@ -571,7 +581,7 @@ function Shell(): React.MixedElement {
571581
>
572582
<html.span style={styles.bgWhite}>{clickData.text}</html.span>
573583
<html.div style={styles.flex}>
574-
<html.div style={styles.flexGrow}>
584+
<html.div style={[styles.flex, styles.flexGrow]}>
575585
<html.div>
576586
<html.span>
577587
{clickEventData.altKey ? '✅' : '🚫'} altKey
@@ -593,7 +603,7 @@ function Shell(): React.MixedElement {
593603
</html.span>
594604
</html.div>
595605
</html.div>
596-
<html.div style={styles.flexGrow}>
606+
<html.div style={[styles.flex, styles.flexGrow]}>
597607
<html.div>
598608
<html.span>button: {clickEventData.button}</html.span>
599609
</html.div>
@@ -846,5 +856,34 @@ const styles = css.create({
846856
borderWidth: 1,
847857
borderStyle: 'solid',
848858
borderColor: 'black'
859+
},
860+
logicalMargin: {
861+
backgroundColor: 'pink',
862+
width: 50,
863+
height: 50,
864+
marginBlock: 20,
865+
marginInline: 20,
866+
borderColor: 'black',
867+
borderWidth: 1,
868+
borderStyle: 'solid'
869+
},
870+
logicalPadding: {
871+
backgroundColor: 'pink',
872+
width: 50,
873+
height: 50,
874+
paddingBlock: 20,
875+
paddingInline: 20,
876+
borderColor: 'black',
877+
borderWidth: 1,
878+
borderStyle: 'solid'
879+
},
880+
logicalBorder: {
881+
backgroundColor: 'pink',
882+
width: 50,
883+
height: 50,
884+
borderColor: 'red',
885+
borderBlockWidth: 20,
886+
borderInlineWidth: 20,
887+
borderStyle: 'solid'
849888
}
850889
});

0 commit comments

Comments
 (0)