- 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/style-editor.scss
r43808 r44149 1 1 /*! 2 2 Twenty Nineteen Editor Styles 3 4 NOTE: Styling alignment styles require use of [data-align] selectors.5 This is not ideal, but it works. Styles using those selectors should be refactored6 when Gutenberg supports styling those variations more intuitively.7 3 */ 8 4 … … 10 6 11 7 @import "sass/variables-site/variables-site"; 12 @import "sass/variables-site/colors";13 8 @import "sass/mixins/mixins-master"; 9 10 /** === Editor Frame === */ 11 12 body { 13 14 .wp-block[data-align="full"] { 15 width: 100%; 16 } 17 18 @include media(mobile) { 19 20 .wp-block[data-align="full"] { 21 width: calc( 100% + 90px ); 22 max-width: calc( 100% + 90px ); 23 } 24 } 25 26 @include media(tablet) { 27 28 .editor-writing-flow { 29 max-width: 80%; 30 margin: 0 10%; 31 } 32 33 .editor-post-title__block, 34 .editor-default-block-appender, 35 .editor-block-list__block { 36 margin-left: 0; 37 margin-right: 0; 38 } 39 40 .wp-block[data-align="wide"] { 41 width: 100%; 42 } 43 44 .wp-block[data-align="full"] { 45 position: relative; 46 left: calc( -12.5% - 14px ); 47 width: calc( 125% + 116px ); 48 max-width: calc( 125% + 115px ); // Subtract 1px here to avoid the rounding errors that happen due to the usage of percentages. 49 } 50 51 .wp-block[data-align="right"] { 52 max-width: 125%; 53 } 54 } 55 } 56 57 /** === Editor Block Toolbar Position === */ 58 59 // Since 2019 left-aligns wide and fullwide blocks, left align the toolbar too. 60 .editor-block-list__block[data-align="wide"] .editor-block-contextual-toolbar .editor-block-toolbar.editor-block-toolbar, 61 .editor-block-list__block[data-align="full"] .editor-block-contextual-toolbar .editor-block-toolbar.editor-block-toolbar { 62 max-width: none; 63 } 14 64 15 65 /** === Content Width === */ … … 17 67 .wp-block { 18 68 width: calc(100vw - (2 * #{$size__spacing-unit})); 69 max-width: 100%; 19 70 20 71 @include media(tablet) { … … 24 75 @include media(desktop) { 25 76 width: calc(6 * (100vw / 12 )); 77 } 78 79 // Only the top level blocks need specific widths, therefore override for every nested block. 80 .wp-block { 81 width: 100%; 26 82 } 27 83 } … … 32 88 font-size: $font__size_base; 33 89 font-family: $font__body; 90 line-height: $font__line-height-body; 34 91 color: $color__text-main; 35 92 } … … 46 103 h6 { 47 104 font-family: $font__heading; 105 font-weight: 700; 48 106 } 49 107 … … 100 158 outline: 0; 101 159 text-decoration: underline; 160 } 161 } 162 163 // Use white text against these backgrounds by default. 164 .has-primary-background-color, 165 .has-secondary-background-color, 166 .has-dark-gray-background-color, 167 .has-light-gray-background-color { 168 color: $color__background-body; 169 170 p, 171 h1, 172 h2, 173 h3, 174 h4, 175 h5, 176 h6, 177 a { 178 color: $color__background-body; 179 } 180 } 181 182 // Use dark gray text against this background by default. 183 .has-white-background-color { 184 color: $color__text-main; 185 186 p, 187 h1, 188 h2, 189 h3, 190 h4, 191 h5, 192 h6, 193 a { 194 color: $color__text-main; 102 195 } 103 196 } … … 111 204 } 112 205 206 /** === Post Title === */ 207 208 .editor-post-title__block { 209 @include post-section-dash; 210 211 &:before { 212 width: $font__size-xxl; 213 margin-top: 0; 214 margin-bottom: 0; 215 margin-left: 1em; 216 position: relative; 217 top: 0.5em; 218 } 219 220 .editor-post-title__input { 221 font-family: $font__heading; 222 font-size: $font__size-xxl; 223 font-weight: 700; 224 } 225 } 226 227 /** === Default Appender === */ 228 229 .editor-default-block-appender .editor-default-block-appender__content { 230 font-family: $font__body; 231 font-size: $font__size_base; 232 } 233 234 /** === Heading === */ 235 236 .wp-block-heading { 237 strong { 238 font-weight: bolder; 239 } 240 } 113 241 /** === Paragraph === */ 114 242 … … 124 252 } 125 253 126 /** === Cover Image === */ 127 128 .wp-block-cover-image { 254 /** === Table === */ 255 256 .wp-block-table { 257 font-family: $font__heading; 258 } 259 260 /** === Cover === */ 261 262 .wp-block-cover { 129 263 130 264 h2, 131 .wp-block-cover- image-text {265 .wp-block-cover-text { 132 266 font-family: $font__heading; 133 font-size: $font__size- xl;267 font-size: $font__size-lg; 134 268 font-weight: bold; 135 269 line-height: 1.4; 136 } 137 138 &.has-left-content { 139 justify-content: center; 270 padding-left: $size__spacing-unit; 271 padding-right: $size__spacing-unit; 272 273 strong { 274 font-weight: bolder; 275 } 276 277 @include media(tablet) { 278 margin-left: auto; 279 margin-right: auto; 280 padding: 0; 281 } 282 } 283 284 @include media(tablet) { 285 padding-left: 10%; 286 padding-right: 10%; 140 287 141 288 h2, 142 .wp-block-cover-image-text { 143 padding: 1em; 144 } 145 } 146 147 &.has-right-content { 148 justify-content: center; 289 .wp-block-cover-text { 290 font-size: $font__size-xl; 291 } 292 } 293 } 294 295 .wp-block[data-type="core/cover"][data-align="left"], 296 .wp-block[data-type="core/cover"][data-align="right"] { 297 298 .editor-block-list__block-edit { 299 width: calc(4 * (100vw / 12)); 300 } 301 302 .wp-block-cover { 303 width: 100%; 304 max-width: 100%; 305 } 306 307 @include media(tablet) { 308 309 .wp-block-cover { 310 padding: $size__spacing-unit; 311 } 312 } 313 } 314 315 .wp-block[data-type="core/cover"][data-align="wide"], 316 .wp-block[data-type="core/cover"][data-align="full"] { 317 318 @include media(tablet) { 149 319 150 320 h2, 151 .wp-block-cover-image-text { 152 padding: 1em; 153 } 154 } 155 } 156 157 body[data-type="core/cover-image"][data-align="left"], 158 body[data-type="core/cover-image"][data-align="right"] { 159 160 h2, 161 .wp-block-cover-image-text { 162 width: 100%; 163 max-width: 305px; 164 } 165 } 166 167 body[data-type="core/cover-image"][data-align="wide"], 168 body[data-type="core/cover-image"][data-align="full"] { 321 .wp-block-cover-text { 322 max-width: calc(8 * (100vw / 12)); 323 } 324 } 169 325 170 326 @include media(desktop) { 327 171 328 h2, 172 .wp-block-cover-image-text { 173 padding: 0; 174 width: calc(6 * (100vw / 12)); 329 .wp-block-cover-text { 175 330 max-width: calc(6 * (100vw / 12)); 331 } 332 } 333 } 334 335 .wp-block[data-type="core/cover"][data-align="full"] { 336 337 @include media(tablet) { 338 339 .wp-block-cover { 340 padding-left: calc(10% + 64px); 341 padding-right: calc(10% + 64px); 176 342 } 177 343 } … … 201 367 } 202 368 203 .wp-block-button__link:not(.has-background), 204 .wp-block-button__link:not(.has-background) { 369 &:not(.is-style-outline) .wp-block-button__link { 205 370 background: $color__background-button; 206 371 } … … 210 375 } 211 376 212 &.is-style-outline .wp-block-button__link,213 &.is-style-outline .wp-block-button__link:hover,214 &.is-style-outline .wp-block-button__link:focus,215 &.is-style-outline .wp-block-button__link:active {377 &.is-style-outline, 378 &.is-style-outline:hover, 379 &.is-style-outline:focus, 380 &.is-style-outline:active { 216 381 background: transparent; 217 border-color: $color__background-button; 218 219 &:not(.has-text-color) { 220 color: $color__background-button; 382 color: $color__background-button; 383 384 .wp-block-button__link { 385 background: transparent; 386 387 &:not(.has-text-color) { 388 color: $color__background-button; 389 } 221 390 } 222 391 } … … 258 427 259 428 .wp-block-pullquote { 260 border: none; 429 border-color: transparent; 430 border-width: 2px; 431 color: #000; 432 433 blockquote { 434 margin-top: calc(3 * #{ $size__spacing-unit}); 435 margin-bottom: calc(3.33 * #{ $size__spacing-unit}); 436 hyphens: auto; 437 word-break: break-word; 438 } 439 440 &:not(.is-style-solid-color) .wp-block-pullquote__citation { 441 color: $color__text-light; 442 } 261 443 262 444 &.is-style-solid-color { 263 445 264 446 blockquote { 265 width: calc(100vw - (2 * #{ $size__spacing-unit})); 266 max-width: 80%; 447 width: calc(100% - (2 * #{ $size__spacing-unit})); 448 max-width: calc( 100% - (2 * #{ $size__spacing-unit})); 449 450 a, 451 &.has-text-color p, 452 &.has-text-color a { 453 color: inherit; 454 } 455 456 &:not(.has-text-color) { 457 color: $color__background-body; 458 } 267 459 268 460 @include media(tablet) { 269 width: calc(8 * (100vw / 12));461 max-width: 80%; 270 462 } 271 272 @include media(desktop) {273 width: calc(6 * (100vw / 12));274 }275 }276 277 blockquote:not(.has-text-color) p,278 .wp-block-pullquote__citation {279 color: white;280 463 } 281 464 … … 284 467 } 285 468 } 286 287 blockquote { 288 hyphens: auto; 289 word-break: break-word; 290 } 291 } 292 293 body[data-type="core/pullquote"], 294 body[data-type="core/pullquote"][data-align="left"], 295 body[data-type="core/pullquote"][data-align="right"] { 469 } 470 471 .wp-block[data-type="core/pullquote"], 472 .wp-block[data-type="core/pullquote"][data-align="left"], 473 .wp-block[data-type="core/pullquote"][data-align="right"] { 296 474 297 475 blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, … … 303 481 margin-bottom: 0.5em; 304 482 margin-top: 0.5em; 305 color: $color__text-main;306 483 307 484 @include media(tablet) { … … 315 492 line-height: 1.6; 316 493 text-transform: none; 317 color: $color__text-light;318 494 } 319 495 … … 323 499 } 324 500 325 body[data-type="core/pullquote"][data-align="left"],326 body[data-type="core/pullquote"][data-align="right"] {501 .wp-block[data-type="core/pullquote"][data-align="left"], 502 .wp-block[data-type="core/pullquote"][data-align="right"] { 327 503 328 504 .editor-block-list__block-edit { 505 width: calc(4 * (100vw / 12)); 329 506 max-width: 50%; 330 507 … … 335 512 .wp-block-pullquote.is-style-solid-color { 336 513 padding: 1em; 337 338 p,339 .wp-block-pullquote__citation {340 color: white;341 }342 514 } 343 515 } … … 351 523 } 352 524 525 .wp-block[data-type="core/pullquote"][data-align="full"] { 526 527 @include media(tablet) { 528 529 .wp-block-pullquote blockquote { 530 max-width: calc(80% - 128px); 531 } 532 } 533 } 534 535 353 536 /** === File === */ 354 537 … … 356 539 font-family: $font__heading; 357 540 541 .wp-block-file__textlink { 542 text-decoration: underline; 543 color: $color__link; 544 545 &:hover { 546 color: $color__link-hover; 547 text-decoration: none; 548 } 549 } 550 358 551 .wp-block-file__button { 552 display: table; 359 553 line-height: 1.8; 360 554 font-size: $font__size-sm; … … 363 557 border-radius: 5px; 364 558 } 559 560 .wp-block-file__button-richtext-wrapper { 561 display: block; 562 margin-top: calc(0.75 * #{$size__spacing-unit}); 563 margin-left: 0; 564 } 565 365 566 } 366 567 … … 403 604 color: $color__text-light; 404 605 font-size: $font__size-lg; 405 letter-spacing: $font__size-sm; 606 letter-spacing: calc(2 * #{$size__spacing-unit}); 607 padding-left: calc(2 * #{$size__spacing-unit}); 406 608 } 407 609 } … … 421 623 422 624 li { 625 color: $color__text-light; 423 626 font-family: $font__heading; 424 font-size: $font__size-lg;627 font-size: calc(#{$font__size_base} * #{$font__size-ratio}); 425 628 font-weight: bold; 426 629 line-height: $font__line-height-heading; 630 padding-bottom: ( .75 * $size__spacing-unit ); 631 632 &.menu-item-has-children, 633 &:last-child { 634 padding-bottom: 0; 635 } 427 636 428 637 a { 429 638 text-decoration: none; 430 431 &:after { 432 color: $color__text-light; 433 content: ","; 434 } 435 } 436 437 &:last-child a:after { 438 color: $color__text-light; 439 content: "."; 440 } 441 } 639 } 640 641 ul { 642 padding-left: $size__spacing-unit; 643 } 644 } 645 } 646 647 .wp-block-categories { 648 649 ul { 650 padding-top: ( .75 * $size__spacing-unit ); 651 @include nestedSubMenuPadding(); 652 } 653 654 li ul { 655 list-style: none; 656 padding-left: 0; 657 margin-bottom: ( -.75 * $size__spacing-unit ); 658 } 659 442 660 } 443 661 … … 491 709 .wp-caption { 492 710 dd { 711 color: $color__text-light; 712 font-size: $font__size-xs; 713 font-family: $font__heading; 714 line-height: $font__line-height-pre; 715 margin: 0; 716 padding: ( $size__spacing-unit * .5 ); 717 text-align: left; 493 718 text-align: center; 494 719 -webkit-margin-start: 0px; … … 500 725 501 726 /* Add style for galleries in classic-editor block */ 502 .gallery { 503 504 display: flex; 505 506 .gallery-item { 507 padding: ( $size__spacing-unit * .5 ); 508 text-align: center; 509 vertical-align: top; 510 width: 100%; 511 512 .gallery-caption { 513 margin: 0; 514 } 515 } 516 517 // Loops to enumerate the classes for gallery columns. 518 @for $i from 2 through 9 { 519 &.gallery-columns-#{$i} .gallery-item { 520 max-width: calc( ( 12 / #{$i} ) * (100% / 12) ); 521 } 522 } 523 } 524 } 727 blockquote { 728 border-left: 2px solid $color__link; 729 730 cite { 731 font-family: $font__heading; 732 font-size: $font__size-xs; 733 font-style: normal; 734 line-height: 1.6; 735 color: $color__text-light; 736 } 737 } 738 } 739 740 /* Make sure our non-latin font overrides don't overwrite the iconfont used in the classic editor toolbar */ 741 .wp-block[data-type="core/freeform"] .mce-btn i { 742 font-family: dashicons !important; 743 }
Note: See TracChangeset
for help on using the changeset viewer.