-
Notifications
You must be signed in to change notification settings - Fork 1
feat(web): show busy state on Quick Demo + Refresh buttons during async actions #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -268,18 +268,39 @@ body::after { | |||||||||||||||||||||||||||
| content: none; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /* Color-adaptive spinner: inherits the button's text color via currentColor | ||||||||||||||||||||||||||||
| * so it looks right inside both .btn-primary (dark on lime) and .btn-ghost | ||||||||||||||||||||||||||||
| * (light on dark). Three quarters of the ring is currentColor; the fourth | ||||||||||||||||||||||||||||
| * is transparent — the rotation reads as a spinning gap. */ | ||||||||||||||||||||||||||||
| .btn-spinner { | ||||||||||||||||||||||||||||
| display: inline-block; | ||||||||||||||||||||||||||||
| width: 0.85rem; | ||||||||||||||||||||||||||||
| height: 0.85rem; | ||||||||||||||||||||||||||||
| border-radius: 50%; | ||||||||||||||||||||||||||||
| border: 2px solid rgba(12, 13, 12, 0.25); | ||||||||||||||||||||||||||||
| border-top-color: var(--ink-bg); | ||||||||||||||||||||||||||||
| border: 2px solid currentColor; | ||||||||||||||||||||||||||||
| border-top-color: transparent; | ||||||||||||||||||||||||||||
| opacity: 0.9; | ||||||||||||||||||||||||||||
| animation: btn-spin 0.7s linear infinite; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| @keyframes btn-spin { | ||||||||||||||||||||||||||||
| to { transform: rotate(360deg); } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| /* The busy state injects a `<span class="btn-spinner">` next to the label | ||||||||||||||||||||||||||||
| * span. .btn-ghost was previously `display: inline-block` which leaves both | ||||||||||||||||||||||||||||
| * spans flush against each other and visibly collides the spinner with the | ||||||||||||||||||||||||||||
| * leading "L" of "LOADING DEMO". Match the .btn-primary inline-flex + gap | ||||||||||||||||||||||||||||
| * shape so the spinner gets proper breathing room from the text. */ | ||||||||||||||||||||||||||||
| .btn-ghost { | ||||||||||||||||||||||||||||
| display: inline-flex; | ||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||
| justify-content: center; | ||||||||||||||||||||||||||||
| gap: 0.5rem; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| .btn-ghost:disabled, | ||||||||||||||||||||||||||||
| .btn-ghost.is-busy { | ||||||||||||||||||||||||||||
| opacity: 0.7; | ||||||||||||||||||||||||||||
| cursor: progress; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+299
to
+303
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The fix requires two things: move the block after Proposed fix-.btn-ghost:disabled,
-.btn-ghost.is-busy {
- opacity: 0.7;
- cursor: progress;
-}
.btn-ghost {
font-family: var(--mono);
...
}
.btn-ghost:hover {
color: var(--paper);
border-color: var(--paper-soft);
background: var(--ink-2);
}
+/* Must follow :hover so these values win in the cascade */
+.btn-ghost:disabled,
+.btn-ghost.is-busy {
+ opacity: 0.7;
+ cursor: progress;
+ color: var(--paper-soft);
+ border-color: var(--rule);
+ background: transparent;
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| .btn-primary::after { | ||||||||||||||||||||||||||||
| content: "→"; | ||||||||||||||||||||||||||||
| font-family: var(--serif); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
currentColorcasing to satisfy Stylelintvalue-keyword-caseCSS is case-insensitive with respect to
currentColor, so browsers render it correctly regardless of casing, but the project's Stylelint config (value-keyword-case) requires the all-lowercase form and will error here.Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 Stylelint (17.9.0)
[error] 280-280: Expected "currentColor" to be "currentcolor" (value-keyword-case)
(value-keyword-case)
🤖 Prompt for AI Agents