Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
titoBouzout committed Feb 14, 2025
1 parent 74a1707 commit 4d999a2
Show file tree
Hide file tree
Showing 11 changed files with 250 additions and 131 deletions.
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ render(
>
<path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" />
</svg>

<aside
id="menu"
flair="grow col"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/@props/attributes-properties/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ export default function () {
</tr>
<tr>
<td>
<mark>css</mark>
<mark>plugin:css</mark>
</td>
<td>
<mark>
{
'<span css="class{color:green} class:hover{color:red}"/>'
'<span plugin:css="class{color:green} class:hover{color:red}"/>'
}
</mark>{' '}
becomes{' '}
Expand Down
9 changes: 7 additions & 2 deletions src/pages/@props/css/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@ export default function () {
<>
<Header title="css">
There are a variety of ways to set and inline <mark>CSS</mark>{' '}
<div plugin:css="class{color:green} class:hover{color:red}"></div>
StylesSheets.
</Header>

<Section title="Inline CSS">
<Section title="Inline CSS In The Document">
<p>
Could be done just using JSX. <mark>css</mark> creates a{' '}
<mark>CSSStyleSheet</mark> and adds it to the document. The{' '}
<mark>CSSStyleSheet</mark> is removed from the document when
the element is destroyed.
</p>

<Code url="/pages/@props/css/inline.jsx"></Code>
</Section>
<Section title="Inline CSS In An Attribute">
<p>
In an attribute of an element you may use the keyword{' '}
<mark>class</mark> which will be replaced for a random
class, and that class will be added to the element.
</p>
<Code url="/pages/@props/css/inline.jsx"></Code>
<Code url="/pages/@props/css/jsx.jsx"></Code>
</Section>
</>
)
Expand Down
6 changes: 1 addition & 5 deletions src/pages/@props/css/inline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ function App() {
color: purple;
}
`}
<section>test inlining a stylesheet in the document</section>

<section css="class{color:green} class:hover{color:red}">
fancy css inline for a specific element
</section>
<section>fancy inline in the document</section>
</main>
)
}
Expand Down
11 changes: 11 additions & 0 deletions src/pages/@props/css/jsx.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { render } from 'pota'

function App() {
return (
<main>
<section>fancy css in attribute</section>
</main>
)
}

render(App)
107 changes: 70 additions & 37 deletions src/pages/benchmark/dev/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pages/benchmark/dev/main.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4d999a2

Please sign in to comment.