deprecated
1 week ago
block.json
1 week ago
component.js
2 weeks ago
edit.js
1 week ago
icon.svg
3 months ago
index.js
1 week ago
index.php
3 months ago
save.js
1 week ago
style.scss
1 week ago
transforms.js
3 months ago
style.scss
452 lines
| 1 | @use 'utils/breakpoints' as *; |
| 2 | |
| 3 | $vk-color-secondary: #6c757d; |
| 4 | $vk-color-success: #28a745; |
| 5 | $vk-color-info:#17a2b8; |
| 6 | $vk-color-warning:#ffc107; |
| 7 | $vk-color-danger: #dc3545; |
| 8 | $vk-color-light:#f8f9fa; |
| 9 | $vk-color-dark:#343a40; |
| 10 | |
| 11 | // theme.json があるとコアに a:where(:not(.wp-element-button)) { text-decoration: underline; } が� |
| 12 | �るため打ち消し |
| 13 | a.vk_button_link { |
| 14 | text-decoration: none; |
| 15 | } |
| 16 | :root, |
| 17 | :root .editor-styles-wrapper { |
| 18 | .has-vk-color-primary-background-color, |
| 19 | .has-undefined-background-color { |
| 20 | // has-vk-color-primary-background-colorクラスはデフォルトで設定される。Lightning以外のテーマに対応するため代替値を設定 |
| 21 | background-color: var(--wp--preset--color--vk-color-primary,#337ab7); |
| 22 | } |
| 23 | .has-vk-color-secondary-background-color { |
| 24 | background-color: $vk-color-secondary; |
| 25 | } |
| 26 | .has-vk-color-success-background-color { |
| 27 | background-color: $vk-color-success; |
| 28 | } |
| 29 | .has-vk-color-info-background-color { |
| 30 | background-color: $vk-color-info; |
| 31 | } |
| 32 | .has-vk-color-warning-background-color { |
| 33 | background-color: $vk-color-warning; |
| 34 | } |
| 35 | // https://getbootstrap.jp/docs/5.0/components/buttons/ |
| 36 | .has-vk-color-danger-background-color { |
| 37 | background-color: $vk-color-danger; |
| 38 | } |
| 39 | .has-vk-color-light-background-color { |
| 40 | background-color: $vk-color-light; |
| 41 | } |
| 42 | .has-vk-color-dark-background-color { |
| 43 | background-color: $vk-color-dark; |
| 44 | } |
| 45 | .has-vk-color-primary-color { |
| 46 | color: var(--wp--preset--color--vk-color-primary); |
| 47 | } |
| 48 | .has-vk-color-secondary-color { |
| 49 | color: $vk-color-secondary; |
| 50 | } |
| 51 | .has-vk-color-success-color { |
| 52 | color: $vk-color-success; |
| 53 | } |
| 54 | .has-vk-color-info-color { |
| 55 | color: $vk-color-info; |
| 56 | } |
| 57 | .has-vk-color-warning-color { |
| 58 | color: $vk-color-warning; |
| 59 | } |
| 60 | .has-vk-color-danger-color { |
| 61 | color: $vk-color-danger; |
| 62 | } |
| 63 | .has-vk-color-light-color { |
| 64 | color: $vk-color-light; |
| 65 | } |
| 66 | .has-vk-color-dark-color { |
| 67 | color: $vk-color-dark; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | .vk_button, |
| 72 | .editor-styles-wrapper .vk_button { |
| 73 | box-sizing: border-box; |
| 74 | /* 他テーマで0だと左寄せになる場合があるのでautoに変更 */ |
| 75 | /* → いやいや、vk_button が100% div じゃない時にそれでは右寄せなど効かなくなるので margin 左右は指定ナシに戻し */ |
| 76 | margin-top:0; |
| 77 | margin-bottom:5px; |
| 78 | text-align: center; /* テキストのみの時のセンター揃え */ |
| 79 | &-color-custom { |
| 80 | a:hover { |
| 81 | opacity: 0.8; |
| 82 | box-shadow: 0 0 0 0.2rem rgba(171, 184, 195, 0.25); |
| 83 | } |
| 84 | .vk_button_link-type-text:hover { |
| 85 | box-shadow: none; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | @media (width < $xs) { |
| 90 | &[class*="vk_button-width-mobile-"]*="vk_button-width-mobile-""]{ |
| 91 | .vk_button_link { |
| 92 | display: block; |
| 93 | min-width: 50px; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | &-width-mobile { |
| 98 | &-25 { |
| 99 | width: calc( 25% - 8px ); |
| 100 | } |
| 101 | &-50 { |
| 102 | width: calc( 50% - 8px ); |
| 103 | } |
| 104 | &-75 { |
| 105 | width: calc( 75% - 8px ); |
| 106 | } |
| 107 | &-100 { |
| 108 | width: 100%; |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | @media ($xs <= width < $md) { |
| 114 | &[class*="vk_button-width-tablet-"]*="vk_button-width-tablet-""] { |
| 115 | .vk_button_link { |
| 116 | display: block; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | &-width-tablet { |
| 121 | &-25 { |
| 122 | width: calc(25% - 8px); |
| 123 | } |
| 124 | |
| 125 | &-50 { |
| 126 | width: calc(50% - 8px); |
| 127 | } |
| 128 | |
| 129 | &-75 { |
| 130 | width: calc(75% - 8px); |
| 131 | } |
| 132 | |
| 133 | &-100 { |
| 134 | width: 100%; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | @media (width >= $md) { |
| 140 | &[class*="vk_button-width-"]*="vk_button-width-""] { |
| 141 | .vk_button_link { |
| 142 | display: block; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | &-width { |
| 147 | &-25 { |
| 148 | width: calc(25% - 8px); |
| 149 | } |
| 150 | |
| 151 | &-50 { |
| 152 | width: calc(50% - 8px); |
| 153 | } |
| 154 | |
| 155 | &-75 { |
| 156 | width: calc(75% - 8px); |
| 157 | } |
| 158 | |
| 159 | &-100 { |
| 160 | width: 100%; |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | // 塗り |
| 166 | .btn.has-background:not(.has-text-color) { |
| 167 | color: #fff; |
| 168 | /* 白っぽい色に対する対策 */ |
| 169 | &.has-vk-color-light-background-color, // https://getbootstrap.jp/docs/5.0/components/buttons/ |
| 170 | &.has-white-background-color { |
| 171 | color:#212529; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | // アウトラインボタン(背景なし)の場合(.btnを含めるとカスタムカラーの 背景塗りなし:hover で背景が文字色と同じになる) |
| 176 | .has-text-color.is-style-outline { |
| 177 | background-color: transparent; |
| 178 | border: 1px solid currentColor; |
| 179 | &:hover { |
| 180 | /* 応急処置:規定カラー */ |
| 181 | &.has-vk-color-primary-color { |
| 182 | background-color: var(--wp--preset--color--vk-color-primary); |
| 183 | } |
| 184 | &.has-vk-color-secondary-color { |
| 185 | background-color: $vk-color-secondary; |
| 186 | } |
| 187 | &.has-vk-color-success-color { |
| 188 | background-color: $vk-color-success; |
| 189 | } |
| 190 | &.has-vk-color-info-color { |
| 191 | background-color: $vk-color-info; |
| 192 | } |
| 193 | &.has-vk-color-warning-color { |
| 194 | background-color: $vk-color-warning; |
| 195 | } |
| 196 | &.has-vk-color-danger-color { |
| 197 | background-color: $vk-color-danger; |
| 198 | } |
| 199 | &.has-vk-color-light-color { |
| 200 | background-color: $vk-color-light; |
| 201 | } |
| 202 | &.has-vk-color-dark-color { |
| 203 | background-color: $vk-color-dark; |
| 204 | } |
| 205 | /* 応急処置:カラーパレットコア */ |
| 206 | &.has-black-color { |
| 207 | background-color: #000000; |
| 208 | } |
| 209 | &.has-cyan-bluish-gray-color { |
| 210 | background-color: #abb8c3; |
| 211 | } |
| 212 | &.has-white-color { |
| 213 | background-color: #ffffff; |
| 214 | } |
| 215 | &.has-pale-pink-color { |
| 216 | background-color: #f78da7; |
| 217 | } |
| 218 | &.has-vivid-red-color { |
| 219 | background-color: #cf2e2e; |
| 220 | } |
| 221 | &.has-luminous-vivid-orange-color { |
| 222 | background-color: #ff6900; |
| 223 | } |
| 224 | &.has-luminous-vivid-amber-color { |
| 225 | background-color: #fcb900; |
| 226 | } |
| 227 | &.has-light-green-cyan-color { |
| 228 | background-color: #7bdcb5; |
| 229 | } |
| 230 | &.has-vivid-green-cyan-color { |
| 231 | background-color: #00d084; |
| 232 | } |
| 233 | &.has-pale-cyan-blue-color { |
| 234 | background-color: #8ed1fc; |
| 235 | } |
| 236 | &.has-vivid-cyan-blue-color { |
| 237 | background-color: #0693e3; |
| 238 | } |
| 239 | &.has-vivid-purple-color { |
| 240 | background-color: #9b51e0; |
| 241 | } |
| 242 | /* 応急処置:カラーパレットVK */ |
| 243 | &.has-vk-color-primary-color { |
| 244 | background-color: var(--wp--preset--color--vk-color-primary); |
| 245 | } |
| 246 | &.has-vk-color-primary-dark-color { |
| 247 | background-color: var(--wp--preset--color--vk-color-primary-dark); |
| 248 | } |
| 249 | &.has-vk-color-primary-vivid-color { |
| 250 | background-color: var(--wp--preset--color--vk-color-primary-vivid); |
| 251 | } |
| 252 | &.has-vk-color-custom-1-color { |
| 253 | background-color: var(--wp--preset--color--vk-color-custom-1); |
| 254 | } |
| 255 | &.has-vk-color-custom-2-color { |
| 256 | background-color: var(--wp--preset--color--vk-color-custom-2); |
| 257 | } |
| 258 | &.has-vk-color-custom-3-color { |
| 259 | background-color: var(--wp--preset--color--vk-color-custom-3); |
| 260 | } |
| 261 | &.has-vk-color-custom-4-color { |
| 262 | background-color: var(--wp--preset--color--vk-color-custom-4); |
| 263 | } |
| 264 | &.has-vk-color-custom-5-color { |
| 265 | background-color: var(--wp--preset--color--vk-color-custom-5); |
| 266 | } |
| 267 | // ここから標準� |
| 268 | 備 |
| 269 | // background-color: currentColor; |
| 270 | border: 1px solid #fff; |
| 271 | .vk_button_link_before, |
| 272 | .vk_button_link_txt, |
| 273 | .vk_button_link_after, |
| 274 | .vk_button_link_subCaption { |
| 275 | color: #fff; |
| 276 | } |
| 277 | /* 白っぽい色に対する対策 */ |
| 278 | &.has-vk-color-light-color .vk_button_link_before, |
| 279 | &.has-vk-color-light-color .vk_button_link_txt, |
| 280 | &.has-vk-color-light-color .vk_button_link_after, |
| 281 | &.has-vk-color-light-color .vk_button_link_subCaption, |
| 282 | &.has-white-color .vk_button_link_before, |
| 283 | &.has-white-color .vk_button_link_txt, |
| 284 | &.has-white-color .vk_button_link_after, |
| 285 | &.has-white-color .vk_button_link_subCaption { |
| 286 | color:#212529; |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | // テキストのみ |
| 292 | .has-text-color.vk_button_link-type-text { |
| 293 | &:hover{ |
| 294 | opacity: unset; |
| 295 | .vk_button_link_txt, |
| 296 | .vk_button_link_subCaption { |
| 297 | text-decoration: underline; |
| 298 | text-decoration-style: dotted; |
| 299 | text-underline-offset:2px; |
| 300 | text-decoration-color:currentColor; |
| 301 | text-decoration-thickness: 1px; |
| 302 | } |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | //� |
| 307 | �る |
| 308 | &.is-style-shine { |
| 309 | |
| 310 | // � |
| 311 | �るボタン |
| 312 | @keyframes shine {//� |
| 313 | �る速さのキーフレーム |
| 314 | 0% { left: -40%; } |
| 315 | 10% { left: 120%; } |
| 316 | 100% { left: 120%; } |
| 317 | } |
| 318 | |
| 319 | .btn.has-background { |
| 320 | // テキスト色が� |
| 321 | �ってない場合は白にしたいので追加 |
| 322 | &:not(.has-text-color){ |
| 323 | color: #fff; |
| 324 | } |
| 325 | |
| 326 | overflow:hidden; |
| 327 | position: relative; |
| 328 | &::before { // � |
| 329 | �りの擬似要素 |
| 330 | content: ''; |
| 331 | position: absolute; |
| 332 | top: 0; |
| 333 | left: -40%; |
| 334 | width: 50%; |
| 335 | height: 100%; |
| 336 | background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%); |
| 337 | transform: skewX(-25deg); |
| 338 | /* アニメーション */ |
| 339 | animation-name: shine; |
| 340 | animation-duration: 3s; |
| 341 | animation-timing-function: ease-in-out; |
| 342 | animation-iteration-count: infinite;//無制限に繰り返し |
| 343 | } |
| 344 | /* 白っぽい色に対する対策 */ |
| 345 | &.has-vk-color-light-background-color, |
| 346 | &.has-white-background-color { |
| 347 | color:#212529; |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | &.vk_button-align { |
| 353 | &-left { |
| 354 | text-align: left; |
| 355 | } |
| 356 | |
| 357 | &-center { |
| 358 | text-align: center; |
| 359 | } |
| 360 | |
| 361 | &-right { |
| 362 | text-align: right; |
| 363 | } |
| 364 | |
| 365 | &-block { |
| 366 | display: block; |
| 367 | .vk_button_link { |
| 368 | width:100%; |
| 369 | } |
| 370 | } |
| 371 | &-wide { |
| 372 | display: block; |
| 373 | margin-left: auto; |
| 374 | margin-right: auto; |
| 375 | width: 100%; |
| 376 | max-width: 70%; |
| 377 | .vk_button_btn, |
| 378 | .btn { |
| 379 | display: block; |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | .vk_button_link { |
| 385 | min-width: 100px; |
| 386 | min-height: 25px; |
| 387 | box-sizing: border-box; |
| 388 | &-type-text { |
| 389 | box-shadow: none; |
| 390 | padding: 0; |
| 391 | &:hover { |
| 392 | background: none; |
| 393 | box-shadow: none; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | &.btn { |
| 398 | // .btn指定がないと編集画面で標準の .btn の指定に負ける |
| 399 | // X-T9で .has-background に対して padding:0; 指定しているので、左右余白が 0 にならないように上書き |
| 400 | padding: 0.6em 1.5rem; |
| 401 | user-select: text; |
| 402 | text-decoration: none; |
| 403 | font-size: calc( 1rem * 1 ); |
| 404 | |
| 405 | |
| 406 | } |
| 407 | &.btn-xl { |
| 408 | font-size: calc( 1rem * 1.5 ); |
| 409 | } |
| 410 | &.btn-lg{ |
| 411 | font-size:calc( 1rem * 1.25 ); |
| 412 | } |
| 413 | &.btn-sm { |
| 414 | font-size: calc( 1rem * .875 ); |
| 415 | } |
| 416 | &.btn-xs { |
| 417 | font-size: calc( 1rem * .75 ); |
| 418 | } |
| 419 | // アイコンとテキストの間隔は固定値 (0.7rem) を採用。 |
| 420 | // font-size に追従させる em 単位は将来検討の余地あり。 |
| 421 | &_before { |
| 422 | margin-right: 0.7rem; |
| 423 | } |
| 424 | |
| 425 | &_after { |
| 426 | margin-left: 0.7rem; |
| 427 | } |
| 428 | |
| 429 | &_caption { |
| 430 | word-break: initial; // FireFox で tt5 の場合カラム� |
| 431 | でテキストが段落ちするので初期値にリセット |
| 432 | display: inline-flex; |
| 433 | align-items: center; |
| 434 | justify-content: center; |
| 435 | .vk_button_link_after { |
| 436 | margin-right: 0; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | &_subCaption { |
| 441 | display: block; |
| 442 | overflow: hidden; |
| 443 | margin: 0; |
| 444 | font-size: 80%; |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | .editor-rich-text { |
| 449 | // Font Awesomeアイコンが管理画面側で改行されないために inline-block を指定 |
| 450 | display: inline-block; |
| 451 | } |
| 452 | } |