Skip to content

Commit

Permalink
fix css docs
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Apr 20, 2024
1 parent 58a685c commit 9186560
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
layout: layouts/Base.astro
order: 10
---
# CSS

# Inline styles
## Inline styles

Similarly to React, you can use js inline styles in dreamland. Here's an example:

Expand All @@ -28,7 +29,7 @@ let element = (
);
```

# Tagged CSS
## Tagged CSS
### Note
> This requires the `css` feature to be enabled in your build of dreamland. See the [Building Dreamland](/building-dreamland) page for more information.
Expand Down Expand Up @@ -77,15 +78,15 @@ Note that the css above the selectors gets applied to the root element. As of no



# Class arrays
## Class arrays
You can use arrays of class names in dreamland to simplify toggling classes. Here's an example:
```jsx
let state = $state({
active: true
});

let element = (
<div class={["container", use(state.active, a && "active")]}>
<div class={["container", use(state.active, a => a && "active")]}>
Hello, world!
</div>
);
Expand Down

0 comments on commit 9186560

Please sign in to comment.