Skip to content

Commit

Permalink
docs(design): Adding values for the border (#2114)
Browse files Browse the repository at this point in the history
* adding values for the border

* some clean based on suggestions

* trigger cloudflare

---------

Co-authored-by: Aiden-Brine <aidenbrine@gmail.com>
  • Loading branch information
miqdadamirali and Aiden-Brine authored Nov 13, 2024
1 parent 019b165 commit 05c6063
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions docs/design/Borders.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,33 @@ Border style should be `solid` unless a specific use case calls for some other
format, such as indicating a dropzone on the
[`InputFile` component](../?path=/docs/components-forms-and-inputs-inputfile--docs).

export function Example({ of: size }) {
const style = {
export function BaseStyle({ of: size }) {
return {
width: "100%",
height: "var(--space-minuscule)",
borderBottomStyle: "solid",
borderBottomWidth: `var(--border-${size})`,
borderBottomColor: "var(--color-grey--lighter)",
};
return <div style={style} />;
}

| Width | Visual |
| :------------------ | :------------------------ |
| `--border-base` | <Example of="base" /> |
| `--border-thick` | <Example of="thick" /> |
| `--border-thicker` | <Example of="thicker" /> |
| `--border-thickest` | <Example of="thickest" /> |
export function Example({ of: size }) {
return <div style={BaseStyle({ of: size })} />;
}

export function BorderSize({ of: size }) {
const element = document.createElement("div");
Object.assign(element.style, BaseStyle({ of: size }));
document.body.appendChild(element);
return getComputedStyle(element).borderBottomWidth;
}

| Width | Visual | Value |
| :------------------ | :------------------------ | :--------------------------- |
| `--border-base` | <Example of="base" /> | <BorderSize of="base" /> |
| `--border-thick` | <Example of="thick" /> | <BorderSize of="thick" /> |
| `--border-thicker` | <Example of="thicker" /> | <BorderSize of="thicker" /> |
| `--border-thickest` | <Example of="thickest" /> | <BorderSize of="thickest" /> |

The `base` border width should be used for most use cases (see
[`Card`](../?path=/docs/components-layouts-and-structure-card--docs) and
Expand Down

0 comments on commit 05c6063

Please sign in to comment.