|
| 1 | +// |
| 2 | +// Copyright IBM Corp. 2020, 2025 |
| 3 | +// |
| 4 | +// This source code is licensed under the Apache-2.0 license found in the |
| 5 | +// LICENSE file in the root directory of this source tree. |
| 6 | +// |
| 7 | + |
| 8 | +@use '@carbon/styles/scss/utilities/convert' as *; |
| 9 | +@use '@carbon/styles/scss/spacing' as *; |
| 10 | +@use '@carbon/styles/scss/breakpoint' as *; |
| 11 | +@use '@carbon/styles/scss/theme' as *; |
| 12 | +@use '@carbon/styles/scss/compat/theme' as *; |
| 13 | +@use '@carbon/styles/scss/themes' as *; |
| 14 | +@use '@carbon/styles/scss/colors' as *; |
| 15 | +@use '@carbon/styles/scss/type' as *; |
| 16 | + |
| 17 | +:host { |
| 18 | + position: relative; |
| 19 | + display: block; |
| 20 | +} |
| 21 | + |
| 22 | +.earth-language-icon { |
| 23 | + display: flex; |
| 24 | + align-items: center; |
| 25 | + justify-content: center; |
| 26 | + padding: 1rem; |
| 27 | + color: $icon-secondary; |
| 28 | + cursor: pointer; |
| 29 | + padding-block-end: 14px; |
| 30 | + |
| 31 | + svg { |
| 32 | + margin-block-start: -2px; |
| 33 | + } |
| 34 | + |
| 35 | + &:hover { |
| 36 | + background: $background-hover; |
| 37 | + color: $icon-primary; |
| 38 | + } |
| 39 | + |
| 40 | + &:active { |
| 41 | + background: $background-hover; |
| 42 | + color: $icon-primary; |
| 43 | + outline: 2px solid var(--cds-button-primary, #0f62fe); |
| 44 | + outline-offset: -2px; |
| 45 | + } |
| 46 | + |
| 47 | + &:focus { |
| 48 | + outline: 2px solid var(--cds-button-primary, #0f62fe); |
| 49 | + outline-offset: -2px; |
| 50 | + } |
| 51 | + |
| 52 | + &[aria-expanded='true'] { |
| 53 | + color: $icon-secondary; |
| 54 | + outline: 2px solid $focus; |
| 55 | + |
| 56 | + &:hover { |
| 57 | + background-color: $background-selected; |
| 58 | + color: $icon-primary; |
| 59 | + } |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +#countrySwitcher { |
| 64 | + position: absolute; |
| 65 | + z-index: 1000; |
| 66 | + inset-block-start: 0.2vh; |
| 67 | + inset-inline: auto 0; |
| 68 | +} |
| 69 | + |
| 70 | +#countryDropdown { |
| 71 | + overflow: hidden auto; |
| 72 | + border-radius: 4px; |
| 73 | + background-color: #ffffff; |
| 74 | + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); |
| 75 | + inline-size: 320px; |
| 76 | + margin-block-start: calc(var(--c4d-masthead-l0-bottom-edge, 3rem) + 1px); |
| 77 | + max-block-size: calc( |
| 78 | + 100vh - var(--cds-spacing-09, 3rem) - var(--cds-layout-05, 4rem) |
| 79 | + ); |
| 80 | + |
| 81 | + &.hidden { |
| 82 | + display: none; |
| 83 | + } |
| 84 | + |
| 85 | + @include breakpoint-between(320px, 671px) { |
| 86 | + position: fixed; |
| 87 | + z-index: 8000; |
| 88 | + block-size: calc(100% - 1px - 3rem); |
| 89 | + inline-size: 100vw; |
| 90 | + inset-block: 0; |
| 91 | + inset-inline-start: 0; |
| 92 | + max-inline-size: 100vw; |
| 93 | + will-change: inline-size; |
| 94 | + } |
| 95 | +} |
| 96 | + |
| 97 | +.current-region-container { |
| 98 | + background: $background-inverse; |
| 99 | + |
| 100 | + .current-region-label { |
| 101 | + padding: 15px 16px; |
| 102 | + border-block-end-width: 1px; |
| 103 | + @include type-style('label-01'); |
| 104 | + |
| 105 | + color: $text-on-color; |
| 106 | + } |
| 107 | + |
| 108 | + .current-region-value { |
| 109 | + padding: 0 16px 15px; |
| 110 | + border-block-end-width: 1px; |
| 111 | + color: $text-on-color; |
| 112 | + @include type-style('body-compact-01'); |
| 113 | + } |
| 114 | +} |
| 115 | + |
| 116 | +.region-selection { |
| 117 | + @include type-style('label-01'); |
| 118 | + |
| 119 | + padding: 15px 16px; |
| 120 | + background: $background; |
| 121 | + border-block-end: 1px solid $border-subtle-01; |
| 122 | + color: $text-primary; |
| 123 | +} |
| 124 | + |
| 125 | +.region-list-container { |
| 126 | + padding: 0; |
| 127 | + margin: 0; |
| 128 | + background: #ffffff; |
| 129 | + list-style: none; |
| 130 | + |
| 131 | + li { |
| 132 | + padding: 15px 16px; |
| 133 | + background: $background; |
| 134 | + border-block-end: 1px solid $border-subtle-01; |
| 135 | + cursor: pointer; |
| 136 | + font-size: 14px; |
| 137 | + |
| 138 | + &:hover { |
| 139 | + background: $background-hover; |
| 140 | + } |
| 141 | + |
| 142 | + &:focus { |
| 143 | + outline: 2px solid var(--cds-button-primary, #0f62fe); |
| 144 | + outline-offset: -2px; |
| 145 | + } |
| 146 | + |
| 147 | + &:active { |
| 148 | + background: $background-selected; |
| 149 | + color: $text-primary; |
| 150 | + outline: 2px solid var(--cds-button-primary, #0f62fe); |
| 151 | + outline-offset: -2px; |
| 152 | + @include type-style('body-compact-01'); |
| 153 | + } |
| 154 | + } |
| 155 | +} |
| 156 | + |
| 157 | +@include breakpoint-between(320px, 799px) { |
| 158 | + // Stylelint here complains that the tags for the selector are not valid, but they're web component's tags |
| 159 | + /* stylelint-disable selector-type-no-unknown */ |
| 160 | + :host-context(c4d-masthead-container) { |
| 161 | + c4d-masthead { |
| 162 | + c4d-masthead-global-bar { |
| 163 | + c4d-masthead-contact { |
| 164 | + /* stylelint-disable-next-line declaration-no-important */ |
| 165 | + display: none !important; |
| 166 | + } |
| 167 | + } |
| 168 | + } |
| 169 | + } |
| 170 | +} |
0 commit comments