Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/bright-method-colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@microsoft/atlas-css': patch
---

Add API link button colors for PUT and PATCH methods.
10 changes: 10 additions & 0 deletions css/src/components/api-link-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

$color-primary: tokens.$primary;
$color-success: tokens.$success;
$color-warning: tokens.$warning-dark;
$color-info: tokens.$info-active;
$color-danger: tokens.$danger;

.api-link-button-container {
Expand Down Expand Up @@ -51,6 +53,14 @@ $color-danger: tokens.$danger;
color: #{$color-success};
}

&[data-method='put'] {
color: #{$color-warning};
}

&[data-method='patch'] {
color: #{$color-info};
}

&[data-method='delete'] {
color: #{$color-danger};
}
Expand Down
27 changes: 26 additions & 1 deletion site/src/components/api-link-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,29 @@ The narrow layout reduces the vertical gap between the method and path to keep t

## Method colors

Set `data-method` on `.api-link-button-method` to apply the semantic color for `get`, `post`, or `delete`. Other methods inherit the surrounding text color.
Set `data-method` on `.api-link-button-method` to apply the method color for `get`, `post`, `put`, `patch`, or `delete`. Other methods inherit the surrounding text color.

```html
<div class="api-link-button-container">
<a class="api-link-button" href="#method-colors" aria-label="Get a response">
<span class="api-link-button-method" data-method="get">get</span>
<span class="api-link-button-text">/openai/v1/responses/{response_id}</span>
</a>
<a class="api-link-button" href="#method-colors" aria-label="Create a response">
<span class="api-link-button-method" data-method="post">post</span>
<span class="api-link-button-text">/openai/v1/responses</span>
</a>
<a class="api-link-button" href="#method-colors" aria-label="Replace a response">
<span class="api-link-button-method" data-method="put">put</span>
<span class="api-link-button-text">/openai/v1/responses/{response_id}</span>
</a>
<a class="api-link-button" href="#method-colors" aria-label="Update a response">
<span class="api-link-button-method" data-method="patch">patch</span>
<span class="api-link-button-text">/openai/v1/responses/{response_id}</span>
</a>
<a class="api-link-button" href="#method-colors" aria-label="Delete a response">
<span class="api-link-button-method" data-method="delete">delete</span>
<span class="api-link-button-text">/openai/v1/responses/{response_id}</span>
</a>
</div>
```
Loading