-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade astro-related dependencies * chore: upgrade dependencies * chore: lock * fix: prettier issue * chore(examples): bump vue-tsc
- Loading branch information
Showing
38 changed files
with
2,169 additions
and
2,171 deletions.
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
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
6 changes: 4 additions & 2 deletions
6
docs/beta/src/content/config.ts → docs/beta/src/content.config.ts
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
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
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
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
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
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,64 @@ | ||
--- | ||
title: FAQs | ||
--- | ||
|
||
:::caution | ||
**You are currently viewing the docs for `cva@beta`** | ||
For stable documentation, please visit [cva.style](https://cva.style). | ||
::: | ||
|
||
## Why Don't You Provide a `styled` API? | ||
|
||
Long story short: it's unnecessary. | ||
|
||
`cva` encourages you to think of components as traditional CSS classes: | ||
|
||
- Less JavaScript is better | ||
- They're framework agnostic; truly reusable | ||
- Polymorphism is free; just apply the class to your preferred HTML element | ||
- Less opinionated; you're free to build components with `cva` however you'd like | ||
|
||
See the ["Polymorphism"](/docs/getting-started/polymorphism) documentation for further recommendations. | ||
|
||
## How Can I Create [Responsive Variants like Stitches.js](https://stitches.dev/docs/responsive-styles#responsive-variants)? | ||
|
||
You can't. | ||
|
||
`cva` doesn't know about how you choose to apply CSS classes, and it doesn't want to. | ||
|
||
We recommend either: | ||
|
||
- Showing/hiding elements with different variants, based on your preferred breakpoint. | ||
|
||
<details> | ||
|
||
<summary>Example: With Tailwind</summary> | ||
|
||
```tsx | ||
export const Example = () => ( | ||
<> | ||
<div className="hidden sm:inline-flex"> | ||
<button className={button({ intent: "primary" })}>Hidden until sm</button> | ||
</div> | ||
<div className="inline-flex sm:hidden"> | ||
<button className={button({ intent: "secondary" })}> | ||
Hidden after sm | ||
</button> | ||
</div> | ||
</> | ||
); | ||
``` | ||
|
||
</details> | ||
|
||
- Create a bespoke variant that changes based on the breakpoint. | ||
|
||
_e.g. `button({ intent: "primaryUntilMd" })`_ | ||
|
||
:::info | ||
This is something I've been thinking about since the project's inception, and I've gone back and forth many times on the idea of building it. It's a large undertaking and brings all the complexity of supporting many different build tools and frameworks. | ||
|
||
In my experience, "responsive variants" are typically rare, and hiding/showing different elements is usually good enough to get by. | ||
|
||
To be frank, I'm probably not going to build/maintain a solution unless someone periodically gives me a thick wad of cash to do so, and even then I'd probably rather spend my free time living my life. | ||
::: |
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
Oops, something went wrong.