Skip to content

Commit

Permalink
Update imports and components for syntax and utilities overview
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jan 20, 2025
1 parent 20b5a36 commit 143ba9f
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function getPseudoClassCompletionItems(css: MasterCSS = new Maste
sortText,
documentation: getCSSDataDocumentation(data, {
generatedCSS: generateCSS([syntax + name.slice(1)], css),
docs: '/reference/syntax#selectors'
docs: '/guide/syntax#selectors'
}),
kind,
data
Expand All @@ -51,7 +51,7 @@ export default function getPseudoClassCompletionItems(css: MasterCSS = new Maste
label: name,
documentation: getCSSDataDocumentation(data, {
generatedCSS: generateCSS([syntax + name.slice(1)], css),
docs: '/reference/syntax#selectors'
docs: '/guide/syntax#selectors'
}),
sortText,
kind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function getPseudoElementCompletionItems(css: MasterCSS = new Mas
sortText,
documentation: getCSSDataDocumentation(data, {
generatedCSS: generateCSS([syntax + name.slice(2)], css),
docs: '/reference/syntax#selectors'
docs: '/guide/syntax#selectors'
}),
kind,
data
Expand All @@ -46,7 +46,7 @@ export default function getPseudoElementCompletionItems(css: MasterCSS = new Mas
label: name,
documentation: getCSSDataDocumentation(data, {
generatedCSS: generateCSS([syntax + name.slice(2)], css),
docs: '/reference/syntax#selectors'
docs: '/guide/syntax#selectors'
}),
sortText,
kind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function getQueryCompletionItems(css: MasterCSS = new MasterCSS()
sortText: 'media()',
documentation: getCSSDataDocumentation(atDataList.find(({ name }) => name === '@media'), {
generatedCSS: generateCSS([syntax + 'media()'], css),
docs: '/reference/syntax#at-rules'
docs: '/guide/syntax#at-rules'
}),
},
{
Expand All @@ -26,7 +26,7 @@ export default function getQueryCompletionItems(css: MasterCSS = new MasterCSS()
sortText: 'supports()',
documentation: getCSSDataDocumentation(atDataList.find(({ name }) => name === '@supports'), {
generatedCSS: generateCSS([syntax + 'supports()'], css),
docs: '/reference/syntax#at-rules'
docs: '/guide/syntax#at-rules'
}),
}
)
Expand All @@ -38,7 +38,7 @@ export default function getQueryCompletionItems(css: MasterCSS = new MasterCSS()
insertText: name,
documentation: getCSSDataDocumentation(undefined, {
generatedCSS: generateCSS([syntax + name], css),
docs: '/reference/syntax#at-rules'
docs: '/guide/syntax#at-rules'
})
}
if ([AT_SIGN, ...QUERY_LOGICAL_OPERATORS].includes(triggerCharacter)) {
Expand All @@ -51,7 +51,7 @@ export default function getQueryCompletionItems(css: MasterCSS = new MasterCSS()
insertText: name,
documentation: getCSSDataDocumentation(undefined, {
generatedCSS: generateCSS([syntax + name], css),
docs: '/reference/syntax#at-rules'
docs: '/guide/syntax#at-rules'
}),
detail: `screen width ${'>='} ${value}px`,
kind: CompletionItemKind.Keyword
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function getQueryCompletionItems(css: MasterCSS = new MasterCSS()
insertText: name,
documentation: getCSSDataDocumentation(undefined, {
generatedCSS: generateCSS([syntax + name], css),
docs: '/reference/syntax#at-rules'
docs: '/guide/syntax#at-rules'
}),
detail: `screen width ${comparisonCharacter} ${value}px`,
kind: CompletionItemKind.Keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function querySyntaxCompletions(q = '', css: MasterCSS = new Mast
insertText: '.',
documentation: getCSSDataDocumentation(undefined, {
generatedCSS: generateCSS([field + '.class'], css),
docs: '/reference/syntax#selectors'
docs: '/guide/syntax#selectors'
}),
kind: CompletionItemKind.Class
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe.concurrent('pseudo-class', () => {
(Edge 12, Firefox 3, Safari 3, Chrome 4, IE 7, Opera 9)
[Master CSS](https://rc.css.master.co/reference/syntax#selectors) | [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/:first-child)
[Master CSS](https://rc.css.master.co/guide/syntax#selectors) | [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/:first-child)
`,
},
'insertText': 'first',
Expand Down Expand Up @@ -92,7 +92,7 @@ describe.concurrent('pseudo-element', () => {
(Edge 79, Firefox 51, Safari 10, Chrome 57, Opera 44)
[Master CSS](https://rc.css.master.co/reference/syntax#selectors) | [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/::placeholder)
[Master CSS](https://rc.css.master.co/guide/syntax#selectors) | [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/::placeholder)
`,
},
'insertText': 'placeholder',
Expand Down
22 changes: 11 additions & 11 deletions site/app/[locale]/guide/configuration/content.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import SyntaxesOverview from '~/site/app/[locale]/guide/rules/components/SyntaxesOverview.mdx'
import RulesOverview from '~/site/app/[locale]/guide/syntax/components/RulesOverview.mdx'
import VariablesOverview from '~/site/app/[locale]/guide/variables/components/Overview.mdx'
import UtilitiesOverview from '~/site/app/[locale]/guide/utilities/components/Overview.mdx'
import UtilitiesOverview from '~/site/app/[locale]/guide/syntax/components/UtilitiesOverview.mdx'
import AnimationsOverview from '~/site/app/[locale]/guide/animations/components/Overview.mdx'
import AtOverview from '~/site/app/[locale]/guide/rules/components/AtOverview.mdx'
import SelectorsOverview from '~/site/app/[locale]/guide/rules/components/SelectorsOverview.mdx'
import FunctionsOverview from '~/site/app/[locale]/guide/rules/components/FunctionsOverview.mdx'
import AtOverview from '~/site/app/[locale]/guide/syntax/components/AtOverview.mdx'
import SelectorsOverview from '~/site/app/[locale]/guide/syntax/components/SelectorsOverview.mdx'
import FunctionsOverview from '~/site/app/[locale]/guide/syntax/components/FunctionsOverview.mdx'
import ComponentsOverview from '~/site/app/[locale]/guide/components/components/Overview.mdx'
import { config } from '@master/css'

Expand All @@ -22,23 +22,23 @@ Customizing animation [animations](/guide/custom-animations) for your design sys
<AnimationsOverview />

### `.functions`
Customizing [functions](/reference/syntax#functions) for your design system.
Customizing [functions](/guide/syntax#functions) for your design system.
<FunctionsOverview />

### `.at`
Customizing [at-rules](/reference/syntax#at-rules) for your design system.
Customizing [at-rules](/guide/syntax#at-rules) for your design system.
<AtOverview />

### `.rules`
Customizing [rules](/reference/syntax#rules) for your design system.
<SyntaxesOverview />
Customizing [rules](/guide/syntax#rules) for your design system.
<RulesOverview />

### `.selectors`
Customizing [selectors](/reference/syntax#selectors) for your design system.
Customizing [selectors](/guide/syntax#selectors) for your design system.
<SelectorsOverview />

### `.utilities`
Customizing [utility](/reference/utilities) classes for your design system.
Customizing [utility](/guide/syntax#utilities) classes for your design system.
<UtilitiesOverview />

### `.components`
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/markup-driven/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ It can be elegant:
<!-- Use a utility class that translates to "display: block" -->
<div class="block">
```
It can be [stateful and selectable](/reference/syntax#selectors):
It can be [stateful and selectable](/guide/syntax#selectors):
```html
<!-- Set a pink background on hover -->
<div class="bg:pink:hover">
Expand Down
4 changes: 2 additions & 2 deletions site/app/[locale]/guide/migration/tailwindcss/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Add media queries after the main body.
- <div class="landscape:hidden"></div>
<div class="hidden@landscape"></div>
```
Not just media queries but feature queries and [more](/reference/syntax).
Not just media queries but feature queries and [more](/guide/syntax).

---

Expand Down Expand Up @@ -163,7 +163,7 @@ export default {
```

### Add media queries
Using [at-rules](/reference/syntax#at-rules) to define media queries, feature queries, and even container queries.
Using [at-rules](/guide/syntax#at-rules) to define media queries, feature queries, and even container queries.
```js name=master.css.js
-/** @type {import('tailwindcss').Config} */
-module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/migration/v1/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Deprecate extended `breakpoints` and `queries` ​​in favor of `config.at`.
+ }
+}
```
To learn more, check out the [at-rules](/reference/syntax#at-rules) documentation.
To learn more, check out the [at-rules](/guide/syntax#at-rules) documentation.

### Unknown tokens as themes
Deprecated `colorSchemes` and considered unknown media query tokens as themes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Do you frequently check the reference table for `rem` to `px` when writing CSS?

The `48` without specified units is translated to pixels and is converted to a browser-friendly `2rem` when generating CSS rules.

We've predefined [practical units and conversion behavior](/reference/syntax#default-reference) based on the characteristics of different style properties, and most of them involve converting from `px` to `rem`.
We've predefined [practical units and conversion behavior](/guide/syntax#default-reference) based on the characteristics of different style properties, and most of them involve converting from `px` to `rem`.

You can easily associate the default behavior with the property's characteristics.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Writing the native CSS directly makes your markup verbose.
{code2}
</Code>

When the characteristics of a native CSS property can be accurately conveyed through its value alone, we [utilize the value directly as a utility class](/reference/utilities#default-reference). For example, we reduce `mcss display:block` to simply `mcss block`.
When the characteristics of a native CSS property can be accurately conveyed through its value alone, we [utilize the value directly as a utility class](/guide/syntax#utilities#default-reference). For example, we reduce `mcss display:block` to simply `mcss block`.

However, we do not reduce `mcss font-weight:lighter` to `mcss lighter` can be too ambiguous, potentially referring to brightness rather than `font-weight`.

In addition, several useful utility classes are provided, such as [screen readers](/reference/screen-readers) and [text size](/reference/text-size) with line height, etc.

Utilities effectively reduce markup complexity, improve readability, and maintain the intended meaning of the property.

To learn more about customizing utilities, check out the [utilities](/reference/utilities) documentation.
To learn more about customizing utilities, check out the [utilities](/guide/syntax#utilities) documentation.
14 changes: 14 additions & 0 deletions site/app/[locale]/guide/syntax/components/UtilitiesOverview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```js name=master.css.js
export default {
utilities: {
round: {
'border-radius': '50%',
'aspect-ratio': '1/1'
}
}
}
```
Apply your custom utilities:
```html
<div class="**round**">o</div>
```
16 changes: 14 additions & 2 deletions site/app/[locale]/guide/syntax/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

## Rules
Customize your own Master CSS syntax rules.
<SyntaxesOverview />
<RulesOverview />
<details>
<summary>View the default rules</summary>
<div>
<SyntaxesDefault />
<RulesDefault />
</div>
</details>

Expand Down Expand Up @@ -75,6 +75,18 @@ Applies translucent background only when `backdrop-filter` is supported.

---

## Utilities
Customize utility classes using native CSS declarations.
<UtilitiesOverview />
<details>
<summary>View the default utilities</summary>
<div>
<UtilitiesDefault />
</div>
</details>

---

## Future

- [Container Queries #334](https://github.com/master-co/css/issues/334)
2 changes: 0 additions & 2 deletions site/app/[locale]/guide/syntax/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const metadata = define({
title: 'Syntax',
description: 'A guide to customizing declarations, selectors, functions, and at-rules in syntax.',
category: 'Customization',
order: 3,
unfinished: true,
fileURL: import.meta.url
})

Expand Down
13 changes: 0 additions & 13 deletions site/app/[locale]/guide/utilities/_opengraph-image.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions site/app/[locale]/guide/utilities/components/Overview.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions site/app/[locale]/guide/utilities/content.mdx

This file was deleted.

11 changes: 0 additions & 11 deletions site/app/[locale]/guide/utilities/metadata.ts

This file was deleted.

22 changes: 0 additions & 22 deletions site/app/[locale]/guide/utilities/page.tsx

This file was deleted.

0 comments on commit 143ba9f

Please sign in to comment.