Skip to content

Commit e4b77ff

Browse files
committed
Reorganize documentation
1 parent 38ce000 commit e4b77ff

118 files changed

Lines changed: 1667 additions & 875 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.

site/app/[locale]/guide/syntax/components/AtDefault.tsx renamed to site/app/[locale]/guide/at/components/Default.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default () =>
66
<DocTable>
77
<thead>
88
<tr>
9-
<th>Name</th>
10-
<th>Value</th>
9+
<th>Token</th>
10+
<th>CSS text</th>
1111
</tr>
1212
</thead>
1313
<tbody>
@@ -19,9 +19,9 @@ export default () =>
1919
const eachBreakpoint = at[eachBreakpointName]
2020
return (
2121
<tr key={eachBreakpointName}>
22-
<td><code>{eachBreakpointName}</code></td>
22+
<th><code>{eachBreakpointName}</code></th>
2323
<td>
24-
<InlineCode lang="js">{JSON.stringify(eachBreakpoint)}</InlineCode>
24+
<InlineCode>{eachBreakpoint}</InlineCode>
2525
</td>
2626
</tr>
2727
)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Code lang="js" name="master.css.js">{require('!!raw-loader!../tests/add-a-media-query/master.css.js').default}</Code>
2-
(!) You wouldn't want to write full media queries within the markup.
3-
```html
4-
<!-- @MARK @media(orientation:landscape) -->
5-
<div class="aspect:2/1@media(orientation:landscape)">…</div>
6-
```
7-
(o) Employ concise yet semantically meaningful markup.
2+
Employ concise yet semantically meaningful markup.
83
<Code lang="html">{require('!!raw-loader!../tests/add-a-media-query/template.html').default}</Code>
94
<details>
105
<summary>Generated CSS</summary>
116
<div>
127
<Code lang="css" beautify>{require('!!raw-loader!../tests/add-a-media-query/generated.css?raw').default}</Code>
138
</div>
14-
</details>
9+
</details>
10+
(!) You wouldn't want to write full condtions within the markup.
11+
```html
12+
<!-- @MARK @media(orientation:landscape) -->
13+
<div class="aspect:2/1@media(orientation:landscape)">…</div>
14+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Overview [sr-only]
2+
<Default />
3+
In native CSS, it's not possible to reuse queries through CSS variables. By tokenizing *media queries*, *feature queries*, *container queries*, and applying them with flexible syntax within the markup.
4+
<Overview />
5+
6+
---
7+
8+
## Basic usage
9+
### Add a media query token
10+
Create a media query token, such as `@landscape`, to represent landscape orientation.
11+
<Code lang="js" name="master.css.js">{require('!!raw-loader!./tests/add-a-media-query/master.css.js').default}</Code>
12+
When displayed in landscape orientation, the image is presented in a 2:1 aspect ratio.
13+
<Code lang="html">{require('!!raw-loader!./tests/add-a-media-query/template.html').default}</Code>
14+
<details>
15+
<summary>Generated CSS</summary>
16+
<div>
17+
<Code lang="css" beautify>{require('!!raw-loader!./tests/add-a-media-query/generated.css?raw').default}</Code>
18+
</div>
19+
</details>
20+
21+
### Add a feature query token
22+
Create a feature query token, such as `@supports-backdrop`, to apply styles based on `backdrop-filter` support.
23+
<Code lang="js" name="master.css.js">{require('!!raw-loader!./tests/add-a-feature-query/master.css.js').default}</Code>
24+
Applies translucent background only when `backdrop-filter` is supported.
25+
<Code lang="html">{require('!!raw-loader!./tests/add-a-feature-query/template.html').default}</Code>
26+
<details>
27+
<summary>Generated CSS</summary>
28+
<div>
29+
<Code lang="css" beautify>{require('!!raw-loader!./tests/add-a-feature-query/generated.css?raw').default}</Code>
30+
</div>
31+
</details>
32+
33+
### Add a feature name alias
34+
Create a feature name alias to shorten the syntax of a feature query.
35+
```js name=master.css.js
36+
export default {
37+
at: {
38+
h: 'height' // [!code highlight]
39+
}
40+
}
41+
```
42+
Use the name alias `h`:
43+
```html
44+
<!-- @MARK h -->
45+
<div class="hidden@container(h<=200)">…</div>
46+
```
47+
<details>
48+
<summary>Generated CSS</summary>
49+
<Class2CSS>
50+
{['hidden@container(h<=200)']}
51+
</Class2CSS>
52+
</details>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import define from 'internal/utils/metadata'
2+
3+
const metadata = define({
4+
title: 'Customizing At-rules',
5+
description: 'A guide to adding custom at-rule tokens and aliases.',
6+
category: 'Customization',
7+
other: {
8+
subject: 'At-rules',
9+
},
10+
fileURL: import.meta.url
11+
})
12+
13+
export default metadata
File renamed without changes.

site/app/[locale]/guide/syntax/tests/add-a-feature-query/generated.css renamed to site/app/[locale]/guide/at/tests/add-a-feature-query/generated.css

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
at: {
3+
supports: {
4+
backdrop: 'supports(backdrop-filter:blur(0px))' /* [!code highlight] */
5+
}
6+
}
7+
}

site/app/[locale]/guide/syntax/tests/add-a-feature-query/template.html renamed to site/app/[locale]/guide/at/tests/add-a-feature-query/template.html

File renamed without changes.

site/app/[locale]/guide/syntax/tests/add-a-media-query/generated.css renamed to site/app/[locale]/guide/at/tests/add-a-media-query/generated.css

File renamed without changes.

0 commit comments

Comments
 (0)