_group.scss
428 lines
| 1 | @use 'components/scroll-hint/styles/base' as *; |
| 2 | @use 'components/scrollbar-styles/scrollbar' as *; |
| 3 | |
| 4 | /*-------------------------------------------*/ |
| 5 | /* スクロールヒント - グループブロック用 |
| 6 | /*-------------------------------------------*/ |
| 7 | |
| 8 | // � |
| 9 | �通のテキスト要素セレクタ |
| 10 | $text-elements: p, h1, h2, h3, h4, h5, h6, li, span, div; |
| 11 | |
| 12 | // 横並びレイアウトの� |
| 13 | �通パターン |
| 14 | @mixin horizontal-layout { |
| 15 | flex-wrap: nowrap; |
| 16 | |
| 17 | > * { |
| 18 | flex-shrink: 0; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | @mixin scrollable-group-default-child-layout( |
| 23 | $set-display: false, |
| 24 | $include-grid-auto-columns: true |
| 25 | ) { |
| 26 | @if $set-display { |
| 27 | display: block; |
| 28 | } |
| 29 | |
| 30 | > *:not(.is-layout-grid):not(.is-layout-flex) { |
| 31 | width: 100%; |
| 32 | } |
| 33 | |
| 34 | > .is-layout-grid, |
| 35 | > .is-layout-flex { |
| 36 | width: auto; |
| 37 | } |
| 38 | |
| 39 | > .wp-block-group.is-layout-grid { |
| 40 | grid-template-columns: none; |
| 41 | grid-auto-flow: column; |
| 42 | |
| 43 | @if $include-grid-auto-columns { |
| 44 | grid-auto-columns: 100%; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | > .wp-block-group.is-layout-flex { |
| 49 | // 中身の� |
| 50 | に追従させて、はみ出し分もスクロール可能にする |
| 51 | min-width: max-content; |
| 52 | @include horizontal-layout; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // 横スクロール |
| 57 | @mixin scrollable-group { |
| 58 | overflow-x: auto; |
| 59 | -webkit-overflow-scrolling: touch; |
| 60 | // padding を� |
| 61 | に含めて、要素自体のはみ出しを抑制 |
| 62 | box-sizing: border-box; |
| 63 | // モバイルでのオーバースクロール連鎖を抑制 |
| 64 | overscroll-behavior-inline: contain; |
| 65 | |
| 66 | @include scrollable-group-default-child-layout(true, true); |
| 67 | |
| 68 | // カラムブロックを横並びに保つ |
| 69 | &.wp-block-columns, |
| 70 | .wp-block-columns { |
| 71 | flex-wrap: nowrap; |
| 72 | align-items: stretch; |
| 73 | |
| 74 | .wp-block-column { |
| 75 | flex-shrink: 0; |
| 76 | |
| 77 | // 注意: テーブルモード(data-table-mode="true")が有効な場合、 |
| 78 | // view.jsのprocessGroupBlock()関数によって、.wp-block-columnに |
| 79 | // min-widthが動的に設定されます。これにより、複数の行にわたって |
| 80 | // 同じ列位置のカラム� |
| 81 | が統一され、テーブルのような見た目になります。 |
| 82 | |
| 83 | // カラム� |
| 84 | のすべての要素がコンテンツ� |
| 85 | に合わせる |
| 86 | > * { |
| 87 | max-width: 100%; |
| 88 | } |
| 89 | |
| 90 | // テキスト要素は特に最大� |
| 91 | を基準にする |
| 92 | > p, |
| 93 | > h1, |
| 94 | > h2, |
| 95 | > h3, |
| 96 | > h4, |
| 97 | > h5, |
| 98 | > h6 { |
| 99 | max-width: 100%; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // テーブルモード以外の場合、各カラムがコンテンツ� |
| 105 | に応じた� |
| 106 | を持つようにする |
| 107 | &:not([data-table-mode="true"]) { |
| 108 | &.wp-block-columns, |
| 109 | .wp-block-columns { |
| 110 | .wp-block-column { |
| 111 | min-width: max-content; |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // テキスト要素をnowrapにする(オプションが有効な場合のみ) |
| 117 | &[data-text-nowrap="true"]="true""] { |
| 118 | // グループ� |
| 119 | のすべてのテキスト要素 |
| 120 | #{$text-elements} { |
| 121 | white-space: nowrap; |
| 122 | } |
| 123 | |
| 124 | // カラムブロック� |
| 125 | のテキスト要素 |
| 126 | &.wp-block-columns, |
| 127 | .wp-block-columns { |
| 128 | .wp-block-column { |
| 129 | #{$text-elements} { |
| 130 | white-space: nowrap; |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | // グリッドカラムブロックを横並びに保つ |
| 137 | .vk_gridColumn { |
| 138 | flex-wrap: nowrap; |
| 139 | |
| 140 | .row { |
| 141 | flex-wrap: nowrap; |
| 142 | } |
| 143 | |
| 144 | > [class*="col-"]*="col-""], |
| 145 | [class*="col-"]*="col-""] { |
| 146 | flex-shrink: 0; |
| 147 | width: auto; |
| 148 | flex: none; |
| 149 | max-width: none; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | // グリッドカラムカードブロックを横並びに保つ |
| 154 | .vk_gridcolcard { |
| 155 | // インラインスタイルで設定されたgrid-template-columnsを上書き |
| 156 | grid-template-columns: none; |
| 157 | grid-auto-flow: column; |
| 158 | grid-auto-columns: max-content; |
| 159 | |
| 160 | > * { |
| 161 | flex-shrink: 0; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | // カードブロックを横並びに保つ |
| 166 | .vk_posts { |
| 167 | @include horizontal-layout; |
| 168 | |
| 169 | .wp-block-vk-blocks-card-item { |
| 170 | width: auto; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | // 横並びボタンブロックを横並びに保つ |
| 175 | .vk_buttons, |
| 176 | .vk_buttons_col { |
| 177 | @include horizontal-layout; |
| 178 | } |
| 179 | |
| 180 | // 横並びアイコンブロックを横並びに保つ |
| 181 | .vk_icons, |
| 182 | .vk_icons_col { |
| 183 | @include horizontal-layout; |
| 184 | } |
| 185 | |
| 186 | // アイコンカードブロックを横並びに保つ |
| 187 | .wp-block-vk-blocks-icon-card { |
| 188 | @include horizontal-layout; |
| 189 | |
| 190 | .vk_icon-card_item, |
| 191 | .wp-block-vk-blocks-icon-card-item { |
| 192 | width: auto; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | // ギャラリーブロックを横並びに保つ |
| 197 | .wp-block-gallery { |
| 198 | @include horizontal-layout; |
| 199 | |
| 200 | .wp-block-image, |
| 201 | .wp-block-gallery-item { |
| 202 | flex-shrink: 0; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // ソーシャルリンクブロックを横並びに保つ |
| 207 | .wp-block-social-links { |
| 208 | @include horizontal-layout; |
| 209 | |
| 210 | .wp-social-link { |
| 211 | flex-shrink: 0; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | @mixin scrollable-group-editor { |
| 217 | overflow-x: auto; |
| 218 | -webkit-overflow-scrolling: touch; |
| 219 | box-sizing: border-box; |
| 220 | |
| 221 | @include scrollable-group-default-child-layout(false, false); |
| 222 | |
| 223 | // カラムブロックを横並びに保つ |
| 224 | &.wp-block-columns, |
| 225 | .wp-block-columns { |
| 226 | flex-wrap: nowrap; |
| 227 | align-items: stretch; |
| 228 | |
| 229 | .wp-block-column { |
| 230 | flex-shrink: 0; |
| 231 | |
| 232 | // カラム� |
| 233 | のすべての要素がコンテンツ� |
| 234 | に合わせる |
| 235 | > * { |
| 236 | max-width: 100%; |
| 237 | } |
| 238 | |
| 239 | // テキスト要素は特に最大� |
| 240 | を基準にする |
| 241 | > p, |
| 242 | > h1, |
| 243 | > h2, |
| 244 | > h3, |
| 245 | > h4, |
| 246 | > h5, |
| 247 | > h6 { |
| 248 | width: max-content; |
| 249 | max-width: 100%; |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | // テーブルモード以外の場合、各カラムがコンテンツ� |
| 255 | に応じた� |
| 256 | を持つようにする |
| 257 | &:not([data-table-mode="true"]) { |
| 258 | &.wp-block-columns, |
| 259 | .wp-block-columns { |
| 260 | .wp-block-column { |
| 261 | min-width: max-content; |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | // テキスト要素をnowrapにする(オプションが有効な場合のみ) |
| 267 | &[data-text-nowrap="true"]="true""] { |
| 268 | // グループ� |
| 269 | のすべてのテキスト要素 |
| 270 | #{$text-elements} { |
| 271 | white-space: nowrap; |
| 272 | } |
| 273 | |
| 274 | // 編集画面のリッチテキストエディタ用 |
| 275 | div[role="textbox"]="textbox""] { |
| 276 | white-space: nowrap !important; |
| 277 | } |
| 278 | |
| 279 | // カラムブロック� |
| 280 | のテキスト要素 |
| 281 | &.wp-block-columns, |
| 282 | .wp-block-columns { |
| 283 | .wp-block-column { |
| 284 | #{$text-elements} { |
| 285 | white-space: nowrap; |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | // グリッドカラムブロックを横並びに保つ |
| 292 | .vk_gridColumn { |
| 293 | flex-wrap: nowrap; |
| 294 | |
| 295 | .row { |
| 296 | flex-wrap: nowrap; |
| 297 | } |
| 298 | |
| 299 | > [class*="col-"]*="col-""], |
| 300 | [class*="col-"]*="col-""] { |
| 301 | flex-shrink: 0; |
| 302 | width: auto; |
| 303 | flex: none; |
| 304 | max-width: none; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | // グリッドカラムカードブロックを横並びに保つ |
| 309 | .vk_gridcolcard { |
| 310 | // インラインスタイルで設定されたgrid-template-columnsを上書き |
| 311 | grid-template-columns: none; |
| 312 | grid-auto-flow: column; |
| 313 | grid-auto-columns: max-content; |
| 314 | |
| 315 | > * { |
| 316 | flex-shrink: 0; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | // カードブロックを横並びに保つ |
| 321 | .vk_posts { |
| 322 | @include horizontal-layout; |
| 323 | |
| 324 | .wp-block-vk-blocks-card-item { |
| 325 | width: auto; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | // 横並びボタンブロックを横並びに保つ |
| 330 | .vk_buttons, |
| 331 | .vk_buttons_col { |
| 332 | @include horizontal-layout; |
| 333 | } |
| 334 | |
| 335 | // 横並びアイコンブロックを横並びに保つ |
| 336 | .vk_icons, |
| 337 | .vk_icons_col { |
| 338 | @include horizontal-layout; |
| 339 | } |
| 340 | |
| 341 | // アイコンカードブロックを横並びに保つ |
| 342 | .wp-block-vk-blocks-icon-card { |
| 343 | @include horizontal-layout; |
| 344 | |
| 345 | .vk_icon-card_item, |
| 346 | .wp-block-vk-blocks-icon-card-item { |
| 347 | width: auto; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // ギャラリーブロックを横並びに保つ |
| 352 | .wp-block-gallery { |
| 353 | @include horizontal-layout; |
| 354 | |
| 355 | .wp-block-image, |
| 356 | .wp-block-gallery-item { |
| 357 | flex-shrink: 0; |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | // ソーシャルリンクブロックを横並びに保つ |
| 362 | .wp-block-social-links { |
| 363 | @include horizontal-layout; |
| 364 | |
| 365 | .wp-social-link { |
| 366 | flex-shrink: 0; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | /* フロントエンド |
| 372 | /*-------------------------------------------*/ |
| 373 | .wp-block-group { |
| 374 | &.is-style-vk-group-scrollable { |
| 375 | |
| 376 | &[data-scroll-breakpoint="group-scrollable-mobile"]="group-scrollable-mobile""] { |
| 377 | @media (max-width: 575.98px) { |
| 378 | @include scrollable-group; |
| 379 | @include scrollbar-custom; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | &[data-scroll-breakpoint="group-scrollable-tablet"]="group-scrollable-tablet""] { |
| 384 | @media (max-width: 991.98px) { |
| 385 | @include scrollable-group; |
| 386 | @include scrollbar-custom; |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | &[data-scroll-breakpoint="group-scrollable-pc"]="group-scrollable-pc""] { |
| 391 | @include scrollable-group; |
| 392 | @include scrollbar-custom; |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | /* 編集画面 |
| 398 | /*-------------------------------------------*/ |
| 399 | .editor-styles-wrapper { |
| 400 | .wp-block-group { |
| 401 | &.is-style-vk-group-scrollable { |
| 402 | |
| 403 | &[data-scroll-breakpoint="group-scrollable-mobile"]="group-scrollable-mobile""] { |
| 404 | @media (max-width: 575.98px) { |
| 405 | @include scrollable-group-editor; |
| 406 | @include scrollbar-custom; |
| 407 | @include scrollbar-custom-editor-override; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | &[data-scroll-breakpoint="group-scrollable-tablet"]="group-scrollable-tablet""] { |
| 412 | @media (max-width: 991.98px) { |
| 413 | @include scrollable-group-editor; |
| 414 | @include scrollbar-custom; |
| 415 | @include scrollbar-custom-editor-override; |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | &[data-scroll-breakpoint="group-scrollable-pc"]="group-scrollable-pc""] { |
| 420 | @include scrollable-group-editor; |
| 421 | @include scrollbar-custom; |
| 422 | @include scrollbar-custom-editor-override; |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | |
| 428 |