Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add all the colors to dev toolbar components #7191

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/content/docs/en/reference/dev-toolbar-app-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ The size of the button (`small`, `medium`, `large`).

#### `button-style`

The style of the button (`ghost`, `outline`, `purple`, `gray`, `red`). When using `ghost`, the button itself is invisible and only the content of the button will be shown.
The style of the button (`ghost`, `outline`, `purple`, `gray`, `red`, `green`, `yellow`, `blue`). When using `ghost`, the button itself is invisible and only the content of the button will be shown.

In JavaScript, set this property using the `buttonStyle` property to avoid conflict with the native `style` property.

Expand All @@ -307,7 +307,7 @@ The size of the badge (`small`, `large`).

#### `badge-style`

The style (color) of the badge (`purple`, `gray`, `red`, `green`, `yellow`).
The style (color) of the badge (`purple`, `gray`, `red`, `green`, `yellow`, `blue`).

In JavaScript, set this property using the `badgeStyle` property to avoid conflict with the native `style` property.

Expand All @@ -324,6 +324,12 @@ The slot of the component will be used as the content of the card.
<astro-dev-toolbar-card icon="astro:logo" link="https://github.com/withastro/astro/issues/new/choose">Report an issue</astro-dev-toolbar-card>
```

#### `card-style`

The style of the card (`purple`, `gray`, `red`, `green`, `yellow`, `blue`). The color is only applied to the border of the card on hover.

In JavaScript, set this property using the `cardStyle`.

### `astro-dev-toolbar-toggle`

Shows a toggle element, acting as a checkbox. This element internally is a simple wrapper around a native `<input type="checkbox">` element. The checkbox element can be accessed using the `input` property.
Expand All @@ -336,9 +342,15 @@ toggle.input.addEventListener('change', (evt) => {
});
```

#### `toggle-style`

The style of the toggle (`purple`, `gray`, `red`, `green`, `yellow`, `blue`).

In JavaScript, set this property using the `toggleStyle` property.

### `astro-dev-toolbar-highlight`

Can be used to highlight an element on the page. In most cases, you'll want to position and resize this element using the `top`, `left`, `width` and `height` CSS properties to match the element you want to highlight. An [icon](#icons) can also be specified using the `icon` attribute and will be shown in the top right corner of the highlight.
Can be used to highlight an element on the page. In most cases, you'll want to position and resize this element using the `top`, `left`, `width` and `height` CSS properties to match the element you want to highlight.

```html
<!-- Highlight the entire page -->
Expand All @@ -358,6 +370,14 @@ highlight.style.height = `${rect.height + 15}px`;
highlight.icon = 'astro:logo';
```

#### `style`

The style of the highlight (`purple`, `gray`, `red`, `green`, `yellow`, `blue`).

#### `icon`

An [icon](#icons) to show in the top right corner of the highlight.

### `astro-dev-toolbar-tooltip`

Shows a tooltip with different sections. This component is set to `display: none;` by default and can be made visible using a `data-show="true"` attribute.
Expand Down
Loading