|
| 1 | +@use '../../../styling/utils'; |
| 2 | + |
| 3 | +.str-chat { |
| 4 | + .str-chat__button { |
| 5 | + @include utils.button-reset; |
| 6 | + position: relative; /* creates positioning context for pseudo ::after overlay */ |
| 7 | + overflow: hidden; |
| 8 | + |
| 9 | + cursor: pointer; |
| 10 | + |
| 11 | + display: flex; |
| 12 | + align-items: center; |
| 13 | + justify-content: center; |
| 14 | + gap: var(--spacing-xs); |
| 15 | + //padding-inline: var(--spacing-md); |
| 16 | + //padding-block: var(--spacing-sm); |
| 17 | + /* |
| 18 | + min-width / min-height on buttons: |
| 19 | + - enforce a minimum tappable area |
| 20 | + - follow accessibility & platform guidelines |
| 21 | + - don’t affect layout unless the button would be too small |
| 22 | + - are about usability, not design polish |
| 23 | + */ |
| 24 | + min-height: var(--button-visual-height-lg); |
| 25 | + max-height: var(--button-visual-height-lg); |
| 26 | + |
| 27 | + line-height: var(--typography-line-height-normal); |
| 28 | + border-radius: var(--button-radius-lg); |
| 29 | + |
| 30 | + font-weight: var(--font-weight-w600); |
| 31 | + |
| 32 | + &.str-chat__button--solid { |
| 33 | + &.str-chat__button--primary { |
| 34 | + background-color: var(--button-type-primary-bg); |
| 35 | + color: var(--button-type-primary-text); |
| 36 | + border-color: var(--button-type-primary-border); |
| 37 | + } |
| 38 | + |
| 39 | + &.str-chat__button--secondary { |
| 40 | + background-color: var(--button-type-secondary-bg); |
| 41 | + color: var(--button-type-secondary-text); |
| 42 | + border-color: var(--button-type-secondary-border); |
| 43 | + } |
| 44 | + |
| 45 | + &.str-chat__button--destructive { |
| 46 | + background-color: var(--button-type-destructive-bg); |
| 47 | + color: var(--button-type-destructive-text); |
| 48 | + border-color: var(--button-type-destructive-border); |
| 49 | + } |
| 50 | + |
| 51 | + &:disabled { |
| 52 | + background-color: var(--state-bg-disabled); |
| 53 | + } |
| 54 | + } |
| 55 | + |
| 56 | + &.str-chat__button--ghost { |
| 57 | + border-color: var(--button-style-ghost-border); |
| 58 | + background-color: var(--button-style-ghost-bg); |
| 59 | + |
| 60 | + &.str-chat__button--primary { |
| 61 | + color: var(--button-style-ghost-text-primary); |
| 62 | + } |
| 63 | + |
| 64 | + &.str-chat__button--secondary { |
| 65 | + color: var(--button-style-ghost-text-secondary); |
| 66 | + } |
| 67 | + |
| 68 | + &.str-chat__button--destructive { |
| 69 | + color: var(--button-type-destructive-text-inverse); |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + &.str-chat__button--outline { |
| 74 | + // todo: designs not available |
| 75 | + //&.str-chat__button--primary { |
| 76 | + // background-color: var(--button-type-primary-bg); |
| 77 | + // color: var(--button-type-primary-text); |
| 78 | + // border-color: var(--button-type-primary-border); |
| 79 | + //} |
| 80 | + |
| 81 | + &.str-chat__button--secondary { |
| 82 | + background-color: var(--button-style-outline-bg); |
| 83 | + color: var(--button-style-outline-text); |
| 84 | + border-color: var(--button-style-outline-border); |
| 85 | + } |
| 86 | + |
| 87 | + // todo: designs not available |
| 88 | + &.str-chat__button--destructive { |
| 89 | + //background-color: var(--button-type-destructive-bg); |
| 90 | + color: var(--button-type-destructive-text-inverse); |
| 91 | + //border-color: var(--button-type-destructive-border); |
| 92 | + } |
| 93 | + } |
| 94 | + |
| 95 | + &.str-chat__button--solid, |
| 96 | + &.str-chat__button--ghost { |
| 97 | + &:disabled { |
| 98 | + border: none; |
| 99 | + } |
| 100 | + } |
| 101 | + |
| 102 | + &.str-chat__button--solid, |
| 103 | + &.str-chat__button--outline, |
| 104 | + &.str-chat__button--ghost { |
| 105 | + border-width: 1px; |
| 106 | + border-style: solid; |
| 107 | + |
| 108 | + |
| 109 | + &:not(:disabled):hover { |
| 110 | + @include utils.overlay-after(0.05); |
| 111 | + } |
| 112 | + |
| 113 | + &:not(:disabled):active { // pressed |
| 114 | + @include utils.overlay-after(0.10); |
| 115 | + } |
| 116 | + |
| 117 | + &:not(:disabled):focus-visible { // focused |
| 118 | + outline: 2px solid var(--border-utility-focus); |
| 119 | + } |
| 120 | + |
| 121 | + &:disabled { |
| 122 | + color: var(--state-text-disabled); |
| 123 | + cursor: default; |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | + &.str-chat__button--floating { |
| 128 | + box-shadow: var(--light-elevation-3); |
| 129 | + } |
| 130 | + } |
| 131 | +} |
| 132 | + |
0 commit comments