Skip to content

feat(button): DLT-3269 improve disabled styles#1180

Open
Francis Rupert (francisrupert) wants to merge 1 commit intostagingfrom
staging-disabled-button-style
Open

feat(button): DLT-3269 improve disabled styles#1180
Francis Rupert (francisrupert) wants to merge 1 commit intostagingfrom
staging-disabled-button-style

Conversation

@francisrupert
Copy link
Copy Markdown
Contributor

@francisrupert Francis Rupert (francisrupert) commented Apr 7, 2026

Screen.Recording.2026-04-07.at.12.59.07.PM.mov

🛠️ Type Of Change

  • Feature

📖 Jira Ticket

DLT-3269

📖 Description

Replace flat disabled button styling with context-aware desaturation using color-mix(in oklch). Disabled buttons now retain a muted version of their variant colors instead of all looking identical.

Selectively ported from the next branch visual refresh work — only the disabled styling changes, no token migrations, no new slots, no mixin restructure.

What changed

  • Disabled block uses color-mix(in oklch, oklch(from ...) ...) to desaturate variant colors with adjustable chroma and opacity
  • Variant-specific opacity overrides for primary and muted
  • Hover/active selectors updated from :not([disabled]) to :not(:disabled, .d-btn--disabled) across all variants
  • Removed custom disabled overrides from pagination (now inherits from button)
  • Updated chip and leftbar_row selectors for consistency
  • Added kind/importance disabled grid to button docs page

What did NOT change

  • Design tokens (still hex/HSL)
  • Vue component API or behavior
  • Button sizing, spacing, or typography
  • No new CSS classes or props introduced

💡 Context

On staging, all disabled buttons render identically regardless of variant — a single flat disabled color applied via !important. This makes it harder to identify what action is being disabled. The new approach desaturates each variant's own colors, preserving intent while clearly communicating the disabled state.

📝 Checklist

For all PRs:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

For all CSS changes:

  • I have used design tokens whenever possible.
  • I have considered how this change will behave on different screen sizes.
  • I have visually validated my change in light and dark mode.
  • I have used gap or flexbox properties for layout instead of margin whenever possible.

📷 Screenshots / GIFs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

✔️ Deploy previews ready!
😎 Dialtone documentation preview: https://dialtone.dialpad.com/deploy-previews/pr-1180/
😎 Dialtone-vue preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-1180/

@francisrupert Francis Rupert (francisrupert) added the visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests label Apr 7, 2026
@francisrupert Francis Rupert (francisrupert) marked this pull request as ready for review April 7, 2026 18:15
@francisrupert Francis Rupert (francisrupert) added no-visual-test Add this tag when the PR does not need visual testing and removed visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests labels Apr 7, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c5cf96049

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

@braddialpad
Copy link
Copy Markdown
Contributor

Adding visual tests since I think it probably IS important to visually test this.

@braddialpad Brad Paugh (braddialpad) added visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests and removed no-visual-test Add this tag when the PR does not need visual testing labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Please add either the visual-test-ready or no-visual-test label to this PR depending on whether you want to run visual tests or not.
It is recommended to run visual tests if your PR changes any UI. ‼️

border-color: color-mix(in oklch, oklch( from var(--button-color-border) l calc(c - var(--chroma-adjust-border)) h ) var(--opacity-adjust-border), transparent);
cursor: not-allowed;
transition: none;
pointer-events: none;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm this is a breaking change isn't it? adding pointer-events: none when it wasn't there before.

Comment on lines 611 to 612
// $$ DISABLED STATE
// ----------------------------------------------------------------------------
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess we can remove this whole comment

Comment on lines +125 to +127
color: color-mix(in oklch, oklch( from var(--button-color-text) l calc(c - var(--chroma-adjust-text)) h ) var(--opacity-adjust-text), transparent);
background-color: color-mix(in oklch, oklch( from var(--button-color-background) l calc(c - var(--chroma-adjust-background)) h ) var(--opacity-adjust-background), transparent);
border-color: color-mix(in oklch, oklch( from var(--button-color-border) l calc(c - var(--chroma-adjust-border)) h ) var(--opacity-adjust-border), transparent);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browser compatibility concerns with this unfortunately... I'm going to have to check on this before we merge. There was some bug not long ago with users in India still using Windows 7 with Chrome 108 😠.

Worst case I think we can transpile it but we might have to make a product side change.

All button styles and variations appear the same when disabled.
Buttons can be disabled using the `disabled` attribute or the Dialtone class, `d-btn--disabled`. Use the attribute when a button should appear disabled and not receive focus; use the class when a button should appear disabled but still receive focus (i.e. a disabled button with a tooltip).

When using the raw HTML intead of the Vue component , it requires `aria-disabled`, and additional javascript implementation is required to prevent events.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor typo here, "intead" -> "instead"


<script setup>
import { ref } from 'vue';
const isDisabled = ref(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: put declaration after import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants