-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable embedded CSS formatting on save
- Loading branch information
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
'playroom': minor | ||
--- | ||
|
||
Enable embedded CSS formatting on save | ||
|
||
CSS authored inside `style` tags inside a playroom will now be formatted as CSS when wrapped in a `css` template literal tag. | ||
|
||
A `css` template literal tag can be injected into your playroom scope via the [custom scope] feature: | ||
|
||
```js | ||
// customScope.js | ||
|
||
export default () => { | ||
return { | ||
css: (css) => css, | ||
}; | ||
}; | ||
``` | ||
|
||
This template literal tag can then be used in your playroom: | ||
|
||
```jsx | ||
<style> | ||
{css` | ||
.foo { | ||
color: red; | ||
} | ||
`} | ||
</style> | ||
<div className="foo">Hello, world!</div> | ||
``` | ||
|
||
[custom scope]: https://github.com/seek-oss/playroom?tab=readme-ov-file#custom-scope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default () => { | ||
return { | ||
css: (css) => css, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters