- Timestamp:
- 11/12/2018 11:19:13 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
r43860 r43892 1 1 /* !Block styles */ 2 2 3 .entry-content > *, 4 .entry-summary > * { 3 .entry .entry-content > *, 4 .entry .entry-summary > * { 5 margin: 32px 0; 6 max-width: 100%; 7 5 8 @include postContentMaxWidth(); 6 9 7 margin: 32px $size__spacing-unit;8 9 10 @include media(tablet) { 10 margin: 32px calc(2 * (100vw / 12)); 11 } 12 /* 13 // Set top margins for headings 14 & + h1:before, 15 & + h2:before, 16 & + h3, 17 & + h4, 18 & + h5, 19 & + h6 { 20 margin-top: calc(4 * #{ $size__spacing-unit}); 21 } 22 */ 11 margin: 32px 0; 12 } 23 13 24 14 > *:first-child { … … 31 21 32 22 &.alignwide { 33 34 23 margin-left: auto; 35 24 margin-right: auto; 25 clear: both; 36 26 37 27 @include media(tablet) { 38 margin-left: calc(2 * (100vw / 12)); 39 margin-right: calc(2 * (100vw / 12)); 40 max-width: calc(8 * (100vw / 12)); 28 width: 100%; 29 max-width: 100%; 41 30 } 42 31 } 43 32 44 33 &.alignfull { 45 margin-top: calc(2 * #{$size__spacing-unit}); 46 margin-right: 0; 47 margin-bottom: calc(2 * #{$size__spacing-unit}); 48 margin-left: 0; 49 max-width: 100%; 34 position: relative; 35 left: -#{$size__spacing-unit }; 36 width: calc( 100% + (2 * #{$size__spacing-unit})); 37 max-width: calc( 100% + (2 * #{$size__spacing-unit})); 38 clear: both; 39 40 @include media(tablet) { 41 margin-top: calc(2 * #{$size__spacing-unit}); 42 margin-bottom: calc(2 * #{$size__spacing-unit}); 43 left: calc( -12.5% - 75px ); 44 width: calc( 125% + 150px ); 45 max-width: calc( 125% + 150px ); 46 } 50 47 } 51 48 52 49 &.alignleft { 50 /*rtl:ignore*/ 53 51 float: left; 54 52 max-width: calc(5 * (100vw / 12)); 55 53 margin-top: 0; 54 margin-left: 0; 55 /*rtl:ignore*/ 56 margin-right: $size__spacing-unit; 56 57 57 58 @include media(tablet) { 58 59 max-width: calc(4 * (100vw / 12)); 60 /*rtl:ignore*/ 59 61 margin-right: calc(2 * #{$size__spacing-unit}); 60 62 } … … 66 68 67 69 &.alignright { 70 /*rtl:ignore*/ 68 71 float: right; 69 72 max-width: calc(5 * (100vw / 12)); 70 73 margin-top: 0; 74 margin-right: 0; 75 /*rtl:ignore*/ 71 76 margin-left: $size__spacing-unit; 72 margin-right: $size__spacing-unit;73 77 74 78 @include media(tablet) { 75 79 max-width: calc(4 * (100vw / 12)); 80 margin-right: 0; 81 /*rtl:ignore*/ 76 82 margin-left: calc(2 * #{$size__spacing-unit}); 77 margin-right: calc(2 * (100vw / 12));78 83 } 79 84 } 80 85 &.aligncenter { 81 82 86 margin-left: auto; 83 87 margin-right: auto; 84 88 85 @include media(desktop) { 86 margin-left: calc(2 * (100vw / 12)); 87 margin-right: calc(2 * (100vw / 12)); 88 max-width: calc(10 * (100vw / 12)); 89 position: relative; 90 left: 25%; 91 transform: translate(-50%); 89 @include postContentMaxWidth(); 90 91 @include media(tablet) { 92 margin-left: 0; 93 margin-right: 0; 92 94 } 93 95 } 94 96 } 95 97 96 .entry-content { 98 /* 99 * Unset nested content selector styles 100 * - Prevents layout styles from cascading too deeply 101 * - helps with plugin compatibility 102 */ 103 .entry .entry-content, 104 .entry .entry-summary { 105 106 .entry-content, 107 .entry-summary, 108 .entry { 109 margin: inherit; 110 max-width: inherit; 111 padding: inherit; 112 113 @include media(tablet) { 114 margin: inherit; 115 max-width: inherit; 116 padding: inherit; 117 } 118 } 119 } 120 121 .entry .entry-content { 122 123 //! Paragraphs 124 p.has-background { 125 padding: 20px 30px; 126 } 97 127 98 128 //! Audio … … 108 138 &.alignright audio { 109 139 110 max-width: (0. 5* $mobile_width);140 max-width: (0.33 * $mobile_width); 111 141 112 142 @include media(tablet) { … … 152 182 153 183 &:hover { 184 background: $color__background-button-hover; 154 185 cursor: pointer; 155 186 } 156 187 157 &: hover, &:focus {188 &:focus { 158 189 background: $color__background-button-hover; 159 }160 161 &:focus {162 190 outline: thin dotted; 163 191 outline-offset: -4px; … … 197 225 font-weight: bold; 198 226 line-height: $font__line-height-heading; 199 200 &:not(.menu-item-has-children) { 201 padding-bottom: ( .75 * $size__spacing-unit ); 227 padding-bottom: ( .75 * $size__spacing-unit ); 228 229 &.menu-item-has-children, 230 &:last-child { 231 padding-bottom: 0; 202 232 } 203 233 … … 205 235 text-decoration: none; 206 236 } 207 208 ul { 209 padding-left: $size__spacing-unit; 210 } 211 } 237 } 238 } 239 240 //! Latest categories 241 .wp-block-categories { 242 243 ul { 244 padding-top: ( .75 * $size__spacing-unit ); 245 } 246 247 li ul { 248 list-style: none; 249 padding-left: 0; 250 } 251 252 @include nestedSubMenuPadding(); 212 253 } 213 254 … … 265 306 color: $color__text-main; 266 307 border: none; 267 padding-bottom: calc(2 * #{$size__spacing-unit}); 308 margin-top: calc(4 * #{ $size__spacing-unit}); 309 margin-bottom: calc(4.33 * #{ $size__spacing-unit}); 268 310 margin-right: 0; 269 311 } … … 288 330 display: inline-block; 289 331 font-family: $font__heading; 290 font-size: $font__size-xs;291 332 line-height: 1.6; 292 333 text-transform: none; 334 color: $color__text-light; 335 336 /* 337 * This requires a rem-based font size calculation instead of our normal em-based one, 338 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 339 */ 340 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 293 341 } 294 342 295 343 &.alignleft, 296 344 &.alignright { 345 width: 100%; 297 346 padding: 0; 298 347 … … 306 355 307 356 &.is-style-solid-color { 308 309 357 background-color: $color__link; 358 padding-left: 0; 359 padding-right: 0; 360 361 @include media(tablet) { 362 padding-left: 10%; 363 padding-right: 10%; 364 } 310 365 311 366 p { … … 324 379 } 325 380 381 cite { 382 color: inherit; 383 } 384 326 385 blockquote { 386 max-width: calc(100% - (2 * #{$size__spacing-unit})); 327 387 color: $color__background-body; 328 margin: 0 auto; 388 padding-left: 0; 389 margin-left: $size__spacing-unit; 390 391 @include media(tablet) { 392 margin-left: 0; 393 margin-right: 0; 394 } 329 395 } 330 396 … … 333 399 } 334 400 335 &.alignleft, 336 &.alignright { 337 padding: $size__spacing-unit $size__spacing-unit 0; 338 339 blockquote { 340 padding: 0 0 calc( 1.5 * #{$size__spacing-unit} ); 341 margin-left: 0; 342 margin-top: 0; 343 } 401 &.alignfull { 344 402 345 403 @include media(tablet) { 346 padding: calc( 2 * #{$size__spacing-unit} ) calc( 2 * #{$size__spacing-unit} ) $size__spacing-unit; 404 padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); 405 padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); 347 406 } 348 407 } … … 367 426 368 427 cite { 369 font-size: $font__size-xs; 428 /* 429 * This requires a rem-based font size calculation instead of our normal em-based one, 430 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 431 */ 432 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 370 433 } 371 434 372 435 &.is-large, 373 436 &.is-style-large { 374 padding: $size__spacing-unit 0 ($size__spacing-unit) ($size__spacing-unit * 2);375 437 margin: $size__spacing-unit 0; 438 padding: 0; 376 439 border-left: none; 377 440 … … 384 447 cite, 385 448 footer { 386 font-size: $font__size-xs; 449 /* 450 * This requires a rem-based font size calculation instead of our normal em-based one, 451 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 452 */ 453 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 387 454 } 388 455 389 456 @include media(tablet) { 390 391 margin: $size__spacing-unit calc(2 * (100vw / 12)); 392 max-width: calc(6 * (100vw / 12)); 457 margin: $size__spacing-unit 0; 458 padding: $size__spacing-unit 0; 393 459 394 460 p { … … 413 479 &.alignfull img { 414 480 width: 100vw; 415 margin-left: auto; 416 margin-right: auto; 481 482 @include media(tablet) { 483 margin-left: auto; 484 margin-right: auto; 485 } 417 486 } 418 487 } … … 421 490 .wp-block-cover-image, 422 491 .wp-block-cover { 492 position: relative; 493 min-height: 430px; 494 padding: $size__spacing-unit; 495 496 @include media(tablet) { 497 padding: $size__spacing-unit 10%; 498 } 423 499 424 500 .wp-block-cover-image-text, … … 428 504 font-size: $font__size-lg; 429 505 font-weight: bold; 430 431 width: calc(100vw - (2 * #{ $size__spacing-unit }));432 max-width: calc(100vw - (2 * #{ $size__spacing-unit }));506 line-height: 1.25; 507 padding: 0; 508 color: #fff; 433 509 434 510 @include media(tablet) { 435 511 font-size: $font__size-xl; 436 width: calc(8 * (100vw / 12)); 437 max-width: calc(8 * (100vw / 12)); 438 } 439 440 @include media(desktop) { 441 width: calc(6 * (100vw / 12 )); 442 max-width: calc(6 * (100vw / 12 )); 443 } 444 } 445 446 &.alignleft, 447 &.alignright, 512 max-width: 100%; 513 } 514 } 515 448 516 &.aligncenter { 449 517 h2, … … 459 527 } 460 528 461 &.aligncenter { 462 margin: 32px calc(2 * (100vw / 12)); 463 max-width: calc(6 * (100vw / 12)); 464 } 465 466 &.has-left-content { 467 justify-content: center; 468 469 h2, 529 &.alignleft, 530 &.alignright { 531 width: 100%; 532 } 533 534 &.alignfull { 535 470 536 .wp-block-cover-image-text, 471 .wp-block-cover-text { 472 padding: $size__spacing-unit; 473 } 474 } 475 476 &.has-right-content { 477 justify-content: center; 478 479 h2, 480 .wp-block-cover-image-text, 481 .wp-block-cover-text { 482 padding: $size__spacing-unit; 537 .wp-block-cover-text, 538 h2 { 539 @include postContentMaxWidth(); 540 } 541 542 @include media(tablet) { 543 padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); 544 padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); 545 546 .wp-block-cover-image-text, 547 .wp-block-cover-text, 548 h2 { 549 padding: 0; 550 } 483 551 } 484 552 } … … 486 554 487 555 //! Galleries 488 .wp-block-gallery .blocks-gallery-image:last-child, 489 .wp-block-gallery .blocks-gallery-item:last-child { 490 margin-bottom: 16px; 556 .wp-block-gallery { 557 list-style-type: none; 558 padding-left: 0; 559 560 .blocks-gallery-image:last-child, 561 .blocks-gallery-item:last-child { 562 margin-bottom: 16px; 563 } 491 564 } 492 565 … … 508 581 .wp-block-separator, 509 582 hr { 583 background-color: $color__text-light; 584 border: 0; 585 height: 2px; 510 586 margin-bottom: (2 * $size__spacing-unit); 511 587 margin-top: (2 * $size__spacing-unit); 588 max-width: 2.25em; 512 589 text-align: left; 513 590 514 &:not(.is-style-dots) { 515 background-color: $color__text-light; 516 border: 0; 517 height: 2px; 518 } 519 520 &:not(.is-style-wide):not(.is-style-dots) { 521 max-width: 2.25em; 522 } 523 524 /* Remove duplicate rule-line when a separator 525 * is followed by an H1, or H2 */ 526 & + h1, 527 & + h2 { 528 529 &:before { 530 display: none; 531 } 591 &.is-style-wide { 592 max-width: 100%; 593 @include postContentMaxWidth(); 532 594 } 533 595 534 596 &.is-style-dots { 597 max-width: 100%; 535 598 @include postContentMaxWidth(); 599 background-color: inherit; 600 border: inherit; 601 height: inherit; 536 602 text-align: center; 537 603 … … 543 609 } 544 610 } 611 612 /* Remove duplicate rule-line when a separator 613 * is followed by an H1, or H2 */ 614 & + h1, 615 & + h2 { 616 617 &:before { 618 display: none; 619 } 620 } 545 621 } 546 622 … … 553 629 .wp-block-table { 554 630 555 td, th { 631 th, 632 td { 556 633 border-color: $color__text-light; 557 634 } … … 570 647 font-family: $font__heading; 571 648 line-height: $font__line-height-heading; 649 text-decoration: none; 572 650 font-weight: bold; 573 651 padding: ($size__spacing-unit * .75) $size__spacing-unit; 652 color: #fff; 574 653 575 654 @include media(desktop) { … … 579 658 580 659 &:hover { 660 background: $color__background-button-hover; 581 661 cursor: pointer; 582 662 } 583 663 584 &: hover, &:focus {664 &:focus { 585 665 background: $color__background-button-hover; 586 }587 588 &:focus {589 666 outline: thin dotted; 590 667 outline-offset: -4px; 591 668 } 669 } 670 671 * + .wp-block-file__button { 672 margin-left: ($size__spacing-unit * .75); 592 673 } 593 674 } … … 607 688 .wp-block-columns { 608 689 609 .wp-block-column > * { 610 611 &:first-child { 612 margin-top: 0; 613 } 614 615 &:last-child { 616 margin-bottom: 0; 617 } 618 } 619 620 &[class*='has-'] > * { 621 margin-right: $size__spacing-unit; 622 623 &:last-child { 624 margin-right: 0; 690 @include media(tablet) { 691 .wp-block-column > * { 692 693 &:first-child { 694 margin-top: 0; 695 } 696 697 &:last-child { 698 margin-bottom: 0; 699 } 700 } 701 702 &[class*='has-'] > * { 703 margin-right: $size__spacing-unit; 704 705 &:last-child { 706 margin-right: 0; 707 } 625 708 } 626 709 }
Note: See TracChangeset
for help on using the changeset viewer.