Skip to content

Commit

Permalink
Fixed Typo
Browse files Browse the repository at this point in the history
1. It's generally good practice to include a space before the curly braces in the import statement for better readability.

2. descendants spelling was incorrect.

3. Replaced on with to which is a minor grammatical error
  • Loading branch information
kamranhab authored Dec 12, 2023
1 parent ca1dc8b commit 48c263c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/docs/docs/learn/05-theming/03-creating-themes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sidebar_position: 3
:::info Note

The [`unstable_moduleResolution`](/docs/api/configuration/babel-plugin/#unstable_moduleresolution)
option needs to be enabled in the StyleX Babel configuration to enable theming APIs.
option must be enabled in the StyleX Babel configuration to enable theming APIs.

:::

Expand All @@ -24,7 +24,7 @@ Any variable group can be imported to create a theme like so:

```tsx title="themes.js"
import * as stylex from '@stylexjs/stylex';
import {colors, spacing} from './tokens.styles';
import { colors, spacing } from './tokens.styles';

// A constant can be used to avoid repeating the media query
const DARK = '@media (prefers-color-scheme: dark)';
Expand All @@ -46,12 +46,12 @@ export const dracula = stylex.createTheme(colors, {

A “theme” is a style object similar to the ones created with `stylex.create()`.
They can be applied to an element using `stylex.props()` to override variables
for that element and all its descendents.
for that element and all its descendants.

```tsx title="components/MyComponent.js"
import * as stylex from '@stylexjs/stylex';
import {colors, spacing} from '../tokens.styles';
import {dracula} from '../themes';
import { colors, spacing } from '../tokens.styles';
import { dracula } from '../themes';

const styles = stylex.create({
container: {
Expand All @@ -74,7 +74,7 @@ components.

:::info

If multiple themes for the same variable group are applied on the same HTML
If multiple themes for the same variable group are applied to the same HTML
element, the last applied theme wins.

:::

0 comments on commit 48c263c

Please sign in to comment.