|
| 1 | +/* |
| 2 | +Copyright 2019 Adobe. All rights reserved. |
| 3 | +This file is licensed to you under the Apache License, Version 2.0 (the "License"); |
| 4 | +you may not use this file except in compliance with the License. You may obtain a copy |
| 5 | +of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +
|
| 7 | +Unless required by applicable law or agreed to in writing, software distributed under |
| 8 | +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS |
| 9 | +OF ANY KIND, either express or implied. See the License for the specific language |
| 10 | +governing permissions and limitations under the License. |
| 11 | +*/ |
| 12 | + |
| 13 | +:root { |
| 14 | + --spectrum-actiongroup-button-gap-reset: 0; |
| 15 | + --spectrum-actiongroup-quiet-compact-button-gap: var(--spectrum-global-dimension-size-50); |
| 16 | +} |
| 17 | + |
| 18 | +.spectrum-ActionGroup { |
| 19 | + display: flex; |
| 20 | + flex-wrap: wrap; |
| 21 | + |
| 22 | + .spectrum-ActionGroup-item { |
| 23 | + flex-shrink: 0; |
| 24 | + } |
| 25 | + |
| 26 | + .spectrum-ActionGroup-item + .spectrum-ActionGroup-item { |
| 27 | + margin-inline-start: var(--spectrum-actionbuttongroup-text-button-gap-x); |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | +.spectrum-ActionGroup--vertical { |
| 32 | + display: inline-flex; |
| 33 | + flex-direction: column; |
| 34 | + |
| 35 | + .spectrum-ActionGroup-item + .spectrum-ActionGroup-item { |
| 36 | + margin-block-start: var(--spectrum-actionbuttongroup-text-button-gap-y); |
| 37 | + margin-inline-start: var(--spectrum-actiongroup-button-gap-reset); |
| 38 | + } |
| 39 | + |
| 40 | + &.spectrum-ActionGroup--vertical { |
| 41 | + margin-block-start: var(--spectrum-actionbuttongroup-text-button-gap-y); |
| 42 | + margin-inline-start: var(--spectrum-actiongroup-button-gap-reset); |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +.spectrum-ActionGroup--compact { |
| 47 | + &.spectrum-ActionGroup--quiet { |
| 48 | + .spectrum-ActionGroup-item + .spectrum-ActionGroup-item { |
| 49 | + margin-inline-start: var(--spectrum-actiongroup-quiet-compact-button-gap); |
| 50 | + margin-block-start: var(--spectrum-actiongroup-button-gap-reset); |
| 51 | + } |
| 52 | + |
| 53 | + &.spectrum-ActionGroup--vertical { |
| 54 | + .spectrum-ActionGroup-item + .spectrum-ActionGroup-item { |
| 55 | + margin-inline-start: var(--spectrum-actiongroup-button-gap-reset); |
| 56 | + margin-block-start: var(--spectrum-actiongroup-quiet-compact-button-gap); |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + |
| 61 | + &:not(.spectrum-ActionGroup--quiet) { |
| 62 | + flex-wrap: nowrap; |
| 63 | + |
| 64 | + .spectrum-ActionGroup-item { |
| 65 | + position: relative; |
| 66 | + border-radius: 0; |
| 67 | + z-index: 0; |
| 68 | + |
| 69 | + &:first-child { |
| 70 | + border-start-start-radius: var(--spectrum-actionbutton-border-radius); |
| 71 | + border-end-start-radius: var(--spectrum-actionbutton-border-radius); |
| 72 | + margin-inline-end: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 73 | + } |
| 74 | + |
| 75 | + &:last-child { |
| 76 | + border-start-end-radius: var(--spectrum-actionbutton-border-radius); |
| 77 | + border-end-end-radius: var(--spectrum-actionbutton-border-radius); |
| 78 | + margin-inline-start: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 79 | + margin-inline-end: 0; |
| 80 | + } |
| 81 | + |
| 82 | + &.is-selected { |
| 83 | + z-index: 1; |
| 84 | + } |
| 85 | + |
| 86 | + &:hover { |
| 87 | + z-index: 2; |
| 88 | + } |
| 89 | + |
| 90 | + /* Appear above hovered and selected borders */ |
| 91 | + &:focus-ring { |
| 92 | + z-index: 3; |
| 93 | + } |
| 94 | + |
| 95 | + & + .spectrum-ActionGroup-item { |
| 96 | + margin-inline-start: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 97 | + margin-inline-end: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 98 | + } |
| 99 | + |
| 100 | + .spectrum-ActionButton-label { |
| 101 | + inline-size: auto; |
| 102 | + } |
| 103 | + } |
| 104 | + |
| 105 | + &.spectrum-ActionGroup--vertical { |
| 106 | + .spectrum-ActionGroup-item { |
| 107 | + border-radius: 0; |
| 108 | + |
| 109 | + & + .spectrum-ActionGroup-item { |
| 110 | + margin-block-start: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 111 | + margin-block-end: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 112 | + } |
| 113 | + |
| 114 | + &:first-child { |
| 115 | + border-start-start-radius: var(--spectrum-actionbutton-border-radius); |
| 116 | + border-start-end-radius: var(--spectrum-actionbutton-border-radius); |
| 117 | + border-radius: 0; |
| 118 | + margin-block-end: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 119 | + } |
| 120 | + |
| 121 | + &:last-child { |
| 122 | + border-end-start-radius: var(--spectrum-actionbutton-border-radius); |
| 123 | + border-end-end-radius: var(--spectrum-actionbutton-border-radius); |
| 124 | + border-radius: 0; |
| 125 | + margin-block-start: calc(-1 * var(--spectrum-actionbutton-border-size) / 2); |
| 126 | + margin-block-end: 0; |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | +} |
| 132 | + |
| 133 | +.spectrum-ActionGroup--justified .spectrum-ActionGroup-item { |
| 134 | + flex: 1; |
| 135 | +} |
0 commit comments