Make WordPress Core

Ticket #45038: 45038.3.patch

File 45038.3.patch, 14.0 KB (added by laurelfulford, 6 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/* Alignments */
     29
     30[class^="wp-block-"].alignleft,
     31[class^="wp-block-"] .alignleft {
     32        margin-right: 24px;
     33}
     34
     35[class^="wp-block-"].alignright,
     36[class^="wp-block-"] .alignright {
     37        margin-left: 24px;
     38}
     39
     40/*--------------------------------------------------------------
     412.0 Blocks - Common Blocks
     42--------------------------------------------------------------*/
     43
     44/* Paragraph */
     45
     46p.has-drop-cap:not(:focus)::first-letter {
     47        font-size: 5em;
     48        margin-top: 0.1em;
     49}
     50
     51/* Image */
     52
     53.wp-block-image figure {
     54        margin-bottom: 24px;
     55}
     56
     57.wp-block-image figcaption {
     58        margin: -7px 0 20px;;
     59        padding: 9px 9px 1.0em;
     60        text-align: center;
     61}
     62
     63.wp-block-image.alignfull,
     64.wp-block-image.alignfull img {
     65        margin: 0;
     66}
     67
     68/* Gallery */
     69
     70.wp-block-gallery {
     71        margin: 0 0 24px;
     72}
     73
     74.wp-block-gallery .blocks-gallery-image figcaption,
     75.wp-block-gallery .blocks-gallery-item figcaption {
     76        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     77        left: 0;
     78        right: 0;
     79        width: auto;
     80}
     81
     82/* Quotes */
     83
     84.wp-block-quote:not(.is-large):not(.is-style-large) {
     85        border: none;
     86        padding: 0 3em;
     87}
     88
     89.wp-block-quote cite {
     90        color: inherit;
     91        font-size: inherit;
     92        font-weight: 600;
     93}
     94
     95/* Audio */
     96
     97.wp-block-audio {
     98        margin-left: 0;
     99        margin-right: 0;
     100}
     101
     102.wp-block-audio audio {
     103        display: block;
     104        width: 100%;
     105}
     106
     107/* File */
     108
     109.rtl .wp-block-file * + .wp-block-file__button {
     110        margin: 0 0 0 0.75em;
     111}
     112
     113/*--------------------------------------------------------------
     1143.0 Blocks - Formatting
     115--------------------------------------------------------------*/
     116
     117/* Code */
     118
     119.wp-block-code {
     120        background-color: transparent;
     121        border: 0;
     122        padding: 0;
     123}
     124
     125/* Pullquote */
     126
     127.wp-block-pullquote p {
     128        font-size: 1.5em;
     129}
     130
     131.wp-block-pullquote__citation,
     132.wp-block-pullquote cite {
     133        color: inherit;
     134        font-size: inherit;
     135        font-weight: 600;
     136        text-transform: none;
     137}
     138
     139/* Table */
     140
     141.wp-block-table td,
     142.wp-block-table th {
     143        border: none;
     144}
     145
     146.wp-block-table td {
     147        border-top: 1px solid #e7e7e7;
     148}
     149
     150.wp-block-table tr:nth-child(odd) td {
     151        background: #f2f7fc;
     152}
     153
     154/*--------------------------------------------------------------
     1554.0 Blocks - Layout Elements
     156--------------------------------------------------------------*/
     157
     158/* Columns */
     159
     160.wp-block-columns {
     161        margin: 0 -0.5em;
     162}
     163.wp-block-column {
     164        margin: 0 0.5em;
     165}
     166
     167/* Separator */
     168
     169.wp-block-separator {
     170        border: 0;
     171}
     172
     173/*--------------------------------------------------------------
     1745.0 Blocks - Widgets
     175--------------------------------------------------------------*/
     176
     177/* Archives, Categories & Latest Posts */
     178
     179.wp-block-archives.aligncenter,
     180.wp-block-categories.aligncenter,
     181.wp-block-latest-posts.aligncenter {
     182        margin-left: 20px;
     183        text-align: center;
     184}
     185
     186.rtl .wp-block-archives.aligncenter,
     187.rtl .wp-block-categories.aligncenter,
     188.rtl .wp-block-latest-posts.aligncenter {
     189        margin-left: 0;
     190        margin-right: 20px;
     191}
     192
     193/* Latest Comments */
     194
     195.wp-block-latest-comments {
     196        margin: 0 0 24px;
     197}
     198
     199/* Latest Posts */
     200
     201.wp-block-latest-posts.is-grid {
     202        margin-left: 0;
     203        margin-right: 0;
     204}
     205
     206/*--------------------------------------------------------------
     2076.0 Blocks - Colors
     208--------------------------------------------------------------*/
     209
     210.has-blue-color {
     211        color: #0066cc;
     212}
     213
     214.has-blue-background-color {
     215        background-color: #0066cc;
     216}
     217
     218.has-black-color {
     219        color: #000;
     220}
     221
     222.has-black-background-color {
     223        background-color: #000;
     224}
     225
     226.has-medium-gray-color {
     227        color: #666;
     228}
     229
     230.has-medium-gray-background-color {
     231        background-color: #666;
     232}
     233
     234.has-light-gray-color {
     235        color: #f1f1f1;
     236}
     237
     238.has-light-gray-background-color {
     239        background-color: #f1f1f1;
     240}
     241
     242.has-white-color {
     243        color: #fff;
     244}
     245
     246.has-white-background-color {
     247        background-color: #fff;
     248}
  • 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        display: block;
     188        margin: -7px 0 0;
     189        padding: 9px 9px 1.0em;
     190        text-align: center;
     191}
     192
     193/* Gallery */
     194
     195.editor-block-list__block .wp-block-gallery {
     196        margin: 0 0 24px;
     197}
     198
     199/* Quote */
     200
     201.wp-block-quote {
     202        border: 0;
     203        padding: 0 3em;
     204}
     205
     206.wp-block-quote:not(.is-large):not(.is-style-large) {
     207        border: 0;
     208        padding: 0 3em;
     209}
     210
     211.wp-block-quote .wp-block-quote__citation {
     212        font-size: 16px;
     213        font-weight: 600;
     214}
     215
     216.wp-block-quote.is-large .wp-block-quote__citation,
     217.wp-block-quote.is-style-large .wp-block-quote__citation  {
     218        font-size: 18px;
     219}
     220
     221/* Cover Image */
     222
     223.wp-block-cover-image-text {
     224        font-size: 32px;
     225}
     226
     227/* File */
     228
     229.wp-block-file .wp-block-file__textlink .editor-rich-text__tinymce {
     230        color: #0066cc;
     231        font-size: 16px;
     232        text-decoration: underline;
     233}
     234
     235/*--------------------------------------------------------------
     2364.0 Blocks - Formatting
     237--------------------------------------------------------------*/
     238
     239/* Code */
     240
     241.wp-block-code {
     242        border: 0;
     243        padding: 0;
     244}
     245
     246/* Pullquote */
     247
     248.wp-block-pullquote blockquote > .editor-rich-text p {
     249        font-size: 1.5em;
     250}
     251
     252.wp-block-pullquote .wp-block-pullquote__citation {
     253        color: inherit;
     254        font-size: inherit;
     255        font-weight: 600;
     256        text-transform: none;
     257}
     258
     259/* Table */
     260
     261.wp-block-table tr:nth-child(odd) td {
     262        background: #f2f7fc;
     263}
     264
     265.wp-block-table th .wp-block-table__cell-content {
     266        color: #777;
     267        font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
     268}
     269
     270.editor-block-list__block .wp-block-table tr td {
     271        padding-bottom: 0;
     272        padding-top: 0;
     273}
     274
     275/*--------------------------------------------------------------
     2765.0 Blocks - Widgets
     277--------------------------------------------------------------*/
     278
     279/* Latest Comments */
     280
     281.editor-block-list__block .wp-block-latest-comments {
     282        margin: 0 0 24px;
     283}
     284
     285.rtl .edit-post-visual-editor .wp-block-latest-comments {
     286        margin-right: 0;
     287}
     288
     289/* Latest Posts */
     290
     291.edit-post-visual-editor .editor-block-list__block .wp-block-latest-posts.is-grid {
     292        list-style: none;
     293        margin-left: 0;
     294        margin-right: 0;
     295}
     296
     297.edit-post-visual-editor .wp-block-latest-posts.is-grid li {
     298        margin-bottom: 1em;
     299}
  • 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