Skip to content

Commit

Permalink
Fix some nits in example
Browse files Browse the repository at this point in the history
  • Loading branch information
nedjulius committed Dec 10, 2023
1 parent 891c561 commit bad0b30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/esbuild-example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>@stylexjs/esbuild-plugin</title>
<meta charset="utf-8" />
<style>
* {
body {
box-sizing: border-box;
padding: 0;
margin: 0;
Expand Down
13 changes: 6 additions & 7 deletions apps/esbuild-example/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import * as stylex from '@stylexjs/stylex';
import { spacings, colors } from './tokens.stylex.js';
import { spacing, color } from './tokens.stylex.js';

const styles = stylex.create({
main: {
Expand All @@ -21,13 +21,12 @@ const styles = stylex.create({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: colors.pink,
backgroundColor: color.pink,
},
card: {
width: 100,
height: 100,
backgroundColor: colors.blue,
padding: spacings.medium,
backgroundColor: color.blue,
padding: spacing.medium,
borderRadius: spacing.small,
justifyContent: 'center',
display: 'flex',
alignItems: 'center',
Expand All @@ -39,7 +38,7 @@ function App() {
return (
<div {...stylex.props(styles.main)}>
<div {...stylex.props(styles.card)}>
<span>Blue box</span>
<span>Blue rounded rectangle</span>
</div>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions apps/esbuild-example/src/tokens.stylex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

import * as stylex from '@stylexjs/stylex';

export const spacings = stylex.defineVars({
small: 10,
medium: 20,
large: 30,
export const spacing = stylex.defineVars({
small: '10px',
medium: '20px',
large: '30px',
});

export const colors = stylex.defineVars({
export const color = stylex.defineVars({
blue: 'blue',
pink: 'pink',
});

0 comments on commit bad0b30

Please sign in to comment.