Make WordPress Core

Ticket #45038: 45038.2.patch

File 45038.2.patch, 13.3 KB (added by laurelfulford, 5 years ago)
  • src/wp-content/themes/twentyten/blocks.css

     
     1/*
     2Theme Name: Twenty Ten
     3Description: Used to style Gutenberg Blocks.
     4*/
     5
     6/*--------------------------------------------------------------
     7>>> TABLE OF CONTENTS:
     8----------------------------------------------------------------
     91.0 General Block Styles
     102.0 Blocks - Common Blocks
     113.0 Blocks - Formatting
     124.0 Blocks - Layout Elements
     135.0 Blocks - Widgets
     146.0 Blocks - Colors
     15--------------------------------------------------------------*/
     16
     17/*--------------------------------------------------------------
     181.0 General Block Styles
     19--------------------------------------------------------------*/
     20
     21/* Captions */
     22
     23[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
     24        color: #777;
     25        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     26}
     27
     28/*--------------------------------------------------------------
     292.0 Blocks - Common Blocks
     30--------------------------------------------------------------*/
     31
     32/* Paragraph */
     33
     34p.has-drop-cap:not(:focus)::first-letter {
     35        font-size: 5em;
     36        margin-top: 0.1em;
     37}
     38
     39/* Image */
     40
     41.wp-block-image figcaption {
     42        background: #f1f1f1;
     43        margin: -7px 0 20px;;
     44        padding: 9px 9px 1.0em;
     45        text-align: center;
     46}
     47
     48.wp-block-image.alignfull,
     49.wp-block-image.alignfull img {
     50        margin: 0;
     51}
     52
     53/* Gallery */
     54
     55.wp-block-gallery {
     56        margin: 0 0 24px;
     57}
     58
     59.wp-block-gallery .blocks-gallery-image figcaption,
     60.wp-block-gallery .blocks-gallery-item figcaption {
     61        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     62        left: 0;
     63        right: 0;
     64        width: auto;
     65}
     66
     67/* Quotes */
     68
     69.wp-block-quote:not(.is-large):not(.is-style-large) {
     70        border: none;
     71        padding: 0 3em;
     72}
     73
     74.wp-block-quote cite {
     75        color: inherit;
     76        font-size: inherit;
     77        font-weight: 600;
     78}
     79
     80/* Audio */
     81
     82.wp-block-audio {
     83        margin-left: 0;
     84        margin-right: 0;
     85}
     86
     87.wp-block-audio audio {
     88        display: block;
     89        width: 100%;
     90}
     91
     92/* File */
     93
     94.rtl .wp-block-file * + .wp-block-file__button {
     95        margin: 0 0 0 0.75em;
     96}
     97
     98/*--------------------------------------------------------------
     993.0 Blocks - Formatting
     100--------------------------------------------------------------*/
     101
     102/* Code */
     103
     104.wp-block-code {
     105        background-color: transparent;
     106        border: 0;
     107        padding: 0;
     108}
     109
     110/* Pullquote */
     111
     112.wp-block-pullquote p {
     113        font-size: 1.5em;
     114}
     115
     116.wp-block-pullquote__citation,
     117.wp-block-pullquote cite {
     118        color: inherit;
     119        font-size: inherit;
     120        font-weight: 600;
     121        text-transform: none;
     122}
     123
     124/* Table */
     125
     126.wp-block-table td,
     127.wp-block-table th {
     128        border: none;
     129}
     130
     131.wp-block-table td {
     132        border-top: 1px solid #e7e7e7;
     133}
     134
     135.wp-block-table tr:nth-child(odd) td {
     136        background: #f2f7fc;
     137}
     138
     139/*--------------------------------------------------------------
     1404.0 Blocks - Layout Elements
     141--------------------------------------------------------------*/
     142
     143/* Separator */
     144
     145.wp-block-separator {
     146        border: 0;
     147}
     148
     149/*--------------------------------------------------------------
     1505.0 Blocks - Widgets
     151--------------------------------------------------------------*/
     152
     153/* Latest Comments */
     154
     155.wp-block-latest-comments {
     156        margin: 0 0 24px;
     157}
     158
     159/* Latest Posts */
     160
     161.wp-block-latest-posts.is-grid {
     162        margin-left: 0;
     163        margin-right: 0;
     164}
     165
     166/*--------------------------------------------------------------
     1676.0 Blocks - Colors
     168--------------------------------------------------------------*/
     169
     170.has-blue-color {
     171        color: #0066cc;
     172}
     173
     174.has-blue-background-color {
     175        background-color: #0066cc;
     176}
     177
     178.has-black-color {
     179        color: #000;
     180}
     181
     182.has-black-background-color {
     183        background-color: #000;
     184}
     185
     186.has-medium-gray-color {
     187        color: #666;
     188}
     189
     190.has-medium-gray-background-color {
     191        background-color: #666;
     192}
     193
     194.has-light-gray-color {
     195        color: #f1f1f1;
     196}
     197
     198.has-light-gray-background-color {
     199        background-color: #f1f1f1;
     200}
     201
     202.has-white-color {
     203        color: #fff;
     204}
     205
     206.has-white-background-color {
     207        background-color: #fff;
     208}
  • src/wp-content/themes/twentyten/editor-blocks.css

     
     1/*
     2Theme Name: Twenty Ten
     3Description: Used to style Gutenberg Blocks in the editor.
     4*/
     5
     6/*--------------------------------------------------------------
     7>>> TABLE OF CONTENTS:
     8----------------------------------------------------------------
     91.0 General Typography
     102.0 General Block Styles
     113.0 Blocks - Common Blocks
     124.0 Blocks - Formatting
     135.0 Blocks - Widgets
     14--------------------------------------------------------------*/
     15
     16/*--------------------------------------------------------------
     171.0 General Typography
     18--------------------------------------------------------------*/
     19
     20.edit-post-visual-editor .editor-block-list__block .mce-content-body,
     21.wp-block-freeform.block-library-rich-text__tinymce p,
     22.wp-block-freeform.block-library-rich-text__tinymce li {
     23        line-height: 1.5;
     24}
     25
     26.edit-post-visual-editor .editor-block-list__block {
     27        color: #1a1a1a;
     28}
     29
     30.editor-post-title__block .editor-post-title__input {
     31        color: #000;
     32        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     33        font-size: 21px;
     34        font-weight: bold;
     35        line-height: 1.3em;
     36}
     37
     38.edit-post-visual-editor .editor-block-list__block h1 {
     39        font-size: 32px;
     40}
     41
     42.edit-post-visual-editor .editor-block-list__block h2 {
     43        font-size: 24px;
     44}
     45
     46.edit-post-visual-editor .editor-block-list__block h3 {
     47        font-size: 19px;
     48}
     49
     50.edit-post-visual-editor .editor-block-list__block h4 {
     51        font-size: 16px;
     52}
     53
     54.edit-post-visual-editor .editor-block-list__block h5 {
     55        font-size: 13px;
     56}
     57
     58.edit-post-visual-editor .editor-block-list__block h6 {
     59        font-size: 11px;
     60}
     61
     62/*--------------------------------------------------------------
     632.0 General Block Styles
     64--------------------------------------------------------------*/
     65
     66/* Main column width */
     67
     68body.gutenberg-editor-page .edit-post-visual-editor .editor-post-title__block,
     69body.gutenberg-editor-page .edit-post-visual-editor .editor-default-block-appender,
     70body.gutenberg-editor-page .edit-post-visual-editor .editor-block-list__block {
     71        max-width: 670px; /* 640px + 30px for padding */
     72}
     73
     74/* Link styles */
     75
     76.edit-post-visual-editor a,
     77.editor-block-list__block a,
     78.wp-block-freeform.block-library-rich-text__tinymce a {
     79        color: #0066cc;
     80}
     81
     82/* List styles */
     83
     84.edit-post-visual-editor ul:not(.wp-block-gallery),
     85.editor-block-list__block ul:not(.wp-block-gallery),
     86.block-library-list ul,
     87.edit-post-visual-editor ol,
     88.editor-block-list__block ol,
     89.block-library-list ol.editor-rich-text__tinymce {
     90        margin: 0 0 18px 1.5em;
     91        padding: 0;
     92}
     93
     94.edit-post-visual-editor ul:not(.wp-block-gallery),
     95.editor-block-list__block ul:not(.wp-block-gallery),
     96.block-library-list ul {
     97        list-style: square;
     98}
     99
     100.edit-post-visual-editor ol,
     101.editor-block-list__block ol,
     102.block-library-list ol {
     103        list-style: decimal;
     104        margin-left: 1.5em;
     105}
     106
     107.edit-post-visual-editor ul:not(.wp-block-gallery) li,
     108.editor-block-list__block ul:not(.wp-block-gallery) li,
     109.edit-post-visual-editor ol li,
     110.editor-block-list__block ol li,
     111.block-library-list li {
     112        margin-bottom: 0;
     113}
     114
     115.edit-post-visual-editor ul:not(.wp-block-gallery) li > ul,
     116.editor-block-list__block ul:not(.wp-block-gallery) li > ul,
     117.block-library-list li > ul,
     118.edit-post-visual-editor li > ol,
     119.editor-block-list__block li > ol,
     120.block-library-list li > ol {
     121        margin-bottom: 0;
     122}
     123
     124.rtl .edit-post-visual-editor ul:not(.wp-block-gallery),
     125.rtl .editor-block-list__block ul:not(.wp-block-gallery),
     126.rtl .block-library-list ul,
     127.rtl .edit-post-visual-editor ol,
     128.rtl .editor-block-list__block ol,
     129.rtl .block-library-list ol {
     130        margin-left: 0;
     131        margin-right: 1.25em;
     132        padding: 0;
     133}
     134
     135/* Caption styles */
     136
     137[class^="wp-block-"] figcaption {
     138        color: #777;
     139        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     140}
     141
     142/* Code styles */
     143
     144.wp-block-freeform.block-library-rich-text__tinymce code {
     145        background: transparent;
     146}
     147
     148/* Quote styles */
     149
     150.wp-block-freeform.block-library-rich-text__tinymce blockquote {
     151        border: 0;
     152        padding: 0 3em;
     153}
     154
     155/* Table styles */
     156
     157.editor-block-list__block tr th,
     158.editor-block-list__block tr th a {
     159        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     160}
     161
     162/* Definition List styles */
     163
     164.editor-block-list__block dd {
     165        margin-left: 0;
     166        margin-right: 0;
     167}
     168
     169/*--------------------------------------------------------------
     1703.0 Blocks - Common Blocks
     171--------------------------------------------------------------*/
     172
     173/* Paragraph */
     174
     175p.has-drop-cap:not(:focus)::first-letter {
     176        font-size: 5em;
     177        margin-top: 0.1em;
     178}
     179
     180/* Image */
     181
     182.wp-block-image {
     183        margin-bottom: 20px;
     184}
     185
     186.wp-block-image figcaption {
     187        background: #f1f1f1;
     188        display: block;
     189        margin: -7px 0 0;
     190        padding: 9px 9px 1.0em;
     191        text-align: center;
     192}
     193
     194/* Gallery */
     195
     196.editor-block-list__block .wp-block-gallery {
     197        margin: 0 0 24px;
     198}
     199
     200/* Quote */
     201
     202.wp-block-quote {
     203        border: 0;
     204        padding: 0 3em;
     205}
     206
     207.wp-block-quote:not(.is-large):not(.is-style-large) {
     208        border: 0;
     209        padding: 0 3em;
     210}
     211
     212.wp-block-quote .wp-block-quote__citation {
     213        font-size: 16px;
     214        font-weight: 600;
     215}
     216
     217.wp-block-quote.is-large .wp-block-quote__citation,
     218.wp-block-quote.is-style-large .wp-block-quote__citation  {
     219        font-size: 18px;
     220}
     221
     222/* Cover Image */
     223
     224.wp-block-cover-image-text {
     225        font-size: 32px;
     226}
     227
     228/* File */
     229
     230.wp-block-file .wp-block-file__textlink .editor-rich-text__tinymce {
     231        color: #0066cc;
     232        font-size: 16px;
     233        text-decoration: underline;
     234}
     235
     236/*--------------------------------------------------------------
     2374.0 Blocks - Formatting
     238--------------------------------------------------------------*/
     239
     240/* Code */
     241
     242.wp-block-code {
     243        border: 0;
     244        padding: 0;
     245}
     246
     247/* Pullquote */
     248
     249.wp-block-pullquote blockquote > .editor-rich-text p {
     250        font-size: 1.5em;
     251}
     252
     253.wp-block-pullquote .wp-block-pullquote__citation {
     254        color: inherit;
     255        font-size: inherit;
     256        font-weight: 600;
     257        text-transform: none;
     258}
     259
     260/* Table */
     261
     262.wp-block-table tr:nth-child(odd) td {
     263        background: #f2f7fc;
     264}
     265
     266.wp-block-table th .wp-block-table__cell-content {
     267        color: #777;
     268        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     269}
     270
     271.editor-block-list__block .wp-block-table tr td {
     272        padding-bottom: 0;
     273        padding-top: 0;
     274}
     275
     276/*--------------------------------------------------------------
     2775.0 Blocks - Widgets
     278--------------------------------------------------------------*/
     279
     280/* Latest Comments */
     281
     282.editor-block-list__block .wp-block-latest-comments {
     283        margin: 0 0 24px;
     284}
     285
     286.rtl .edit-post-visual-editor .wp-block-latest-comments {
     287        margin-right: 0;
     288}
     289
     290/* Latest Posts */
     291
     292.edit-post-visual-editor .editor-block-list__block .wp-block-latest-posts.is-grid {
     293        list-style: none;
     294        margin-left: 0;
     295        margin-right: 0;
     296}
     297
     298.edit-post-visual-editor .wp-block-latest-posts.is-grid li {
     299        margin-bottom: 1em;
     300}
  • src/wp-content/themes/twentyten/functions.php

     
    7575        // This theme styles the visual editor with editor-style.css to match the theme style.
    7676        add_editor_style();
    7777
     78        // Load regular editor styles into the new block-based editor.
     79        add_theme_support( 'editor-styles' );
     80
     81        // Load default block styles.
     82        add_theme_support( 'wp-block-styles' );
     83
     84                // Add support for custom color scheme.
     85        add_theme_support( 'editor-color-palette', array(
     86                array(
     87                        'name'  => __( 'Blue', 'twentyten' ),
     88                        'slug'  => 'blue',
     89                        'color' => '#0066cc',
     90                ),
     91                array(
     92                        'name'  => __( 'Black', 'twentyten' ),
     93                        'slug'  => 'black',
     94                        'color' => '#000',
     95                ),
     96                array(
     97                        'name'  => __( 'Medium Gray', 'twentyten' ),
     98                        'slug'  => 'medium-gray',
     99                        'color' => '#666',
     100                ),
     101                array(
     102                        'name'  => __( 'Light Gray', 'twentyten' ),
     103                        'slug'  => 'light-gray',
     104                        'color' => '#f1f1f1',
     105                ),
     106                array(
     107                        'name'  => __( 'White', 'twentyten' ),
     108                        'slug'  => 'white',
     109                        'color' => '#fff',
     110                ),
     111        ) );
     112
    78113        // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
    79114        add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
    80115
     
    612647        return $args;
    613648}
    614649add_filter( 'widget_tag_cloud_args', 'twentyten_widget_tag_cloud_args' );
     650
     651/**
     652 * Enqueue scripts and styles for front end.
     653 *
     654 * @since Twenty Ten 2.6
     655 */
     656function twentyten_scripts_styles() {
     657        // Theme block stylesheet.
     658        wp_enqueue_style( 'twentyten-block-style', get_template_directory_uri() . '/blocks.css', array(), '20181018' );
     659}
     660add_action( 'wp_enqueue_scripts', 'twentyten_scripts_styles' );
     661
     662/**
     663 * Enqueue editor styles for Gutenberg
     664 *
     665 * @since Twenty Ten 2.6
     666 */
     667function twentyten_block_editor_styles() {
     668        // Block styles.
     669        wp_enqueue_style( 'twentyten-block-editor-style', get_template_directory_uri() . '/editor-blocks.css' );
     670}
     671add_action( 'enqueue_block_editor_assets', 'twentyten_block_editor_styles' );
     672
     673