|
96 | 96 |
|
97 | 97 | // -- STATES |
98 | 98 | // ------------------------------------------------------------------------ |
99 | | - &:hover:not([disabled]) { |
| 99 | + &:hover:not(:disabled, .d-btn--disabled) { |
100 | 100 | --button-color-text: var(--dt-action-color-foreground-base-hover); |
101 | 101 | --button-color-background: var(--dt-action-color-background-base-hover); |
102 | 102 | } |
103 | 103 |
|
104 | | - &:active:not([disabled]), |
105 | | - &.d-btn--active:not([disabled]), |
106 | | - &.d-btn--active:active:not([disabled]) { |
| 104 | + &:active:not(:disabled, .d-btn--disabled), |
| 105 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 106 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
107 | 107 | --button-color-text: var(--dt-action-color-foreground-base-active); |
108 | 108 | --button-color-background: var(--dt-action-color-background-base-active); |
109 | 109 | } |
|
113 | 113 | box-shadow: var(--dt-shadow-focus); |
114 | 114 | } |
115 | 115 |
|
116 | | - &[disabled] { |
117 | | - --button-color-border: transparent !important; |
118 | | - --button-color-text: var( |
119 | | - --dt-action-color-foreground-disabled-default |
120 | | - ) !important; |
121 | | - --button-color-background: var( |
122 | | - --dt-action-color-background-disabled-default |
123 | | - ) !important; |
| 116 | + &--disabled, |
| 117 | + &:disabled { |
| 118 | + --chroma-adjust-text: .08; |
| 119 | + --chroma-adjust-background: .08; |
| 120 | + --chroma-adjust-border: .08; |
| 121 | + --opacity-adjust-text: 65%; |
| 122 | + --opacity-adjust-background: 65%; |
| 123 | + --opacity-adjust-border: 40%; |
124 | 124 |
|
| 125 | + color: color-mix(in oklch, oklch( from var(--button-color-text) l calc(c - var(--chroma-adjust-text)) h ) var(--opacity-adjust-text), transparent); |
| 126 | + 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); |
| 127 | + 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); |
125 | 128 | cursor: not-allowed; |
126 | 129 | transition: none; |
| 130 | + pointer-events: none; |
| 131 | + |
| 132 | + &.d-btn--primary { |
| 133 | + --opacity-adjust-text: 80%; |
| 134 | + } |
| 135 | + |
| 136 | + &.d-btn--muted { |
| 137 | + --opacity-adjust-text: 50%; |
| 138 | + --opacity-adjust-border: 50%; |
| 139 | + } |
127 | 140 | } |
128 | 141 | } |
129 | 142 |
|
|
246 | 259 | --button-color-text: var(--dt-action-color-foreground-muted-default); |
247 | 260 | --button-border-radius: var(--dt-size-radius-circle); |
248 | 261 |
|
249 | | - &:hover:not([disabled]) { |
| 262 | + &:hover:not(:disabled, .d-btn--disabled) { |
250 | 263 | --button-color-text: var(--dt-action-color-foreground-muted-hover); |
251 | 264 | --button-color-background: var(--dt-action-color-background-muted-hover); |
252 | 265 | } |
253 | 266 |
|
254 | | - &:active:not([disabled]), |
255 | | - &.d-btn--active:not([disabled]), |
256 | | - &.d-btn--active:active:not([disabled]) { |
| 267 | + &:active:not(:disabled, .d-btn--disabled), |
| 268 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 269 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
257 | 270 | --button-color-text: var(--dt-action-color-foreground-muted-active); |
258 | 271 | --button-color-background: var(--dt-action-color-background-muted-active); |
259 | 272 | } |
|
311 | 324 | --dt-action-color-background-base-primary-default |
312 | 325 | ); |
313 | 326 |
|
314 | | - &:hover:not([disabled]) { |
| 327 | + &:hover:not(:disabled, .d-btn--disabled) { |
315 | 328 | --button-color-text: var(--dt-action-color-foreground-base-primary-default); |
316 | 329 | --button-color-background: var( |
317 | 330 | --dt-action-color-background-base-primary-hover |
318 | 331 | ); |
319 | 332 | } |
320 | 333 |
|
321 | | - &:active:not([disabled]), |
322 | | - &.d-btn--active:not([disabled]), |
323 | | - &.d-btn--active:active:not([disabled]) { |
| 334 | + &:active:not(:disabled, .d-btn--disabled), |
| 335 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 336 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
324 | 337 | --button-color-text: var(--dt-action-color-foreground-base-primary-default); |
325 | 338 | --button-color-background: var( |
326 | 339 | --dt-action-color-background-base-primary-active |
|
333 | 346 | .d-btn--muted { |
334 | 347 | --button-color-text: var(--dt-action-color-foreground-muted-default); |
335 | 348 |
|
336 | | - &:hover:not([disabled]) { |
| 349 | + &:hover:not(:disabled, .d-btn--disabled) { |
337 | 350 | --button-color-text: var(--dt-action-color-foreground-muted-hover); |
338 | 351 | --button-color-background: var(--dt-action-color-background-muted-hover); |
339 | 352 | } |
340 | 353 |
|
341 | | - &:active:not([disabled]), |
342 | | - &.d-btn--active:not([disabled]), |
343 | | - &.d-btn--active:active:not([disabled]) { |
| 354 | + &:active:not(:disabled, .d-btn--disabled), |
| 355 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 356 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
344 | 357 | --button-color-text: var(--dt-action-color-foreground-muted-active); |
345 | 358 | --button-color-background: var(--dt-action-color-background-muted-active); |
346 | 359 | } |
|
356 | 369 | --button-color-text: var(--dt-action-color-foreground-critical-default); |
357 | 370 | --button-color-background: var(--dt-action-color-background-critical-default); |
358 | 371 |
|
359 | | - &:hover:not([disabled]) { |
| 372 | + &:hover:not(:disabled, .d-btn--disabled) { |
360 | 373 | --button-color-text: var(--dt-action-color-foreground-critical-hover); |
361 | 374 | --button-color-background: var(--dt-action-color-background-critical-hover); |
362 | 375 | } |
363 | 376 |
|
364 | | - &:active:not([disabled]), |
365 | | - &.d-btn--active:not([disabled]), |
366 | | - &.d-btn--active:active:not([disabled]) { |
| 377 | + &:active:not(:disabled, .d-btn--disabled), |
| 378 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 379 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
367 | 380 | --button-color-text: var(--dt-action-color-foreground-critical-active); |
368 | 381 | --button-color-background: var( |
369 | 382 | --dt-action-color-background-critical-active |
|
384 | 397 | --dt-action-color-background-critical-primary-default |
385 | 398 | ); |
386 | 399 |
|
387 | | - &:hover:not([disabled]) { |
| 400 | + &:hover:not(:disabled, .d-btn--disabled) { |
388 | 401 | --button-color-text: var( |
389 | 402 | --dt-action-color-foreground-critical-primary-default |
390 | 403 | ); |
|
393 | 406 | ); |
394 | 407 | } |
395 | 408 |
|
396 | | - &:active:not([disabled]), |
397 | | - &.d-btn--active:not([disabled]), |
398 | | - &.d-btn--active:active:not([disabled]) { |
| 409 | + &:active:not(:disabled, .d-btn--disabled), |
| 410 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 411 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
399 | 412 | --button-color-text: var( |
400 | 413 | --dt-action-color-foreground-critical-primary-default |
401 | 414 | ); |
|
412 | 425 | --button-color-text: var(--dt-action-color-foreground-positive-default); |
413 | 426 | --button-color-background: var(--dt-action-color-background-positive-default); |
414 | 427 |
|
415 | | - &:hover:not([disabled]) { |
| 428 | + &:hover:not(:disabled, .d-btn--disabled) { |
416 | 429 | --button-color-text: var(--dt-action-color-foreground-positive-hover); |
417 | 430 | --button-color-background: var(--dt-action-color-background-positive-hover); |
418 | 431 | } |
419 | 432 |
|
420 | | - &:active:not([disabled]), |
421 | | - &.d-btn--active:not([disabled]), |
422 | | - &.d-btn--active:active:not([disabled]) { |
| 433 | + &:active:not(:disabled, .d-btn--disabled), |
| 434 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 435 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
423 | 436 | --button-color-text: var(--dt-action-color-foreground-positive-active); |
424 | 437 | --button-color-background: var( |
425 | 438 | --dt-action-color-background-positive-active |
|
440 | 453 | --dt-action-color-background-positive-primary-default |
441 | 454 | ); |
442 | 455 |
|
443 | | - &:hover:not([disabled]) { |
| 456 | + &:hover:not(:disabled, .d-btn--disabled) { |
444 | 457 | --button-color-text: var( |
445 | 458 | --dt-action-color-foreground-positive-primary-default |
446 | 459 | ); |
|
449 | 462 | ); |
450 | 463 | } |
451 | 464 |
|
452 | | - &:active:not([disabled]), |
453 | | - &.d-btn--active:not([disabled]), |
454 | | - &.d-btn--active:active:not([disabled]) { |
| 465 | + &:active:not(:disabled, .d-btn--disabled), |
| 466 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 467 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
455 | 468 | --button-color-text: var( |
456 | 469 | --dt-action-color-foreground-positive-primary-default |
457 | 470 | ); |
|
469 | 482 | --button-color-text: var(--dt-action-color-foreground-inverted-default); |
470 | 483 | --button-color-background: var(--dt-action-color-background-inverted-default); |
471 | 484 |
|
472 | | - &:hover:not([disabled]) { |
| 485 | + &:hover:not(:disabled, .d-btn--disabled) { |
473 | 486 | --button-color-text: var(--dt-action-color-foreground-inverted-hover); |
474 | 487 | --button-color-background: var(--dt-action-color-background-inverted-hover); |
475 | 488 | } |
476 | 489 |
|
477 | | - &:active:not([disabled]), |
478 | | - &.d-btn--active:not([disabled]), |
479 | | - &.d-btn--active:active:not([disabled]) { |
| 490 | + &:active:not(:disabled, .d-btn--disabled), |
| 491 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 492 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
480 | 493 | --button-color-text: var(--dt-action-color-foreground-inverted-active); |
481 | 494 | --button-color-background: var( |
482 | 495 | --dt-action-color-background-inverted-active |
|
499 | 512 | --dt-action-color-background-inverted-primary-default |
500 | 513 | ); |
501 | 514 |
|
502 | | - &:hover:not([disabled]) { |
| 515 | + &:hover:not(:disabled, .d-btn--disabled) { |
503 | 516 | --button-color-text: var( |
504 | 517 | --dt-action-color-foreground-inverted-primary-hover |
505 | 518 | ); |
|
508 | 521 | ); |
509 | 522 | } |
510 | 523 |
|
511 | | - &:active:not([disabled]), |
512 | | - &.d-btn--active:not([disabled]), |
513 | | - &.d-btn--active:active:not([disabled]) { |
| 524 | + &:active:not(:disabled, .d-btn--disabled), |
| 525 | + &.d-btn--active:not(:disabled, .d-btn--disabled), |
| 526 | + &.d-btn--active:active:not(:disabled, .d-btn--disabled) { |
514 | 527 | --button-color-text: var( |
515 | 528 | --dt-action-color-foreground-inverted-primary-active |
516 | 529 | ); |
|
597 | 610 |
|
598 | 611 | // $$ DISABLED STATE |
599 | 612 | // ---------------------------------------------------------------------------- |
600 | | -.d-btn--disabled { |
601 | | - --button-color-text: var( |
602 | | - --dt-action-color-foreground-disabled-default |
603 | | - ) !important; |
604 | | - --button-color-background: var( |
605 | | - --dt-action-color-background-disabled-default |
606 | | - ) !important; |
607 | | - --button-color-border: transparent !important; |
608 | | - |
609 | | - cursor: not-allowed; |
610 | | - transition: none; |
611 | | - pointer-events: none; |
612 | | -} |
613 | 613 |
|
614 | 614 | // $$ BRAND BUTTONS |
615 | 615 | // ---------------------------------------------------------------------------- |
|
621 | 621 |
|
622 | 622 | display: flex; |
623 | 623 |
|
624 | | - &:hover:not([disabled]), |
625 | | - &:active:not([disabled]) { |
| 624 | + &:hover:not(:disabled, .d-btn--disabled), |
| 625 | + &:active:not(:disabled, .d-btn--disabled) { |
626 | 626 | --button-color-text: hsl(var(--dt-color-neutral-white-hsl) ~" / " 90%); |
627 | 627 | --button-color-background: hsl( |
628 | 628 | var(--brand-color-h) calc(var(--brand-color-s) + 2.5%) |
|
639 | 639 | ); |
640 | 640 | } |
641 | 641 |
|
642 | | - &:active:not([disabled]) { |
| 642 | + &:active:not(:disabled, .d-btn--disabled) { |
643 | 643 | --button-color-background: hsl( |
644 | 644 | var(--brand-color-h) calc(var(--brand-color-s) + 5%) |
645 | 645 | calc(var(--brand-color-l) - 10%) |
|
0 commit comments