- Timestamp:
- 12/14/2018 02:32:33 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963
- Property svn:mergeinfo changed
-
trunk/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
r43808 r44149 1 1 /* !Block styles */ 2 2 3 .entry-content > *, 4 .entry-summary > * { 5 6 margin: 32px $size__spacing-unit; 7 max-width: calc(100vw - (2 * #{ $size__spacing-unit })); 3 .entry .entry-content > *, 4 .entry .entry-summary > * { 5 margin: 32px 0; 6 max-width: 100%; 7 8 @include postContentMaxWidth(); 8 9 9 10 @include media(tablet) { 10 margin: 32px calc(2 * (100vw / 12)); 11 max-width: calc(8 * (100vw / 12)); 12 } 13 14 @include media(desktop) { 15 max-width: calc(6 * (100vw / 12)); 16 } 17 18 /* 19 // Set top margins for headings 20 & + h1:before, 21 & + h2:before, 22 & + h3, 23 & + h4, 24 & + h5, 25 & + h6 { 26 margin-top: calc(4 * #{ $size__spacing-unit}); 27 } 28 */ 11 margin: 32px 0; 12 } 29 13 30 14 > *:first-child { … … 37 21 38 22 &.alignwide { 39 40 23 margin-left: auto; 41 24 margin-right: auto; 25 clear: both; 42 26 43 27 @include media(tablet) { 44 margin-left: calc(1 * (100vw / 12)); 45 margin-right: calc(1 * (100vw / 12)); 46 max-width: calc(10 * (100vw / 12)); 28 width: 100%; 29 max-width: 100%; 47 30 } 48 31 } 49 32 50 33 &.alignfull { 51 margin-top: calc(2 * #{$size__spacing-unit}); 52 margin-right: 0; 53 margin-bottom: calc(2 * #{$size__spacing-unit}); 54 margin-left: 0; 55 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 } 56 47 } 57 48 58 49 &.alignleft { 50 /*rtl:ignore*/ 59 51 float: left; 60 52 max-width: calc(5 * (100vw / 12)); 61 53 margin-top: 0; 54 margin-left: 0; 55 /*rtl:ignore*/ 56 margin-right: $size__spacing-unit; 62 57 63 58 @include media(tablet) { 64 59 max-width: calc(4 * (100vw / 12)); 60 /*rtl:ignore*/ 65 61 margin-right: calc(2 * #{$size__spacing-unit}); 66 62 } 67 68 @include media(desktop) {69 max-width: calc(3 * (100vw / 12));70 }71 63 } 72 64 73 65 &.alignright { 66 /*rtl:ignore*/ 74 67 float: right; 75 68 max-width: calc(5 * (100vw / 12)); 76 69 margin-top: 0; 70 margin-right: 0; 71 /*rtl:ignore*/ 77 72 margin-left: $size__spacing-unit; 78 margin-right: $size__spacing-unit;79 73 80 74 @include media(tablet) { 81 75 max-width: calc(4 * (100vw / 12)); 76 margin-right: 0; 77 /*rtl:ignore*/ 82 78 margin-left: calc(2 * #{$size__spacing-unit}); 83 margin-right: calc(2 * (100vw / 12)); 79 } 80 } 81 &.aligncenter { 82 margin-left: auto; 83 margin-right: auto; 84 85 @include postContentMaxWidth(); 86 87 @include media(tablet) { 88 margin-left: 0; 89 margin-right: 0; 84 90 } 85 91 } 86 92 } 87 93 88 .entry-content { 94 /* 95 * Unset nested content selector styles 96 * - Prevents layout styles from cascading too deeply 97 * - helps with plugin compatibility 98 */ 99 .entry .entry-content, 100 .entry .entry-summary { 101 102 .entry-content, 103 .entry-summary, 104 .entry { 105 margin: inherit; 106 max-width: inherit; 107 padding: inherit; 108 109 @include media(tablet) { 110 margin: inherit; 111 max-width: inherit; 112 padding: inherit; 113 } 114 } 115 } 116 117 .entry .entry-content { 118 119 //! Paragraphs 120 p.has-background { 121 padding: 20px 30px; 122 } 89 123 90 124 //! Audio … … 100 134 &.alignright audio { 101 135 102 max-width: (0. 5* $mobile_width);136 max-width: (0.33 * $mobile_width); 103 137 104 138 @include media(tablet) { … … 126 160 @include button-transition; 127 161 border: none; 128 background: $color__background-button;129 162 font-size: $font__size-sm; 130 163 font-family: $font__heading; … … 132 165 box-sizing: border-box; 133 166 font-weight: bold; 134 padding: ($size__spacing-unit * .66) $size__spacing-unit; 167 text-decoration: none; 168 padding: ($size__spacing-unit * .76) $size__spacing-unit; 135 169 outline: none; 136 color: white;137 170 outline: none; 138 171 172 &:not(.has-background) { 173 background-color: $color__background-button; 174 } 175 176 &:not(.has-text-color) { 177 color: white; 178 } 179 139 180 &:hover { 181 color: white; 182 background: $color__background-button-hover; 140 183 cursor: pointer; 141 184 } 142 185 143 &:hover, &:focus { 186 &:focus { 187 color: white; 144 188 background: $color__background-button-hover; 145 }146 147 &:focus {148 189 outline: thin dotted; 149 190 outline-offset: -4px; … … 158 199 &.is-style-outline .wp-block-button__link:focus, 159 200 &.is-style-outline .wp-block-button__link:active { 160 161 @include button-all-transition; 162 background: transparent; 163 border: 2px solid $color__background-button; 201 @include button-all-transition; 202 border-width: 2px; 203 border-style: solid; 204 205 &:not(.has-background) { 206 background: transparent; 207 } 164 208 165 209 &:not(.has-text-color) { 166 210 color: $color__background-button; 211 border-color: currentColor; 167 212 } 168 213 } 169 214 170 215 &.is-style-outline .wp-block-button__link:hover { 216 color: white; 171 217 border-color: $color__background-button-hover; 172 color: $color__background-button-hover;173 218 } 174 219 } … … 184 229 color: $color__text-light; 185 230 font-family: $font__heading; 186 font-size: calc(#{$font__size_base} * #{$font__size- lg / 1em});231 font-size: calc(#{$font__size_base} * #{$font__size-ratio}); 187 232 font-weight: bold; 188 233 line-height: $font__line-height-heading; 189 190 a:after { 191 color: $color__text-light; 192 content: ","; 193 } 194 195 &:last-child a:after { 196 color: $color__text-light; 197 content: "."; 198 } 199 } 234 padding-bottom: ( .75 * $size__spacing-unit ); 235 236 &.menu-item-has-children, 237 &:last-child { 238 padding-bottom: 0; 239 } 240 241 a { 242 text-decoration: none; 243 } 244 } 245 } 246 247 //! Latest categories 248 .wp-block-categories { 249 250 ul { 251 padding-top: ( .75 * $size__spacing-unit ); 252 } 253 254 li ul { 255 list-style: none; 256 padding-left: 0; 257 } 258 259 @include nestedSubMenuPadding(); 200 260 } 201 261 … … 234 294 } 235 295 236 // !Paragraphs296 //! Paragraphs 237 297 .has-drop-cap { 238 298 &:not(:focus):first-letter { … … 245 305 } 246 306 247 // !Pullquote307 //! Pullquote 248 308 .wp-block-pullquote { 249 border: none; 309 border-color: transparent; 310 border-width: 2px; 250 311 padding: $size__spacing-unit; 251 312 252 313 blockquote { 314 color: $color__text-main; 253 315 border: none; 254 padding-bottom: calc(2 * #{$size__spacing-unit}); 316 margin-top: calc(4 * #{ $size__spacing-unit}); 317 margin-bottom: calc(4.33 * #{ $size__spacing-unit}); 255 318 margin-right: 0; 256 319 } … … 262 325 margin-bottom: 0.5em; 263 326 margin-top: 0.5em; 264 color: $color__text-main;265 327 266 328 em { … … 276 338 display: inline-block; 277 339 font-family: $font__heading; 278 font-size: $font__size-xs;279 340 line-height: 1.6; 280 341 text-transform: none; 281 342 color: $color__text-light; 343 344 /* 345 * This requires a rem-based font size calculation instead of our normal em-based one, 346 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 347 */ 348 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 282 349 } 283 350 284 351 &.alignleft, 285 352 &.alignright { 353 width: 100%; 286 354 padding: 0; 287 355 … … 295 363 296 364 &.is-style-solid-color { 365 background-color: $color__link; 366 padding-left: 0; 367 padding-right: 0; 368 369 @include media(tablet) { 370 padding-left: 10%; 371 padding-right: 10%; 372 } 297 373 298 374 p { … … 307 383 } 308 384 385 a { 386 color: $color__background-body; 387 } 388 389 cite { 390 color: inherit; 391 } 392 309 393 blockquote { 310 margin: 0 auto; 311 } 312 313 blockquote:not(.has-text-color) p, 314 cite { 315 color: white; 316 } 317 318 &:not(.has-background-color) { 319 background-color: $color__link; 320 } 321 322 &.alignleft, 323 &.alignright { 324 padding: $size__spacing-unit $size__spacing-unit 0; 325 326 blockquote { 327 padding: 0 0 calc( 1.5 * #{$size__spacing-unit} ); 394 max-width: calc(100% - (2 * #{$size__spacing-unit})); 395 color: $color__background-body; 396 padding-left: 0; 397 margin-left: $size__spacing-unit; 398 399 &.has-text-color p, 400 &.has-text-color a, 401 &.has-primary-color, 402 &.has-secondary-color, 403 &.has-dark-gray-color, 404 &.has-light-gray-color, 405 &.has-white-color { 406 color: inherit; 407 } 408 409 @include media(tablet) { 328 410 margin-left: 0; 329 margin-top: 0; 330 } 411 margin-right: 0; 412 } 413 } 414 415 &.alignfull { 331 416 332 417 @include media(tablet) { 333 padding: calc( 2 * #{$size__spacing-unit} ) calc( 2 * #{$size__spacing-unit} ) $size__spacing-unit; 418 padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); 419 padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); 334 420 } 335 421 } … … 354 440 355 441 cite { 356 font-size: $font__size-xs; 442 /* 443 * This requires a rem-based font size calculation instead of our normal em-based one, 444 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 445 */ 446 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 357 447 } 358 448 359 449 &.is-large, 360 450 &.is-style-large { 361 padding: $size__spacing-unit 0 ($size__spacing-unit) ($size__spacing-unit * 2);362 451 margin: $size__spacing-unit 0; 452 padding: 0; 363 453 border-left: none; 364 454 … … 371 461 cite, 372 462 footer { 373 font-size: $font__size-xs; 463 /* 464 * This requires a rem-based font size calculation instead of our normal em-based one, 465 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. 466 */ 467 font-size: calc(1rem / (1.25 * #{$font__size-ratio})); 374 468 } 375 469 376 470 @include media(tablet) { 377 378 margin: $size__spacing-unit calc(2 * (100vw / 12)); 379 max-width: calc(6 * (100vw / 12)); 471 margin: $size__spacing-unit 0; 472 padding: $size__spacing-unit 0; 380 473 381 474 p { … … 400 493 &.alignfull img { 401 494 width: 100vw; 402 margin-left: auto; 403 margin-right: auto; 495 496 @include media(tablet) { 497 margin-left: auto; 498 margin-right: auto; 499 } 404 500 } 405 501 } 406 502 407 503 //! Cover Image 408 .wp-block-cover-image { 504 .wp-block-cover-image, 505 .wp-block-cover { 506 position: relative; 507 min-height: 430px; 508 padding: $size__spacing-unit; 509 510 @include media(tablet) { 511 padding: $size__spacing-unit 10%; 512 } 409 513 410 514 .wp-block-cover-image-text, 515 .wp-block-cover-text, 411 516 h2 { 412 517 font-family: $font__heading; 413 518 font-size: $font__size-lg; 414 519 font-weight: bold; 415 416 width: calc(100vw - (2 * #{ $size__spacing-unit })); 417 max-width: calc(100vw - (2 * #{ $size__spacing-unit })); 520 line-height: 1.25; 521 padding: 0; 522 color: #fff; 523 -ms-hyphens: auto; 524 -moz-hyphens: auto; 525 -webkit-hyphens: auto; 526 hyphens: auto; 418 527 419 528 @include media(tablet) { 420 529 font-size: $font__size-xl; 421 width: calc(8 * (100vw / 12)); 422 max-width: calc(8 * (100vw / 12)); 423 } 424 425 @include media(desktop) { 426 width: calc(6 * (100vw / 12 )); 427 max-width: calc(6 * (100vw / 12 )); 530 max-width: 100%; 428 531 } 429 532 } 430 533 431 534 &.alignleft, 432 &.alignright, 433 &.aligncenter { 434 h2, 435 .wp-block-cover-image-text { 436 width: 100%; 437 z-index: 1; 438 left: 50%; 439 position: absolute; 440 transform: translate(-50%, -50%); 441 top: 50%; 442 } 443 } 444 445 &.has-left-content { 446 justify-content: center; 447 448 h2, 449 .wp-block-cover-image-text { 535 &.alignright { 536 width: 100%; 537 538 @include media(tablet) { 450 539 padding: $size__spacing-unit; 451 540 } 452 541 } 453 542 454 &.has-right-content { 455 justify-content: center; 456 457 h2, 458 .wp-block-cover-image-text { 459 padding: $size__spacing-unit; 543 &.alignfull { 544 545 .wp-block-cover-image-text, 546 .wp-block-cover-text, 547 h2 { 548 @include postContentMaxWidth(); 549 } 550 551 @include media(tablet) { 552 padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); 553 padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); 554 555 .wp-block-cover-image-text, 556 .wp-block-cover-text, 557 h2 { 558 padding: 0; 559 } 460 560 } 461 561 } … … 463 563 464 564 //! Galleries 465 .wp-block-gallery .blocks-gallery-image:last-child, 466 .wp-block-gallery .blocks-gallery-item:last-child { 467 margin-bottom: 16px; 565 .wp-block-gallery { 566 list-style-type: none; 567 padding-left: 0; 568 569 .blocks-gallery-image:last-child, 570 .blocks-gallery-item:last-child { 571 margin-bottom: 16px; 572 } 468 573 } 469 574 … … 479 584 margin: 0; 480 585 padding: ( $size__spacing-unit * .5 ); 481 text-align: left;586 text-align: center; 482 587 } 483 588 … … 485 590 .wp-block-separator, 486 591 hr { 592 background-color: $color__text-light; 593 border: 0; 594 height: 2px; 487 595 margin-bottom: (2 * $size__spacing-unit); 488 596 margin-top: (2 * $size__spacing-unit); 489 490 &:not(.is-style-dots) { 491 background-color: $color__text-light; 492 border: 0; 493 height: 2px; 494 } 495 496 &:not(.is-style-wide):not(.is-style-dots) { 497 max-width: 2.25em; 597 max-width: 2.25em; 598 text-align: left; 599 600 &.is-style-wide { 601 max-width: 100%; 602 @include postContentMaxWidth(); 603 } 604 605 &.is-style-dots { 606 max-width: 100%; 607 @include postContentMaxWidth(); 608 background-color: inherit; 609 border: inherit; 610 height: inherit; 611 text-align: center; 612 613 &:before { 614 color: $color__text-light; 615 font-size: $font__size-lg; 616 letter-spacing: $font__size-sm; 617 padding-left: $font__size-sm; 618 } 498 619 } 499 620 … … 507 628 } 508 629 } 509 510 &.is-style-dots:before {511 color: $color__text-light;512 font-size: $font__size-lg;513 letter-spacing: $font__size-sm;514 padding-left: $font__size-sm;515 }516 630 } 517 631 518 632 //! Twitter Embed 519 633 .wp-block-embed-twitter { 520 overflow: hidden;634 word-break: break-word; 521 635 } 522 636 … … 524 638 .wp-block-table { 525 639 526 td, th { 640 th, 641 td { 527 642 border-color: $color__text-light; 528 643 } … … 534 649 535 650 .wp-block-file__button { 651 display: table; 536 652 @include button-transition; 537 653 border: none; … … 541 657 font-family: $font__heading; 542 658 line-height: $font__line-height-heading; 659 text-decoration: none; 543 660 font-weight: bold; 544 661 padding: ($size__spacing-unit * .75) $size__spacing-unit; 662 color: #fff; 663 margin-left: 0; 664 margin-top: calc(0.75 * #{$size__spacing-unit}); 545 665 546 666 @include media(desktop) { … … 550 670 551 671 &:hover { 672 background: $color__background-button-hover; 552 673 cursor: pointer; 553 674 } 554 675 555 &: hover, &:focus {676 &:focus { 556 677 background: $color__background-button-hover; 557 }558 559 &:focus {560 678 outline: thin dotted; 561 679 outline-offset: -4px; … … 570 688 code { 571 689 font-size: $font__size-md; 690 white-space: pre-wrap; 691 word-break: break-word; 572 692 } 573 693 } … … 576 696 .wp-block-columns { 577 697 578 .wp-block-column > * { 579 580 &:first-child { 581 margin-top: 0; 582 } 583 584 &:last-child { 585 margin-bottom: 0; 586 } 587 } 588 589 &[class*='has-'] > * { 590 margin-right: $size__spacing-unit; 591 592 &:last-child { 593 margin-right: 0; 698 &.alignfull { 699 padding-left: $size__spacing-unit; 700 padding-right: $size__spacing-unit; 701 } 702 703 @include media(tablet) { 704 .wp-block-column > * { 705 706 &:first-child { 707 margin-top: 0; 708 } 709 710 &:last-child { 711 margin-bottom: 0; 712 } 713 } 714 715 &[class*='has-'] > * { 716 margin-right: $size__spacing-unit; 717 718 &:last-child { 719 margin-right: 0; 720 } 721 } 722 723 &.alignfull, 724 &.alignfull .wp-block-column { 725 padding-left: calc(2 * #{$size__spacing-unit}); 726 padding-right: calc(2 * #{$size__spacing-unit}); 594 727 } 595 728 } … … 629 762 } 630 763 } 764 765 //! Font Sizes 766 .has-small-font-size { 767 font-size: $font__size-sm; 768 } 769 770 .has-normal-font-size { 771 font-size: $font__size-md; 772 } 773 774 .has-large-font-size { 775 font-size: $font__size-lg; 776 } 777 778 .has-huge-font-size { 779 font-size: $font__size-xl; 780 } 781 782 //! Custom background colors 783 .has-primary-background-color, 784 .has-secondary-background-color, 785 .has-dark-gray-background-color, 786 .has-light-gray-background-color { 787 788 // Use white text against these backgrounds by default. 789 color: $color__background-body; 790 791 p, 792 h1, 793 h2, 794 h3, 795 h4, 796 h5, 797 h6, 798 a { 799 color: $color__background-body; 800 } 801 } 802 803 .has-white-background-color { 804 color: $color__text-main; 805 806 // Use dark gray text against this background by default. 807 p, 808 h1, 809 h2, 810 h3, 811 h4, 812 h5, 813 h6, 814 a { 815 color: $color__text-main; 816 } 817 } 818 819 .has-primary-background-color, 820 .wp-block-pullquote.is-style-solid-color.has-primary-background-color { 821 background-color: $color__link; 822 } 823 824 .has-secondary-background-color, 825 .wp-block-pullquote.is-style-solid-color.has-secondary-background-color { 826 background-color: $color__border-link-hover; 827 } 828 829 .has-dark-gray-background-color, 830 .wp-block-pullquote.is-style-solid-color.has-dark-gray-background-color { 831 background-color: $color__text-main; 832 } 833 834 .has-light-gray-background-color, 835 .wp-block-pullquote.is-style-solid-color.has-light-gray-background-color { 836 background-color: $color__text-light; 837 } 838 839 .has-white-background-color, 840 .wp-block-pullquote.is-style-solid-color.has-white-background-color { 841 background-color: #FFF; 842 } 843 844 //! Custom foreground colors 845 .has-primary-color, 846 .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, 847 .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p { 848 color: $color__link; 849 } 850 851 .has-secondary-color, 852 .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, 853 .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p { 854 color: $color__border-link-hover; 855 } 856 857 .has-dark-gray-color, 858 .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, 859 .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p { 860 color: $color__text-main; 861 } 862 863 .has-light-gray-color, 864 .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, 865 .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p { 866 color: $color__text-light; 867 } 868 869 .has-white-color, 870 .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { 871 color: #FFF; 872 } 631 873 }
Note: See TracChangeset
for help on using the changeset viewer.