frontblocks-cookie-notice.css
239 lines
| 1 | /** |
| 2 | * FrontBlocks Cookie Notice Styles |
| 3 | * |
| 4 | * @package FrontBlocks |
| 5 | * @version 1.0.0 |
| 6 | */ |
| 7 | |
| 8 | .frbl-cookie-notice { |
| 9 | --frbl-cookie-accent: #687df9; |
| 10 | --frbl-cookie-accent-contrast: #ffffff; |
| 11 | --frbl-cookie-accent-on-light: #687df9; |
| 12 | |
| 13 | position: fixed; |
| 14 | z-index: 999999; |
| 15 | box-sizing: border-box; |
| 16 | font-family: inherit; |
| 17 | line-height: 1.5; |
| 18 | opacity: 1; |
| 19 | transition: opacity 0.3s ease, transform 0.3s ease; |
| 20 | } |
| 21 | |
| 22 | .frbl-cookie-notice * { |
| 23 | box-sizing: border-box; |
| 24 | } |
| 25 | |
| 26 | .frbl-cookie-notice--hidden { |
| 27 | opacity: 0; |
| 28 | pointer-events: none; |
| 29 | } |
| 30 | |
| 31 | .frbl-cookie-notice__panel { |
| 32 | background-color: #ffffff; |
| 33 | color: #1f2937; |
| 34 | box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12); |
| 35 | } |
| 36 | |
| 37 | .frbl-cookie-notice__message { |
| 38 | margin: 0; |
| 39 | font-size: 14px; |
| 40 | color: #1f2937; |
| 41 | } |
| 42 | |
| 43 | .frbl-cookie-notice__link { |
| 44 | color: var(--frbl-cookie-accent-on-light); |
| 45 | text-decoration: underline; |
| 46 | white-space: nowrap; |
| 47 | } |
| 48 | |
| 49 | .frbl-cookie-notice__actions { |
| 50 | display: flex; |
| 51 | gap: 12px; |
| 52 | flex-shrink: 0; |
| 53 | } |
| 54 | |
| 55 | .frbl-cookie-notice__button { |
| 56 | appearance: none; |
| 57 | border-radius: 6px; |
| 58 | padding: 10px 20px; |
| 59 | font-size: 14px; |
| 60 | font-weight: 600; |
| 61 | line-height: 1.2; |
| 62 | cursor: pointer; |
| 63 | transition: filter 0.15s ease, transform 0.15s ease; |
| 64 | white-space: nowrap; |
| 65 | } |
| 66 | |
| 67 | .frbl-cookie-notice__button:hover { |
| 68 | filter: brightness(0.92); |
| 69 | } |
| 70 | |
| 71 | .frbl-cookie-notice__button:active { |
| 72 | transform: scale(0.97); |
| 73 | } |
| 74 | |
| 75 | .frbl-cookie-notice__button:focus-visible { |
| 76 | outline: 2px solid var(--frbl-cookie-accent-on-light); |
| 77 | outline-offset: 2px; |
| 78 | } |
| 79 | |
| 80 | .frbl-cookie-notice__button--accept { |
| 81 | background-color: var(--frbl-cookie-accent); |
| 82 | border: 1px solid var(--frbl-cookie-accent); |
| 83 | color: var(--frbl-cookie-accent-contrast); |
| 84 | } |
| 85 | |
| 86 | .frbl-cookie-notice__button--reject { |
| 87 | background-color: transparent; |
| 88 | border: 1px solid #9ca3af; |
| 89 | color: #1f2937; |
| 90 | } |
| 91 | |
| 92 | /* Bar layout: full-width bottom bar. */ |
| 93 | .frbl-cookie-notice--bar { |
| 94 | inset: auto 0 0 0; |
| 95 | width: 100%; |
| 96 | max-height: 100vh; |
| 97 | overflow-y: auto; |
| 98 | } |
| 99 | |
| 100 | .frbl-cookie-notice--bar .frbl-cookie-notice__panel { |
| 101 | display: flex; |
| 102 | align-items: center; |
| 103 | justify-content: space-between; |
| 104 | gap: 16px; |
| 105 | flex-wrap: wrap; |
| 106 | padding: 16px 24px; |
| 107 | } |
| 108 | |
| 109 | .frbl-cookie-notice--bar .frbl-cookie-notice__message { |
| 110 | flex: 1 1 320px; |
| 111 | } |
| 112 | |
| 113 | /* Box layout: boxed panel anchored bottom-left or bottom-right. */ |
| 114 | .frbl-cookie-notice--box { |
| 115 | bottom: 20px; |
| 116 | max-width: 380px; |
| 117 | width: calc(100% - 40px); |
| 118 | max-height: calc(100vh - 40px); |
| 119 | overflow-y: auto; |
| 120 | } |
| 121 | |
| 122 | .frbl-cookie-notice--box.frbl-cookie-notice--right { |
| 123 | right: 20px; |
| 124 | } |
| 125 | |
| 126 | .frbl-cookie-notice--box.frbl-cookie-notice--left { |
| 127 | left: 20px; |
| 128 | } |
| 129 | |
| 130 | .frbl-cookie-notice--box .frbl-cookie-notice__panel { |
| 131 | border-radius: 12px; |
| 132 | padding: 20px; |
| 133 | display: flex; |
| 134 | flex-direction: column; |
| 135 | gap: 16px; |
| 136 | } |
| 137 | |
| 138 | .frbl-cookie-notice--box .frbl-cookie-notice__actions { |
| 139 | flex-direction: column; |
| 140 | } |
| 141 | |
| 142 | .frbl-cookie-notice--box .frbl-cookie-notice__button { |
| 143 | width: 100%; |
| 144 | text-align: center; |
| 145 | } |
| 146 | |
| 147 | /* Popup layout: centered modal with a dimmed backdrop. */ |
| 148 | .frbl-cookie-notice--popup { |
| 149 | inset: 0; |
| 150 | display: flex; |
| 151 | align-items: center; |
| 152 | justify-content: center; |
| 153 | padding: 20px; |
| 154 | overflow-y: auto; |
| 155 | background-color: rgba(15, 23, 42, 0.55); |
| 156 | } |
| 157 | |
| 158 | .frbl-cookie-notice--popup .frbl-cookie-notice__panel { |
| 159 | border-radius: 16px; |
| 160 | padding: 40px 32px 32px; |
| 161 | max-width: 420px; |
| 162 | width: 100%; |
| 163 | max-height: calc(100vh - 40px); |
| 164 | overflow-y: auto; |
| 165 | display: flex; |
| 166 | flex-direction: column; |
| 167 | align-items: center; |
| 168 | text-align: center; |
| 169 | gap: 16px; |
| 170 | box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25); |
| 171 | } |
| 172 | |
| 173 | .frbl-cookie-notice__icon { |
| 174 | display: flex; |
| 175 | align-items: center; |
| 176 | justify-content: center; |
| 177 | width: 64px; |
| 178 | height: 64px; |
| 179 | flex-shrink: 0; |
| 180 | border-radius: 50%; |
| 181 | background-color: var(--frbl-cookie-accent); |
| 182 | color: var(--frbl-cookie-accent-contrast); |
| 183 | } |
| 184 | |
| 185 | .frbl-cookie-notice__icon svg { |
| 186 | width: 32px; |
| 187 | height: 32px; |
| 188 | } |
| 189 | |
| 190 | .frbl-cookie-notice--popup .frbl-cookie-notice__actions { |
| 191 | justify-content: center; |
| 192 | width: 100%; |
| 193 | } |
| 194 | |
| 195 | body.frbl-cookie-notice-lock-scroll { |
| 196 | overflow: hidden; |
| 197 | } |
| 198 | |
| 199 | @media (max-width: 600px) { |
| 200 | .frbl-cookie-notice--bar .frbl-cookie-notice__panel { |
| 201 | padding: 16px; |
| 202 | } |
| 203 | |
| 204 | .frbl-cookie-notice--bar .frbl-cookie-notice__actions, |
| 205 | .frbl-cookie-notice--popup .frbl-cookie-notice__actions { |
| 206 | flex-direction: column; |
| 207 | width: 100%; |
| 208 | } |
| 209 | |
| 210 | .frbl-cookie-notice--bar .frbl-cookie-notice__button, |
| 211 | .frbl-cookie-notice--popup .frbl-cookie-notice__button { |
| 212 | width: 100%; |
| 213 | text-align: center; |
| 214 | } |
| 215 | |
| 216 | .frbl-cookie-notice--box, |
| 217 | .frbl-cookie-notice--popup .frbl-cookie-notice__panel { |
| 218 | width: calc(100% - 24px); |
| 219 | max-width: none; |
| 220 | } |
| 221 | |
| 222 | .frbl-cookie-notice--popup .frbl-cookie-notice__panel { |
| 223 | max-height: calc(100vh - 24px); |
| 224 | } |
| 225 | |
| 226 | .frbl-cookie-notice--box { |
| 227 | left: 12px; |
| 228 | right: 12px; |
| 229 | bottom: 12px; |
| 230 | max-height: calc(100vh - 24px); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | @media (prefers-reduced-motion: reduce) { |
| 235 | .frbl-cookie-notice { |
| 236 | transition: none; |
| 237 | } |
| 238 | } |
| 239 |