From b763a5b649f11eaeebac63e1b48e96e9ea4a7cac Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 24 May 2022 17:47:32 +0530 Subject: [PATCH 01/12] Add space between typography controls --- .../src/customizer/components/google-fonts-control/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/assets/src/customizer/components/google-fonts-control/style.css b/plugin/assets/src/customizer/components/google-fonts-control/style.css index a80e2b4f8..2cb266261 100644 --- a/plugin/assets/src/customizer/components/google-fonts-control/style.css +++ b/plugin/assets/src/customizer/components/google-fonts-control/style.css @@ -59,6 +59,10 @@ padding: 8px 0 8px 8px; } + .google-fonts-control-child + .google-fonts-control-child { + margin-top: 20px; + } + .components-google-fonts-control__select { flex-direction: row; align-items: center; From b4424294602c9ff35c97a27b8cdd30a800059eaa Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 24 May 2022 17:48:29 +0530 Subject: [PATCH 02/12] Change control order: Move font size as first --- .../components/google-fonts-control/item.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/plugin/assets/src/customizer/components/google-fonts-control/item.js b/plugin/assets/src/customizer/components/google-fonts-control/item.js index cb25cd5c6..0efa74feb 100644 --- a/plugin/assets/src/customizer/components/google-fonts-control/item.js +++ b/plugin/assets/src/customizer/components/google-fonts-control/item.js @@ -59,28 +59,27 @@ const Item = props => {
{ - const lineHeightValue = event.target.value; + const sizeValue = event.target.value; onChange( { id, - lineHeightValue, + sizeValue, trackingValue: tracking.value, - sizeValue: size.value, weightValue: weight.value, + lineHeightValue: lineHeight.value, } ); } } /> @@ -90,27 +89,28 @@ const Item = props => {
{ - const sizeValue = event.target.value; + const lineHeightValue = event.target.value; onChange( { id, - sizeValue, + lineHeightValue, trackingValue: tracking.value, + sizeValue: size.value, weightValue: weight.value, - lineHeightValue: lineHeight.value, } ); } } /> From 95c344d996fca219c7c04eb680f524782f3addf7 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Tue, 24 May 2022 20:00:00 +0530 Subject: [PATCH 03/12] Update test snapshot --- .../__snapshots__/item.test.js.snap | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugin/tests/js/customizer/components/google-fonts-control/__snapshots__/item.test.js.snap b/plugin/tests/js/customizer/components/google-fonts-control/__snapshots__/item.test.js.snap index 1ffeb8f49..9cb9c2ad0 100644 --- a/plugin/tests/js/customizer/components/google-fonts-control/__snapshots__/item.test.js.snap +++ b/plugin/tests/js/customizer/components/google-fonts-control/__snapshots__/item.test.js.snap @@ -20,20 +20,19 @@ exports[`GoogleFontsControl/Item matches snapshot 1`] = ` >
@@ -45,19 +44,20 @@ exports[`GoogleFontsControl/Item matches snapshot 1`] = ` > From bd46ac841553a559e70e644fa357e53b7de01112 Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Thu, 26 May 2022 20:40:07 +0530 Subject: [PATCH 04/12] Revert "Merge pull request #348 from material-components/m3/typography" This reverts commit 03644852116a2938f30532abb23d7c9b6800e61b, reversing changes made to 367caaf2b22b10d17c3f1290ba847129e25306ab. --- plugin/assets/css/src/components/material.css | 40 +- plugin/assets/css/src/front-end.css | 2 - plugin/assets/css/src/getting-started.css | 2 +- plugin/assets/css/src/gsm/base.css | 20 +- plugin/assets/css/src/material-components.css | 1 + plugin/assets/css/src/mixins.css | 38 +- plugin/assets/css/src/overrides.css | 54 ++ plugin/assets/css/src/settings.css | 2 +- plugin/assets/css/src/settings/base.css | 18 +- plugin/assets/css/src/typography.css | 94 ---- plugin/assets/css/src/wizard.css | 2 +- plugin/assets/css/src/wizard/base.css | 11 +- plugin/assets/css/src/wizard/content.css | 12 +- plugin/assets/importer/demo-content.xml | 2 +- .../src/block-editor/blocks/button/block.json | 3 +- .../blocks/card/components/card-primary.js | 8 +- .../card/components/card-supporting-text.js | 4 +- .../components/card-header.js | 4 +- .../components/vertical-card-layout.js | 2 +- .../src/block-editor/blocks/tab-bar/save.js | 9 +- .../components/google-fonts-control/index.js | 10 +- .../components/google-fonts-control/item.js | 72 +-- .../components/google-fonts-control/style.css | 18 +- .../components/material-library/index.js | 44 +- .../material-library/sections/buttons.js | 2 +- .../material-library/sections/cards.js | 11 +- .../material-library/sections/checkboxes.js | 2 +- .../material-library/sections/chips.js | 2 +- .../material-library/sections/fields.js | 2 +- .../material-library/sections/image-lists.js | 2 +- .../material-library/sections/lists.js | 2 +- .../material-library/sections/radios.js | 2 +- .../material-library/sections/switch.js | 2 +- .../material-library/sections/tab-bar.js | 2 +- .../material-library/sections/table.js | 2 +- .../components/material-library/styles.js | 23 +- .../src/customizer/customize-controls.js | 2 - .../src/customizer/customize-preview.js | 8 +- .../components/content/customize.js | 36 +- .../components/content/learn-content.js | 4 +- .../components/content/learn.js | 2 +- .../components/content/overview.js | 4 +- .../components/content/updates.js | 2 +- .../components/content/wizard.js | 2 +- .../src/getting-started/components/index.js | 2 +- .../components/navigation/index.js | 2 +- .../assets/src/settings/components/index.js | 2 +- .../settings/components/integrations/index.js | 10 +- .../components/integrations/updater.js | 8 +- .../src/wizard/components/content/addons.js | 6 +- .../src/wizard/components/content/welcome.js | 2 +- .../src/wizard/components/content/work.js | 2 +- .../src/wizard/components/header/index.js | 2 +- plugin/php/class-admin.php | 2 +- plugin/php/class-migration.php | 99 ---- plugin/php/class-plugin.php | 10 - plugin/php/customizer/class-controls.php | 498 +++++++----------- .../php/templates/partials/card-content.php | 2 +- plugin/php/templates/partials/card-header.php | 4 +- .../block-editor/blocks/render/blocks.html | 155 +++--- .../card/__snapshots__/edit.test.js.snap | 32 +- .../card/__snapshots__/save.test.js.snap | 32 +- .../__snapshots__/card-primary.test.js.snap | 32 +- .../card-supporting-text.test.js.snap | 8 +- .../horizontal-card-layout.test.js.snap | 32 +- .../vertical-card-layout.test.js.snap | 112 ++-- .../__snapshots__/edit.test.js.snap | 120 ++--- .../__snapshots__/save.test.js.snap | 32 +- .../edit-with-select.test.js.snap | 40 +- .../__snapshots__/edit.test.js.snap | 40 +- .../__snapshots__/card-header.test.js.snap | 20 +- .../__snapshots__/card-image.test.js.snap | 8 +- .../horizontal-card-layout.test.js.snap | 48 +- .../__snapshots__/posts-list.test.js.snap | 64 +-- .../__snapshots__/single-post.test.js.snap | 32 +- .../vertical-card-layout.test.js.snap | 136 ++--- .../__snapshots__/edit.test.js.snap | 24 +- .../__snapshots__/edit.test.js.snap | 24 +- .../tab-bar/__snapshots__/save.test.js.snap | 8 +- .../material-library.test.js.snap | 68 +-- .../__snapshots__/item.test.js.snap | 57 +- .../google-fonts-control/item.test.js | 78 +-- .../__snapshots__/index.test.js.snap | 116 ++-- .../__snapshots__/customize.test.js.snap | 108 ++-- .../__snapshots__/overview.test.js.snap | 12 +- .../__snapshots__/wizard.test.js.snap | 4 +- .../__snapshots__/index.test.js.snap | 4 +- .../__snapshots__/updater.test.js.snap | 16 +- .../wizard/__snapshots__/index.test.js.snap | 4 +- .../content/__snapshots__/addons.test.js.snap | 12 +- .../content/__snapshots__/index.test.js.snap | 4 +- .../content/__snapshots__/works.test.js.snap | 20 +- .../js/wizard/components/header/index.test.js | 12 +- .../phpunit/php/class-test-block-types.php | 1 - .../php/class-test-blocks-frontend.php | 6 +- .../tests/phpunit/php/class-test-importer.php | 2 +- .../php/customizer/class-test-controls.php | 75 ++- ...-test-reset-card-style-rest-controller.php | 4 +- theme/404.php | 2 +- theme/archive.php | 4 +- theme/assets/css/src/base/typography.css | 56 +- .../assets/css/src/components/top-app-bar.css | 2 +- theme/assets/css/src/conf/mixins.css | 38 +- theme/assets/css/src/conf/variables.css | 28 +- theme/assets/css/src/editor.css | 6 +- theme/assets/css/src/material-components.css | 1 + theme/comments.php | 4 +- theme/functions.php | 4 +- theme/inc/class-walker-comment.php | 6 +- theme/inc/template-tags.php | 10 +- theme/search.php | 2 +- theme/template-parts/content-none.php | 2 +- theme/template-parts/content.php | 8 +- theme/template-parts/footer.php | 2 +- theme/template-parts/single-page.php | 4 +- theme/template-parts/single.php | 6 +- theme/template-parts/site-title.php | 8 +- 117 files changed, 1219 insertions(+), 1813 deletions(-) delete mode 100644 plugin/assets/css/src/typography.css delete mode 100644 plugin/php/class-migration.php diff --git a/plugin/assets/css/src/components/material.css b/plugin/assets/css/src/components/material.css index 503b76cd7..e79a093a3 100644 --- a/plugin/assets/css/src/components/material.css +++ b/plugin/assets/css/src/components/material.css @@ -36,9 +36,31 @@ } } +/* Typography */ +.mdc-typography--headline1 { + font-style: var(--mdc-typography-headline1-font-style, normal); +} + +.mdc-typography--headline2 { + font-style: var(--mdc-typography-headline2-font-style, normal); +} + +.mdc-typography--headline3 { + font-style: var(--mdc-typography-headline3-font-style, normal); +} + +.mdc-typography--headline4 { + font-style: var(--mdc-typography-headline4-font-style, normal); +} + +.mdc-typography--headline5 { + font-style: var(--mdc-typography-headline5-font-style, normal); +} + +.mdc-typography--headline6, .mdc-drawer__title, .mdc-top-app-bar__title { - font-style: var(--md-sys-typescale-title-medium-style, normal); + font-style: var(--mdc-typography-headline6-font-style, normal); } .mdc-typography--subtitle1, @@ -49,18 +71,18 @@ .mdc-select__selected-text, .mdc-text-field__input, .mdc-text-field__affix { - font-style: var(--md-sys-typescale-label-large-style, normal); + font-style: var(--mdc-typography-subtitle1-font-style, normal); } -.label-medium, +.mdc-typography--subtitle2, .mdc-data-table__header-cell, .mdc-drawer .mdc-list-item, .mdc-slider .mdc-slider__value-indicator-text { - font-style: var(--md-sys-typescale-label-medium-style, normal); + font-style: var(--mdc-typography-subtitle2-font-style, normal); } .mdc-typography--body1 { - font-style: var(--md-sys-typescale-body-large-style, normal); + font-style: var(--mdc-typography-body1-font-style, normal); } .mdc-typography--body2, @@ -73,7 +95,7 @@ .mdc-drawer__subtitle, .mdc-form-field, .mdc-list-item__secondary-text { - font-style: var(--md-sys-typescale-body-medium-style, normal); + font-style: var(--mdc-typography-body2-font-style, normal); } .mdc-typography--caption, @@ -82,17 +104,17 @@ .mdc-text-field-helper-text, .mdc-text-field-character-counter, .mdc-tooltip__surface { - font-style: var(--md-sys-typescale-body-small-style, normal); + font-style: var(--mdc-typography-caption-font-style, normal); } .mdc-typography--button, .mdc-button, .mdc-tab { - font-style: var(--md-sys-typescale-label-large-style, normal); + font-style: var(--mdc-typography-button-font-style, normal); } .mdc-typography--overline { - font-style: var(--md-sys-typescale-label-medium-style, normal); + font-style: var(--mdc-typography-overline-font-style, normal); } /* Image List */ diff --git a/plugin/assets/css/src/front-end.css b/plugin/assets/css/src/front-end.css index 3c5604062..1b822fbc2 100644 --- a/plugin/assets/css/src/front-end.css +++ b/plugin/assets/css/src/front-end.css @@ -19,7 +19,6 @@ */ @import "./base/variables.css"; @import "./conf/index.css"; -@import "typography.css"; @import "./material-components.css"; @import "./components/contact-form.css"; @import "./components/masonry-grid.css"; @@ -28,4 +27,3 @@ @import "../../src/block-editor/blocks/contact-form/inner-blocks/common/style.css"; @import "../../src/block-editor/blocks/card/style.css"; @import "./block/style/masonry.css"; -@import "overrides.css"; diff --git a/plugin/assets/css/src/getting-started.css b/plugin/assets/css/src/getting-started.css index 29fb349bd..968b79f20 100644 --- a/plugin/assets/css/src/getting-started.css +++ b/plugin/assets/css/src/getting-started.css @@ -14,7 +14,7 @@ * limitations under the License. */ -@import "typography.css"; +@import "@material/typography/dist/mdc.typography.css"; @import "@material/layout-grid/dist/mdc.layout-grid.css"; @import "@material/button/dist/mdc.button.css"; @import "@material/ripple/dist/mdc.ripple.css"; diff --git a/plugin/assets/css/src/gsm/base.css b/plugin/assets/css/src/gsm/base.css index 04519d48d..1f7cfc3d6 100644 --- a/plugin/assets/css/src/gsm/base.css +++ b/plugin/assets/css/src/gsm/base.css @@ -15,6 +15,20 @@ */ .material-gsm { + --mdc-typography-headline1-font-family: "Roboto", sans-serif; + --mdc-typography-headline2-font-family: "Roboto", sans-serif; + --mdc-typography-headline3-font-family: "Roboto", sans-serif; + --mdc-typography-headline4-font-family: "Roboto", sans-serif; + --mdc-typography-headline5-font-family: "Roboto", sans-serif; + --mdc-typography-headline6-font-family: "Roboto", sans-serif; + --mdc-typography-subtitle1-font-family: "Roboto", sans-serif; + --mdc-typography-subtitle2-font-family: "Roboto", sans-serif; + --mdc-typography-font-family: "Roboto", sans-serif; + --mdc-typography-body1-font-family: "Roboto", sans-serif; + --mdc-typography-body2-font-family: "Roboto", sans-serif; + --mdc-typography-caption-font-family: "Roboto", sans-serif; + --mdc-typography-button-font-family: "Roboto", sans-serif; + --mdc-typography-overline-font-family: "Roboto", sans-serif; --material-design-gsm-primary-color: #212121; --material-design-gsm-primary-text: #fff; --material-design-gsm-background-color: #fff; @@ -35,15 +49,9 @@ } & h1, - & h2, & h3, & h4 { margin-top: 0; - margin-bottom: 0; - } - - .material-gsm__content-actions + h2 { - margin-top: 2rem; } & p { diff --git a/plugin/assets/css/src/material-components.css b/plugin/assets/css/src/material-components.css index 271510f28..485f78053 100644 --- a/plugin/assets/css/src/material-components.css +++ b/plugin/assets/css/src/material-components.css @@ -30,5 +30,6 @@ @import "@material/tab-indicator/dist/mdc.tab-indicator.css"; @import "@material/tab-scroller/dist/mdc.tab-scroller.css"; @import "@material/textfield/dist/mdc.textfield.css"; +@import "@material/typography/dist/mdc.typography.css"; @import "@material/tooltip/dist/mdc.tooltip.css"; @import "./components/material.css"; diff --git a/plugin/assets/css/src/mixins.css b/plugin/assets/css/src/mixins.css index 56ad84476..184263781 100644 --- a/plugin/assets/css/src/mixins.css +++ b/plugin/assets/css/src/mixins.css @@ -17,31 +17,31 @@ /* stylelint-disable */ @define-mixin fontvars $type, $font-size: 1, $line-height: 1.5, $font-weight: 400, $tracking: 0.25, $font-style: normal { - --md-sys-typescale-$(type)-size: calc($font-size * 16)px; - --md-sys-typescale-$(type)-line-height: $line-height; - --md-sys-typescale-$(type)-style: $font-style; - --md-sys-typescale-$(type)-weight: $font-weight; - --md-sys-typescale-$(type)-tracking: calc(($tracking / ($font-size * 16)) * $font-size * 16)px; + --mdc-typography-$(type)-font-size: calc($font-size * 16)px; + --mdc-typography-$(type)-line-height: calc($line-height * 16)px; + --mdc-typography-$(type)-font-style: $font-style; + --mdc-typography-$(type)-font-weight: $font-weight; + --mdc-typography-$(type)-letter-spacing: calc(($tracking / ($font-size * 16)) * $font-size * 16)px; } @define-mixin typography $type, $font-size: 1, $line-height: 1.5, $font-weight: 400, $child, $font-style: normal { - .$(type) $child { - font-family: var(--md-sys-typescale-$(type)-font, var(--md-ref-typeface-plain, Roboto, sans-serif)); - font-size: var(--md-sys-typescale-$(type)-size, $(font-size)em); - line-height: var(--md-sys-typescale-$(type)-line-height, $(line-height)); - font-style: var(--md-sys-typescale-$(type)-style, $font-style); - font-weight: var(--md-sys-typescale-$(type)-weight, $font-weight); - letter-spacing: var(--md-sys-typescale-$(type)-tracking); - } +.mdc-typography--$type $child { + font-family: var(--mdc-typography-$(type)-font-family, var(--mdc-typography-font-family, Roboto, sans-serif)) !important; + font-size: var(--mdc-typography-$(type)-font-size, $(font-size)em) !important; + line-height: var(--mdc-typography-$(type)-line-height, $(line-height)em) !important; + font-style: var(--mdc-typography-$(type)-font-style, $font-style) !important; + font-weight: var(--mdc-typography-$(type)-font-weight, $font-weight) !important; + letter-spacing: var(--mdc-typography-$(type)-letter-spacing) !important; +} } @define-mixin selector-typography $selector, $type, $font-size: 1, $line-height: 1.5, $font-weight: 400, $child, $font-style: normal { $selector $child { - font-family: var(--md-sys-typescale-$(type)-font, var(--md-ref-typeface-plain, Roboto, sans-serif)); - font-size: var(--md-sys-typescale-$(type)-size, $(font-size)em); - line-height: var(--md-sys-typescale-$(type)-line-height, $(line-height)); - font-style: var(--md-sys-typescale-$(type)-style, $font-style); - font-weight: var(--md-sys-typescale-$(type)-weight, $font-weight); - letter-spacing: var(--md-sys-typescale-$(type)-tracking); + font-family: var(--mdc-typography-$(type)-font-family, var(--mdc-typography-font-family, Roboto, sans-serif)) !important; + font-size: var(--mdc-typography-$(type)-font-size, $(font-size)em) !important; + line-height: var(--mdc-typography-$(type)-line-height, $(line-height)em) !important; + font-style: var(--mdc-typography-$(type)-font-style, $font-style) !important; + font-weight: var(--mdc-typography-$(type)-font-weight, $font-weight) !important; + letter-spacing: var(--mdc-typography-$(type)-letter-spacing) !important; } } diff --git a/plugin/assets/css/src/overrides.css b/plugin/assets/css/src/overrides.css index 371c2c6d7..76dfe0986 100644 --- a/plugin/assets/css/src/overrides.css +++ b/plugin/assets/css/src/overrides.css @@ -14,6 +14,60 @@ * limitations under the License. */ +/* + * Frontend CSS to override other theme styles + * which impact the material components. + */ + +@import "./mixins.css"; + +/* + * Set the typography vars by calculating with base font-size of 16px (browser default) + * to override any theme font rem declaration on html element. + * Material typography vars can be found at + * https://github.com/material-components/material-components-web/blob/master/packages/mdc-typography/_variables.scss#L60 + */ +html { + + @mixin fontvars headline1, 6, 6, 300, -1.5; + @mixin fontvars headline2, 3.75, 3.75, 300, -.5; + @mixin fontvars headline3, 3, 3.125, 400, 0; + @mixin fontvars headline4, 2.125, 2.5, 400, .25; + @mixin fontvars headline5, 1.5, 2, 400, 0; + @mixin fontvars headline6, 1.25, 2, 500, 0.15; + @mixin fontvars subtitle1, 1, 1.75, 400, .15; + @mixin fontvars subtitle2, 0.875, 1.375, 500, .1; + @mixin fontvars body1, 1, 1.5, 400, .5; + @mixin fontvars body2, 0.875, 1.25, 400, .25; + @mixin fontvars caption, 0.75, 1.25, 400, .4; + @mixin fontvars button, 0.875, 2.25, 500, 1.25; + @mixin fontvars overline, 0.75, 2, 500, 1.5; +} + +@mixin typography headline1, 6, 6, 300; +@mixin typography headline2, 3.75, 3.75, 300; +@mixin typography headline3, 3, 3.125, 400; +@mixin typography headline4, 2.125, 2.5, 400; +@mixin typography headline5, 1.5, 2, 400; +@mixin typography headline6, 1.25, 2, 500; +@mixin typography subtitle1, 1, 1.75, 400; +@mixin typography subtitle2, 0.875, 1.375, 500; +@mixin typography body1, 1, 1.5, 400; +@mixin typography body2, 0.875, 1.25, 400; +@mixin typography caption, 0.75, 1.25, 400; +@mixin typography button, 0.875, 2.25, 500; +@mixin typography overline, 0.75, 2, 500; + +/* For `body` types typography should be applied to child elements as well */ +@mixin typography body1, 1, 1.5, 400, *; +@mixin typography body2, 0.875, 1.25, 400, *; + +/* Additional selectors requiring typography styles */ +@mixin selector-typography .mdc-button, button, 0.875, 2.25, 500; +@mixin selector-typography .mdc-button .mdc-button__label, button, 0.875, 2.25, 500; +@mixin selector-typography .mdc-list-item__primary-text, body1, 1, 1.5, 400; +@mixin selector-typography .mdc-list-item__secondary-text, body2, 0.875, 1.25, 400; + /* Material Design Icons */ .material-icons { font-family: var(--mdc-icons-font-family) !important; diff --git a/plugin/assets/css/src/settings.css b/plugin/assets/css/src/settings.css index 94a5dad7d..27afc1c3e 100644 --- a/plugin/assets/css/src/settings.css +++ b/plugin/assets/css/src/settings.css @@ -14,7 +14,7 @@ * limitations under the License. */ -@import "typography.css"; +@import "@material/typography/dist/mdc.typography.css"; @import "@material/layout-grid/dist/mdc.layout-grid.css"; @import "@material/ripple/dist/mdc.ripple.css"; @import "@material/switch/dist/mdc.switch.css"; diff --git a/plugin/assets/css/src/settings/base.css b/plugin/assets/css/src/settings/base.css index 50d9f4c08..71a3c503f 100644 --- a/plugin/assets/css/src/settings/base.css +++ b/plugin/assets/css/src/settings/base.css @@ -15,10 +15,20 @@ */ .material-settings { - --md-sys-typescale-headline-large-line-height: 2em; - --md-sys-typescale-headline-medium-line-height: 2em; - --md-sys-typescale-headline-small-line-height: 2em; - + --mdc-typography-headline1-font-family: "Roboto", sans-serif; + --mdc-typography-headline2-font-family: "Roboto", sans-serif; + --mdc-typography-headline3-font-family: "Roboto", sans-serif; + --mdc-typography-headline4-font-family: "Roboto", sans-serif; + --mdc-typography-headline5-font-family: "Roboto", sans-serif; + --mdc-typography-headline6-font-family: "Roboto", sans-serif; + --mdc-typography-subtitle1-font-family: "Roboto", sans-serif; + --mdc-typography-subtitle2-font-family: "Roboto", sans-serif; + --mdc-typography-font-family: "Roboto", sans-serif; + --mdc-typography-body1-font-family: "Roboto", sans-serif; + --mdc-typography-body2-font-family: "Roboto", sans-serif; + --mdc-typography-caption-font-family: "Roboto", sans-serif; + --mdc-typography-button-font-family: "Roboto", sans-serif; + --mdc-typography-overline-font-family: "Roboto", sans-serif; --material-design-settings-background-color: #fff; --material-design-settings-primary-color: #212121; --material-design-settings-primary-text: #fff; diff --git a/plugin/assets/css/src/typography.css b/plugin/assets/css/src/typography.css deleted file mode 100644 index a5fdf7ef9..000000000 --- a/plugin/assets/css/src/typography.css +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Frontend CSS to override other theme styles - * which impact the material components. - */ - -@import "./mixins.css"; - -/* - * Set the typography vars by calculating with base font-size of 16px (browser default) - * to override any theme font rem declaration on html element. - * Material typography vars can be found at - * https://github.com/material-components/material-components-web/blob/master/packages/mdc-typography/_variables.scss#L60 - */ -html { - - @mixin fontvars display-large, 7.5, 6, 300, -1.5; - @mixin fontvars display-medium, 6.875, 6, 300, -1.5; - @mixin fontvars display-small, 6, 6, 300, -1.5; - @mixin fontvars headline-large, 3.75, 3.75, 300, -.5; - @mixin fontvars headline-medium, 3, 3.125, 400, 0; - @mixin fontvars headline-small, 2.125, 2.5, 400, .25; - @mixin fontvars title-large, 1.5, 2, 400, 0; - @mixin fontvars title-medium, 1.25, 2, 500, 0.15; - @mixin fontvars label-large, 1, 1.75, 400, .15; - @mixin fontvars label-medium, 0.875, 1.375, 500, .1; - @mixin fontvars label-small, 0.75, 2, 500, 1.5; - @mixin fontvars body-large, 1, 1.5, 400, .5; - @mixin fontvars body-medium, 0.875, 1.25, 400, .25; - @mixin fontvars body-small, 0.75, 1.25, 400, .4; -} - -@mixin typography display-large, 7.5, 6, 300; -@mixin typography display-medium, 6.875, 6, 300; -@mixin typography display-small, 6, 6, 300; -@mixin typography headline-large, 3.75, 3.75, 300; -@mixin typography headline-medium, 3, 3.125, 400; -@mixin typography headline-small, 2.125, 2.5, 400; -@mixin typography title-large, 1.5, 2, 400; -@mixin typography title-medium, 1.25, 2, 500; -@mixin typography title-small, 0.875, 1.57, 500; -@mixin typography label-large, 1, 1.75, 400; -@mixin typography label-medium, 0.875, 1.375, 500; -@mixin typography body-large, 1, 1.5, 400; -@mixin typography body-medium, 0.875, 1.25, 400; -@mixin typography body-small, 0.75, 1.25, 400; -@mixin typography label-large, 0.875, 2.25, 500; -@mixin typography label-medium, 0.75, 2, 500; - -/* For `body` types typography should be applied to child elements as well */ -@mixin typography body-large, 1, 1.5, 400, *; -@mixin typography body-medium, 0.875, 1.25, 400, *; - -/* Additional selectors requiring typography styles */ -@mixin selector-typography .mdc-button, label-large, 0.875, 2.25, 500; -@mixin selector-typography .mdc-button .mdc-button__label, label-large, 0.875, 2.25, 500; -@mixin selector-typography .mdc-list-item__primary-text, body-large, 1, 1.5, 400; -@mixin selector-typography .mdc-list-item__secondary-text, body-medium, 0.875, 1.25, 400; - -/* Backward compatibility for old typography classes. */ -@mixin selector-typography .mdc-typography--headline1, display-small, 6, 6, 300; -@mixin selector-typography .mdc-typography--headline2, headline-large, 3.75, 3.75, 300; -@mixin selector-typography .mdc-typography--headline3, headline-medium, 3, 3.125, 400; -@mixin selector-typography .mdc-typography--headline4, headline-small, 2.125, 2.5, 400; -@mixin selector-typography .mdc-typography--headline5, title-large, 1.5, 2, 400; -@mixin selector-typography .mdc-typography--headline6, title-medium, 1.25, 2, 500; -@mixin selector-typography .mdc-typography--subhead1, title-medium, 1.25, 2, 500; -@mixin selector-typography .mdc-typography--subhead2, title-small, 0.875, 1.57, 500; -@mixin selector-typography .mdc-typography--body1, body-large, 1, 1.5, 400; -@mixin selector-typography .mdc-typography--body2, body-medium, 0.875, 1.25, 400; -@mixin selector-typography .mdc-typography--caption, body-small, 0.75, 1.25, 400; -@mixin selector-typography .mdc-typography--button, label-large, 1, 1.75, 400; -@mixin selector-typography .mdc-typography--overline, label-medium, 0.875, 1.375, 500; -@mixin selector-typography .mdc-typography--subtitle1, label-large, 1, 1.75, 400; -@mixin selector-typography .mdc-typography--subtitle2, label-medium, 0.875, 1.375, 500; - -/* Backward compat: For `body` types typography should be applied to child elements as well */ -@mixin selector-typography .mdc-typography--body1 *, body-large, 1, 1.5, 400; -@mixin selector-typography .mdc-typography--body2 *, body-large, 0.875, 1.25, 400; diff --git a/plugin/assets/css/src/wizard.css b/plugin/assets/css/src/wizard.css index f268c6dc5..8ab2fb5db 100644 --- a/plugin/assets/css/src/wizard.css +++ b/plugin/assets/css/src/wizard.css @@ -14,7 +14,7 @@ * limitations under the License. */ -@import "typography.css"; +@import "@material/typography/dist/mdc.typography.css"; @import "@material/layout-grid/dist/mdc.layout-grid.css"; @import "@material/button/dist/mdc.button.css"; @import "@material/switch/dist/mdc.switch.css"; diff --git a/plugin/assets/css/src/wizard/base.css b/plugin/assets/css/src/wizard/base.css index 89483d6fa..a1e9db49d 100644 --- a/plugin/assets/css/src/wizard/base.css +++ b/plugin/assets/css/src/wizard/base.css @@ -15,11 +15,7 @@ */ .material-wizard { - --md-sys-typescale-headline-large-line-height: 2em; - --md-sys-typescale-headline-medium-line-height: 2em; - --md-sys-typescale-headline-small-line-height: 2em; - --md-sys-typescale-title-large-font: "Roboto Mono", monospace; - + --mdc-typography-headline5-font-family: "Roboto Mono", monospace; --material-design-wizard-primary-color: #212121; --material-design-wizard-primary-text: #fff; max-width: 1024px; @@ -51,5 +47,10 @@ } #material-onboarding-wizard { + --mdc-typography-font-family: "Roboto", sans-serif; + --mdc-typography-headline3-font-family: "Roboto", sans-serif; + --mdc-typography-headline4-font-family: "Roboto", sans-serif; + --mdc-typography-body1-font-family: "Roboto", sans-serif; + --mdc-typography-button-font-family: "Roboto", sans-serif; margin-top: -32px; } diff --git a/plugin/assets/css/src/wizard/content.css b/plugin/assets/css/src/wizard/content.css index 26c085591..474b5ac66 100644 --- a/plugin/assets/css/src/wizard/content.css +++ b/plugin/assets/css/src/wizard/content.css @@ -20,11 +20,13 @@ padding: 2.5rem; & p { - font-family: var(--md-sys-typescale-body-large-font, Roboto, sans-serif); - font-size: var(--md-sys-typescale-body-large-size, 1rem); - line-height: var(--md-sys-typescale-body-large-line-height, 1.5); - font-weight: var(--md-sys-typescale-body-large-weight, 400); - letter-spacing: var(--md-sys-typescale-body-large-tracking, 0.03125em); + font-family: var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto,)); + font-size: var(--mdc-typography-body1-font-size, 1rem); + line-height: var(--mdc-typography-body1-line-height, 1.5); + font-weight: var(--mdc-typography-body1-font-weight, 400); + letter-spacing: var(--mdc-typography-body1-letter-spacing, 0.03125em); + text-decoration: var(--mdc-typography-body1-text-decoration, inherit); + text-transform: var(--mdc-typography-body1-text-transform, inherit); } & hr { diff --git a/plugin/assets/importer/demo-content.xml b/plugin/assets/importer/demo-content.xml index 77c4f5d42..c0861820f 100644 --- a/plugin/assets/importer/demo-content.xml +++ b/plugin/assets/importer/demo-content.xml @@ -538,7 +538,7 @@ -
Nulla libero ex

Nulla libero ex

Praesent non convallis tortor. Sed bibendum mauris vel nunc gravida ultrices. Sed elementum augue quis maximus ultrices quisque.
Praesent non convallis

Praesent non convallis

Nullam suscipit, quam eget hendrerit dignissim, ante urna cursus felis, sit amet volutpat mauris arcu eget ante. Sed bibendum mauris vel nunc gravida ultrices.
+
Nulla libero ex

Nulla libero ex

Praesent non convallis tortor. Sed bibendum mauris vel nunc gravida ultrices. Sed elementum augue quis maximus ultrices quisque.
Praesent non convallis

Praesent non convallis

Nullam suscipit, quam eget hendrerit dignissim, ante urna cursus felis, sit amet volutpat mauris arcu eget ante. Sed bibendum mauris vel nunc gravida ultrices.
diff --git a/plugin/assets/src/block-editor/blocks/button/block.json b/plugin/assets/src/block-editor/blocks/button/block.json index a31451d63..9b1e0dfaf 100644 --- a/plugin/assets/src/block-editor/blocks/button/block.json +++ b/plugin/assets/src/block-editor/blocks/button/block.json @@ -77,5 +77,6 @@ "type": "string", "default": "normal" } - } + }, + "apiVersion": 2 } diff --git a/plugin/assets/src/block-editor/blocks/card/components/card-primary.js b/plugin/assets/src/block-editor/blocks/card/components/card-primary.js index a29fa6605..bc94371b6 100644 --- a/plugin/assets/src/block-editor/blocks/card/components/card-primary.js +++ b/plugin/assets/src/block-editor/blocks/card/components/card-primary.js @@ -49,7 +49,7 @@ const CardPrimary = ( { { displayTitle && ( setter( 'title', value, cardIndex ) @@ -63,7 +63,7 @@ const CardPrimary = ( { { displaySecondaryText && ( setter( 'secondaryText', value, cardIndex ) @@ -78,12 +78,12 @@ const CardPrimary = ( { ) : ( <> { displayTitle && ( -

+

{ title }

) } { displaySecondaryText && ( -

+

{ secondaryText }

) } diff --git a/plugin/assets/src/block-editor/blocks/card/components/card-supporting-text.js b/plugin/assets/src/block-editor/blocks/card/components/card-supporting-text.js index 77b60b342..99f230115 100644 --- a/plugin/assets/src/block-editor/blocks/card/components/card-supporting-text.js +++ b/plugin/assets/src/block-editor/blocks/card/components/card-supporting-text.js @@ -52,7 +52,7 @@ const CardSupportingText = ( { 'material-design-card__supporting-text', `material-design-card__supporting-text_${ contentLayout }`, 'mdc-typography', - 'body-medium' + 'mdc-typography--body2' ) } value={ supportingText } onChange={ value => @@ -66,7 +66,7 @@ const CardSupportingText = ( { 'material-design-card__supporting-text', `material-design-card__supporting-text_${ contentLayout }`, 'mdc-typography', - 'body-medium' + 'mdc-typography--body2' ) } > { supportingText } diff --git a/plugin/assets/src/block-editor/blocks/common-posts-list/components/card-header.js b/plugin/assets/src/block-editor/blocks/common-posts-list/components/card-header.js index ead38a16e..70a77d24e 100644 --- a/plugin/assets/src/block-editor/blocks/common-posts-list/components/card-header.js +++ b/plugin/assets/src/block-editor/blocks/common-posts-list/components/card-header.js @@ -34,7 +34,7 @@ import { RawHTML } from '@wordpress/element'; */ const CardHeader = ( { titleTrimmed, displayPostDate, post, dateFormat } ) => (
-

+

{ titleTrimmed ? ( { titleTrimmed } ) : ( @@ -42,7 +42,7 @@ const CardHeader = ( { titleTrimmed, displayPostDate, post, dateFormat } ) => ( ) }

{ displayPostDate && ( -

+

diff --git a/plugin/assets/src/block-editor/blocks/common-posts-list/components/vertical-card-layout.js b/plugin/assets/src/block-editor/blocks/common-posts-list/components/vertical-card-layout.js index 3e1858d65..658a85475 100644 --- a/plugin/assets/src/block-editor/blocks/common-posts-list/components/vertical-card-layout.js +++ b/plugin/assets/src/block-editor/blocks/common-posts-list/components/vertical-card-layout.js @@ -107,7 +107,7 @@ const VerticalCardLayout = props => { 'single-post-card__secondary', `single-post-card__secondary-${ contentLayout }`, 'mdc-typography', - 'body-medium' + 'mdc-typography--body2' ) } > diff --git a/plugin/assets/src/block-editor/blocks/tab-bar/save.js b/plugin/assets/src/block-editor/blocks/tab-bar/save.js index 8fc77d202..49b7449ff 100644 --- a/plugin/assets/src/block-editor/blocks/tab-bar/save.js +++ b/plugin/assets/src/block-editor/blocks/tab-bar/save.js @@ -58,9 +58,12 @@ const TabBarSave = ( { attributes: { tabs, iconPosition } } ) => { { tabs.map( ( tab, index ) => ( { tab.content && Array.isArray( tab.content ) && diff --git a/plugin/assets/src/customizer/components/google-fonts-control/index.js b/plugin/assets/src/customizer/components/google-fonts-control/index.js index 2fac7361f..472b0e986 100644 --- a/plugin/assets/src/customizer/components/google-fonts-control/index.js +++ b/plugin/assets/src/customizer/components/google-fonts-control/index.js @@ -80,8 +80,6 @@ const GoogleFontsControl = props => { const settings = { size: child.sizeValue, weight: child.weightValue, - tracking: child.trackingValue, - lineHeight: child.lineHeightValue, }; childControl.setting.set( JSON.stringify( settings ) ); @@ -99,20 +97,16 @@ const GoogleFontsControl = props => { } const newChildren = children.map( child => { - const { size, weight, tracking, lineHeight } = child; + const { size, weight } = child; setChildValues( { id: child.id, sizeValue: size.default, weightValue: weight.default, - trackingValue: tracking.default, - lineHeightValue: lineHeight.default, } ); size.value = size.default; weight.value = weight.default; - tracking.value = tracking.default; - lineHeight.value = lineHeight.default; return child; } ); @@ -130,8 +124,6 @@ const GoogleFontsControl = props => { child.size.value = values.sizeValue; child.weight.value = values.weightValue; - child.tracking.value = values.trackingValue; - child.lineHeight.value = values.lineHeightValue; return child; } ); diff --git a/plugin/assets/src/customizer/components/google-fonts-control/item.js b/plugin/assets/src/customizer/components/google-fonts-control/item.js index cb25cd5c6..4a9207fd5 100644 --- a/plugin/assets/src/customizer/components/google-fonts-control/item.js +++ b/plugin/assets/src/customizer/components/google-fonts-control/item.js @@ -30,7 +30,7 @@ import { SelectControl } from '@wordpress/components'; import { STYLES } from './styles'; const Item = props => { - const { label, size, weight, lineHeight, id, onChange, tracking } = props; + const { label, size, weight, id, onChange } = props; const [ choices, setChoices ] = useState( [] ); useEffect( () => { @@ -59,44 +59,13 @@ const Item = props => {
- { - const lineHeightValue = event.target.value; - - onChange( { - id, - lineHeightValue, - trackingValue: tracking.value, - sizeValue: size.value, - weightValue: weight.value, - } ); - } } - /> -
-

-
-
- { onChange( { id, sizeValue, - trackingValue: tracking.value, weightValue: weight.value, - lineHeightValue: lineHeight.value, } ); } } />
-
-
- - { - const trackingValue = event.target.value; - onChange( { - id, - trackingValue, - sizeValue: size.value, - weightValue: weight.value, - lineHeightValue: lineHeight.value, - } ); - } } - /> -
-
{ onChange( { id, sizeValue: size.value, - trackingValue: tracking.value, weightValue: value, - lineHeightValue: lineHeight.value, } ) } /> diff --git a/plugin/assets/src/customizer/components/google-fonts-control/style.css b/plugin/assets/src/customizer/components/google-fonts-control/style.css index a80e2b4f8..a3d8260e4 100644 --- a/plugin/assets/src/customizer/components/google-fonts-control/style.css +++ b/plugin/assets/src/customizer/components/google-fonts-control/style.css @@ -27,21 +27,19 @@ .google-fonts-control__values { display: flex; - flex-direction: column; - gap: 20px; } .components-base-control { + width: 40%; - &:last-child .components-base-control__field { - display: block; + &:last-child { + width: 52%; } } .components-base-control__field { align-items: center; display: flex; - justify-content: space-between; & input { max-width: 50%; @@ -59,16 +57,6 @@ padding: 8px 0 8px 8px; } - .components-google-fonts-control__select { - flex-direction: row; - align-items: center; - - & .components-input-control__container { - flex: auto; - max-width: 50%; - } - } - .components-google-fonts-control__select select { max-width: 80%; } diff --git a/plugin/assets/src/customizer/components/material-library/index.js b/plugin/assets/src/customizer/components/material-library/index.js index bd933f6b7..7e0d2b19b 100644 --- a/plugin/assets/src/customizer/components/material-library/index.js +++ b/plugin/assets/src/customizer/components/material-library/index.js @@ -45,40 +45,25 @@ import colorUtils from '../../../common/color-utils'; * Adds link tag with appropriate google fonts to head. * * @param {string} headings Import headings font - * @param {string} headline Import headline font * @param {string} body Import body font - * @param {string} display Import display font - * @param {string} label Import label font * * @return {HTMLLinkElement} Link to google fonts. */ -const googleFontsUrl = ( headings, headline, body, display, label ) => { +const googleFontsUrl = ( headings, body ) => { const join = str => str.replace( ' ', '+' ); const link = document.createElement( 'link' ); - const fonts = [ headline, headings, body, display, label ]; - - // Make fonts unique. - const uniqueFonts = [ ...new Set( fonts ) ]; - - // Clean up empty fonts. - const cleanFonts = uniqueFonts.filter( font => font ); - - // Join fonts into string as pipe. - const fontString = join( cleanFonts.join( '|' ) ); - link.rel = 'stylesheet'; - link.href = `https://fonts.googleapis.com/css?family=${ fontString }`; + link.href = `https://fonts.googleapis.com/css?family=${ join( + headings + ) }|${ join( body ) }`; return link; }; const MaterialLibrary = ( { bodyFontFamily, - labelFontFamily, - headlineFontFamily, - displayFontFamily, - titleFontFamily, + headFontFamily, iconCollection, primaryColor, onPrimaryColor, @@ -97,13 +82,7 @@ const MaterialLibrary = ( { theme, } ) => { const [ link ] = useState( - googleFontsUrl( - titleFontFamily, - headlineFontFamily, - bodyFontFamily, - displayFontFamily, - labelFontFamily - ) + googleFontsUrl( headFontFamily, bodyFontFamily ) ); const iconStyle = materialIconClass( iconCollection ); @@ -116,11 +95,8 @@ const MaterialLibrary = ( { return ( <>
-

+

{ __( 'Material Components', 'material-design' ) }

-

+

{ __( 'Blocks', 'material-design' ) }

@@ -181,7 +157,7 @@ const MaterialLibrary = ( {


-

+

{ __( 'Components', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/buttons.js b/plugin/assets/src/customizer/components/material-library/sections/buttons.js index c80282626..99f030444 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/buttons.js +++ b/plugin/assets/src/customizer/components/material-library/sections/buttons.js @@ -27,7 +27,7 @@ import IconButtonLink from '../common/icon-button-link'; const Buttons = ( { radius, iconStyle, primaryColor } ) => (

-

+

{ __( 'Buttons', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/cards.js b/plugin/assets/src/customizer/components/material-library/sections/cards.js index 50cf23c0a..6e007d0bf 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/cards.js +++ b/plugin/assets/src/customizer/components/material-library/sections/cards.js @@ -27,7 +27,7 @@ import IconButtonLink from '../common/icon-button-link'; const Cards = ( { radius, buttonRadius } ) => (
-

+

{ __( 'Cards', 'material-design' ) }

@@ -59,13 +59,13 @@ const Cards = ( { radius, buttonRadius } ) => ( >

{ __( 'Our Changing Planet', 'material-design' ) }

( { __( 'by John Smith', 'material-design' ) }

-
+
{ __( 'Visit ten places on our planet that are undergoing the biggest changes today.', 'material-design' diff --git a/plugin/assets/src/customizer/components/material-library/sections/checkboxes.js b/plugin/assets/src/customizer/components/material-library/sections/checkboxes.js index 4d2f7ea59..d53d5fae0 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/checkboxes.js +++ b/plugin/assets/src/customizer/components/material-library/sections/checkboxes.js @@ -26,7 +26,7 @@ import IconButtonLink from '../common/icon-button-link'; const Checkboxes = () => (
-

+

{ __( 'Checkboxes', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/chips.js b/plugin/assets/src/customizer/components/material-library/sections/chips.js index e441566c3..e2c31889c 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/chips.js +++ b/plugin/assets/src/customizer/components/material-library/sections/chips.js @@ -33,7 +33,7 @@ import IconButtonLink from '../common/icon-button-link'; */ const Chips = ( { radius } ) => (
-

+

{ __( 'Chips', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/fields.js b/plugin/assets/src/customizer/components/material-library/sections/fields.js index 09cccc4dd..95cc860fd 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/fields.js +++ b/plugin/assets/src/customizer/components/material-library/sections/fields.js @@ -26,7 +26,7 @@ import IconButtonLink from '../common/icon-button-link'; const Fields = ( { radius } ) => (
-

+

{ __( 'Text fields', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/image-lists.js b/plugin/assets/src/customizer/components/material-library/sections/image-lists.js index 009d2fd0d..d4f799e8a 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/image-lists.js +++ b/plugin/assets/src/customizer/components/material-library/sections/image-lists.js @@ -27,7 +27,7 @@ import IconButtonLink from '../common/icon-button-link'; const ImageLists = ( { radius } ) => (
-

+

{ __( 'Gallery (Image Lists)', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/lists.js b/plugin/assets/src/customizer/components/material-library/sections/lists.js index e1f625f03..54a31d7e5 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/lists.js +++ b/plugin/assets/src/customizer/components/material-library/sections/lists.js @@ -31,7 +31,7 @@ import IconButtonLink from '../common/icon-button-link'; const Lists = ( { iconStyle } ) => (
-

+

{ __( 'Lists', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/radios.js b/plugin/assets/src/customizer/components/material-library/sections/radios.js index 7ece299f9..4602b6510 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/radios.js +++ b/plugin/assets/src/customizer/components/material-library/sections/radios.js @@ -26,7 +26,7 @@ import IconButtonLink from '../common/icon-button-link'; const Radios = () => (
-

+

{ __( 'Radio buttons', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/switch.js b/plugin/assets/src/customizer/components/material-library/sections/switch.js index 0a1305380..8a8568e5e 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/switch.js +++ b/plugin/assets/src/customizer/components/material-library/sections/switch.js @@ -26,7 +26,7 @@ import IconButtonLink from '../common/icon-button-link'; const Switch = () => (
-

+

{ __( 'Switches', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/tab-bar.js b/plugin/assets/src/customizer/components/material-library/sections/tab-bar.js index 474754f2e..e56ef4f14 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/tab-bar.js +++ b/plugin/assets/src/customizer/components/material-library/sections/tab-bar.js @@ -31,7 +31,7 @@ import IconButtonLink from '../common/icon-button-link'; const TabBar = ( { iconStyle } ) => (
-

+

{ __( 'Tabs', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/sections/table.js b/plugin/assets/src/customizer/components/material-library/sections/table.js index a8af25c88..ceaf994d4 100644 --- a/plugin/assets/src/customizer/components/material-library/sections/table.js +++ b/plugin/assets/src/customizer/components/material-library/sections/table.js @@ -26,7 +26,7 @@ import IconButtonLink from '../common/icon-button-link'; const Table = ( { radius } ) => (
-

+

{ __( 'Data Tables', 'material-design' ) }

diff --git a/plugin/assets/src/customizer/components/material-library/styles.js b/plugin/assets/src/customizer/components/material-library/styles.js index 6f862d74d..29c1caf15 100644 --- a/plugin/assets/src/customizer/components/material-library/styles.js +++ b/plugin/assets/src/customizer/components/material-library/styles.js @@ -26,21 +26,8 @@ import colorUtils from '../../../common/color-utils'; export const Overrides = createGlobalStyle` :root { - --md-sys-typescale-headline-large-font: ${ props => props.headline }; - --md-sys-typescale-headline-medium-font: ${ props => props.headline }; - --md-sys-typescale-headline-small-font: ${ props => props.headline }; - --md-sys-typescale-body-large-font: ${ props => props.body }; - --md-sys-typescale-body-medium-font: ${ props => props.body }; - --md-sys-typescale-body-small-font: ${ props => props.body }; - --md-sys-typescale-display-large-font: ${ props => props.display }; - --md-sys-typescale-display-medium-font: ${ props => props.display }; - --md-sys-typescale-display-small-font: ${ props => props.display }; - --md-sys-typescale-label-large-font: ${ props => props.label }; - --md-sys-typescale-label-medium-font: ${ props => props.label }; - --md-sys-typescale-label-small-font: ${ props => props.label }; - --md-sys-typescale-title-large-font: ${ props => props.title }; - --md-sys-typescale-title-medium-font: ${ props => props.title }; - --md-sys-typescale-title-small-font: ${ props => props.title }; + --body-font: ${ props => props.body }; + --heading-font: ${ props => props.headings }; --mdc-theme-primary: ${ props => props.primaryColor }; --mdc-theme-secondary: ${ props => props.secondaryColor }; @@ -66,7 +53,7 @@ export const Overrides = createGlobalStyle` --mdc-theme-text-icon-on-background: rgba(--mdc-theme-on-background-rgb, 0.38); } - #mcb-material-library-preview .{ + #mcb-material-library-preview .mdc-typography { font-family: var(--heading-font) !important; } @@ -80,7 +67,7 @@ export const Overrides = createGlobalStyle` #mcb-material-library-preview input[type="text"], #mcb-material-library-preview button:not([class*="material-icons"]), #mcb-material-library-preview span:not([class*="material-icons"]) { - font-family: var(--md-sys-typescale-body-large-font) !important; + font-family: var(--body-font) !important; font-size: 16px; } @@ -89,7 +76,7 @@ export const Overrides = createGlobalStyle` #mcb-material-library-preview h3, #mcb-material-library-preview h4 { color: var(--mdc-theme-on-background) !important; - font-family: var(--md-sys-typescale-title-large-font); + font-family: var(--heading-font); } #mcb-material-library-preview .mdc-list-item__secondary-text { diff --git a/plugin/assets/src/customizer/customize-controls.js b/plugin/assets/src/customizer/customize-controls.js index 8ad36416c..8968ff1d0 100644 --- a/plugin/assets/src/customizer/customize-controls.js +++ b/plugin/assets/src/customizer/customize-controls.js @@ -652,8 +652,6 @@ import handleGlobalStyleResetButtonClick from './components/reset-card-style'; child.size.value = valueObject.size; child.weight.value = valueObject.weight; - child.tracking.value = valueObject.tracking; - child.lineHeight.value = valueObject.lineHeight; return child; } ); diff --git a/plugin/assets/src/customizer/customize-preview.js b/plugin/assets/src/customizer/customize-preview.js index d0ebd6f8e..5d56ea759 100644 --- a/plugin/assets/src/customizer/customize-preview.js +++ b/plugin/assets/src/customizer/customize-preview.js @@ -196,11 +196,7 @@ export const COLOR_MODES = { if ( 'size' === rule ) { styles += `${ typographyControls[ control ][ rule ] }: ${ rules[ rule ] }px !important;`; - } else if ( 'tracking' === rule ) { - // Compute tracking to line-height. - const lineHeight = rules[ rule ] / ( rules.size || 16 ); - styles += `${ typographyControls[ control ][ rule ] }: ${ lineHeight }rem !important;`; - } else if ( 'weight' === rule ) { + } else { const fontStyle = /italic$/.test( rules[ rule ] ) ? 'italic' : 'normal'; @@ -212,8 +208,6 @@ export const COLOR_MODES = { styles += `${ typographyControls[ control ].style }: ${ fontStyle } !important;`; styles += `${ typographyControls[ control ][ rule ] }: ${ weight } !important;`; - } else { - styles += `${ typographyControls[ control ][ rule ] }: ${ rules[ rule ] } !important;`; } } } diff --git a/plugin/assets/src/getting-started/components/content/customize.js b/plugin/assets/src/getting-started/components/content/customize.js index fee766ef8..a437546d0 100644 --- a/plugin/assets/src/getting-started/components/content/customize.js +++ b/plugin/assets/src/getting-started/components/content/customize.js @@ -29,10 +29,10 @@ import getConfig from '../../get-config'; export const Customize = () => { return ( -

+

{ __( 'Customize your Theme', 'material-design' ) }

-

+

{ __( 'Set and preview your global theme styles using the Material Design options in the Customize panel. Choose colors, typography, shapes, and icons to express your unique style. Once you’re satisfied with your changes, hit “Publish” to update your site.', 'material-design' @@ -56,11 +56,11 @@ export const Customize = () => { />

-

+

{ __( 'Starter Styles', 'material-design' ) }

-

+

{ __( 'Start from our existing styles and use ', 'material-design' @@ -78,10 +78,10 @@ export const Customize = () => { ) }

-

+

{ __( 'Color Palettes', 'material-design' ) }

-

+

{ __( 'Change your primary and secondary colors and see them applied throughout your site. Need help picking colors? Try Material’s ', 'material-design' @@ -99,11 +99,11 @@ export const Customize = () => { ) }

-

+

{ __( 'Typography', 'material-design' ) }

-

+

{ __( 'Choose from more than 1,000 typefaces in ', 'material-design' @@ -132,20 +132,20 @@ export const Customize = () => { ) }

-

+

{ __( 'Corner Styles', 'material-design' ) }

-

+

{ __( 'Material Design systematically applies a shape scheme across components. Change the global corner radius for all blocks or individually for each Material block.', 'material-design' ) }

-

+

{ __( 'Icon Style', 'material-design' ) }

-

+

{ __( 'All ', 'material-design' ) } { ) }

-

+

{ __( 'Set Layout & Navigation', 'material-design' ) }

-

+

{ __( 'Select how posts display – as either cards or image lists, in a wide or normal width. Additional card display options include raised or outlined cards, and show or hide post comments, author, excerpt, and date. ', 'material-design' @@ -174,21 +174,21 @@ export const Customize = () => { ) }

-

+

{ __( 'Top app bar', 'material-design' ) }

-

+

{ __( 'Choose tabs, navigation drawer, or both for your site navigation. Give users the ability to search your site from within the top app bar. By default, the top app bar will hide when scrolling up, choose “Fixed” to keep the app bar visible at all times.', 'material-design' ) }

-

+

{ __( 'Footer', 'material-design' ) }

-

+

{ __( 'Add footer text and give your users a quick way to jump back to the top of the page. Looking to add widgets at the bottom of your site? Use the ', 'material-design' diff --git a/plugin/assets/src/getting-started/components/content/learn-content.js b/plugin/assets/src/getting-started/components/content/learn-content.js index 29a747a21..a2c51f57b 100644 --- a/plugin/assets/src/getting-started/components/content/learn-content.js +++ b/plugin/assets/src/getting-started/components/content/learn-content.js @@ -24,7 +24,7 @@ import Button from '../../../wizard/components/navigation/button'; export const LearnContent = ( { materialUrl, newsLetterUrl } ) => { return ( -

+

{ __( 'Learn about the concepts behind material Design', 'material-design' @@ -41,7 +41,7 @@ export const LearnContent = ( { materialUrl, newsLetterUrl } ) => { />

-

+

{ __( 'Sign up to get updates and news about material design via email', 'material-design' diff --git a/plugin/assets/src/getting-started/components/content/learn.js b/plugin/assets/src/getting-started/components/content/learn.js index 2fd3c7c62..de7128f84 100644 --- a/plugin/assets/src/getting-started/components/content/learn.js +++ b/plugin/assets/src/getting-started/components/content/learn.js @@ -26,7 +26,7 @@ export const Learn = () => { return (

-

+

{ __( 'Learn More about Material Design', 'material-design' diff --git a/plugin/assets/src/getting-started/components/content/overview.js b/plugin/assets/src/getting-started/components/content/overview.js index 1aa3e7493..074a9aa03 100644 --- a/plugin/assets/src/getting-started/components/content/overview.js +++ b/plugin/assets/src/getting-started/components/content/overview.js @@ -29,11 +29,11 @@ import getConfig from '../../get-config'; export const Overview = () => { return ( -

+

{ __( 'Build with Material Blocks', 'material-design' ) }

-

+

{ __( 'Add Material Components like buttons and cards, and create layouts for things like image-heavy pages or styled contact forms. Customize the look of your blocks by adjusting global theme styles, or setting the style of a single component in the block editor.', 'material-design' diff --git a/plugin/assets/src/getting-started/components/content/updates.js b/plugin/assets/src/getting-started/components/content/updates.js index d35346fca..b34a23e8a 100644 --- a/plugin/assets/src/getting-started/components/content/updates.js +++ b/plugin/assets/src/getting-started/components/content/updates.js @@ -76,7 +76,7 @@ export const Updates = () => { return (

-

+

{ __( 'Font and Icons Updates', 'material-design' ) }

diff --git a/plugin/assets/src/getting-started/components/content/wizard.js b/plugin/assets/src/getting-started/components/content/wizard.js index faaca68e3..eae285cd2 100644 --- a/plugin/assets/src/getting-started/components/content/wizard.js +++ b/plugin/assets/src/getting-started/components/content/wizard.js @@ -28,7 +28,7 @@ import getConfig from '../../get-config'; export const Wizard = props => { return ( <> -

+

{ __( 'Install the Material Design Theme and quick start examples', 'material-design' diff --git a/plugin/assets/src/getting-started/components/index.js b/plugin/assets/src/getting-started/components/index.js index d2032a857..4f62060ab 100644 --- a/plugin/assets/src/getting-started/components/index.js +++ b/plugin/assets/src/getting-started/components/index.js @@ -24,7 +24,7 @@ import Content from './content'; const GettingStarted = () => { return ( -
+
diff --git a/plugin/assets/src/getting-started/components/navigation/index.js b/plugin/assets/src/getting-started/components/navigation/index.js index ea8882546..41bc23ec9 100644 --- a/plugin/assets/src/getting-started/components/navigation/index.js +++ b/plugin/assets/src/getting-started/components/navigation/index.js @@ -72,7 +72,7 @@ const Navigation = () => { return (
-
+
{ __( 'Getting Started', 'material-design' ) }
diff --git a/plugin/assets/src/settings/components/index.js b/plugin/assets/src/settings/components/index.js index 20bf73ae2..c03f79267 100644 --- a/plugin/assets/src/settings/components/index.js +++ b/plugin/assets/src/settings/components/index.js @@ -29,7 +29,7 @@ import Integrations from './integrations'; const Settings = () => { return ( -

+

{ __( 'Material Settings', 'material-design' ) }

diff --git a/plugin/assets/src/settings/components/integrations/index.js b/plugin/assets/src/settings/components/integrations/index.js index cc2e1ff57..78daf3fbb 100644 --- a/plugin/assets/src/settings/components/integrations/index.js +++ b/plugin/assets/src/settings/components/integrations/index.js @@ -38,12 +38,12 @@ const Integrations = () => { return (
-

+

{ __( 'Integrations', 'material-design' ) }

{ } } >

-

+

{ __( 'Turn on auto-updater or update your resources manually.', 'material-design' @@ -90,12 +90,12 @@ const Integrations = () => { ) ) }

-

+

{ __( 'Google API Key', 'material-design' ) }

-

{ title }

+

{ title }

{ isDisabled && (

+

{ sprintf( // translators: %s: last updated date. __( @@ -151,7 +151,7 @@ const Updater = ( { ) } { versionAvailable && ( -

+

{ sprintf( // translators: %s: version number. __( diff --git a/plugin/assets/src/wizard/components/content/addons.js b/plugin/assets/src/wizard/components/content/addons.js index b37e4ac4c..820716382 100644 --- a/plugin/assets/src/wizard/components/content/addons.js +++ b/plugin/assets/src/wizard/components/content/addons.js @@ -32,7 +32,7 @@ import getConfig from '../../../admin/get-config'; const Addons = () => { return (

-

+

{ __( 'Install addons', 'material-design' ) }

@@ -43,7 +43,7 @@ const Addons = () => { switch={ ADDONS.THEME } disabled={ 'ok' === getConfig( 'themeStatus' ) } > -

+

{ __( 'Material Design Theme', 'material-design' ) }

@@ -63,7 +63,7 @@ const Addons = () => { ) }addon-quick-start-examples.png` } switch={ ADDONS.DEMO } > -

+

{ __( 'Quick Start Examples', 'material-design' ) }

diff --git a/plugin/assets/src/wizard/components/content/welcome.js b/plugin/assets/src/wizard/components/content/welcome.js index 06bc87103..b290b2e6f 100644 --- a/plugin/assets/src/wizard/components/content/welcome.js +++ b/plugin/assets/src/wizard/components/content/welcome.js @@ -35,7 +35,7 @@ const Welcome = () => { image={ `${ getConfig( 'assetsPath' ) }welcome.png` } imageSpan="5" > -

+

{ __( 'Start building', 'material-design' ) }

diff --git a/plugin/assets/src/wizard/components/content/work.js b/plugin/assets/src/wizard/components/content/work.js index 1349a5bf1..9b5733d6f 100644 --- a/plugin/assets/src/wizard/components/content/work.js +++ b/plugin/assets/src/wizard/components/content/work.js @@ -38,7 +38,7 @@ const Work = () => { ) }complete-build-with-blocks.png` } imageSpan="5" > -

+

{ __( 'Congrats!', 'material-design' ) }

diff --git a/plugin/assets/src/wizard/components/header/index.js b/plugin/assets/src/wizard/components/header/index.js index 0e66e312b..f4e52aa2f 100644 --- a/plugin/assets/src/wizard/components/header/index.js +++ b/plugin/assets/src/wizard/components/header/index.js @@ -34,7 +34,7 @@ const Header = () => { { }
-

+

{ __( 'Material Design for WordPress', 'material-design' ) }

diff --git a/plugin/php/class-admin.php b/plugin/php/class-admin.php index 1c8459959..7f80b36cc 100644 --- a/plugin/php/class-admin.php +++ b/plugin/php/class-admin.php @@ -139,7 +139,7 @@ public function render_onboarding_wizard_page() { */ public function render_settings_page() { ?> -
+
'display_small', - 'headline_2' => 'headline_large', - 'headline_3' => 'headline_medium', - 'headline_4' => 'headline_small', - 'headline_5' => 'title_large', - 'headline_6' => 'title_large', - 'subhead_1' => 'title_medium', - 'subhead_2' => 'title_small', - 'body_1' => 'body_large', - 'body_2' => 'body_medium', - 'caption' => 'body_small', - 'button' => 'label_large', - 'overline' => 'label_medium', - 'subtitle_1' => 'label_large', - 'subtitle_2' => 'label_medium', - 'head_font_family' => [ 'display_font_family', 'headline_font_family' ], - ]; - - $slug = $this->plugin->customizer_controls->slug; - - $option = get_option( $slug, [] ); - - foreach ( $map as $m2_key => $m3_key ) { - if ( is_array( $m3_key ) ) { - foreach ( $m3_key as $sub_m3_key ) { - if ( isset( $option[ $m2_key ] ) ) { - $option[ $sub_m3_key ] = $option[ $m2_key ]; - } - } - unset( $option[ $m2_key ] ); - } else { - if ( isset( $option[ $m2_key ] ) ) { - $option[ $m3_key ] = $option[ $m2_key ]; - unset( $option[ $m2_key ] ); - } - } - } - - update_option( $slug, $option ); - - $migration_option['typography'] = true; - update_option( self::MIGRATION_KEY, $migration_option ); - } - -} diff --git a/plugin/php/class-plugin.php b/plugin/php/class-plugin.php index 745d5b584..5317917f2 100644 --- a/plugin/php/class-plugin.php +++ b/plugin/php/class-plugin.php @@ -145,13 +145,6 @@ class Plugin extends Plugin_Base { */ public $frontend; - /** - * Migration class. - * - * @var Migration - */ - public $migration; - /** * Initiate the plugin resources. * @@ -196,9 +189,6 @@ public function init() { $this->frontend = new Frontend( $this ); $this->frontend->init(); - $this->migration = new Migration( $this ); - $this->migration->init(); - // Init CLI. if ( defined( 'WP_CLI' ) && false !== WP_CLI ) { $this->fonts = new Fonts(); diff --git a/plugin/php/customizer/class-controls.php b/plugin/php/customizer/class-controls.php index 9a42fe7ad..684e2d2aa 100644 --- a/plugin/php/customizer/class-controls.php +++ b/plugin/php/customizer/class-controls.php @@ -87,7 +87,7 @@ public function init() { /** * Register customizer options. * - * @param \WP_Customize_Manager $wp_customize Theme Customizer object. + * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function register( $wp_customize ) { $this->wp_customize = $wp_customize; @@ -393,13 +393,11 @@ public function add_typography_controls() { /** * Generate list of all the settings in the Typography section. */ - $settings = []; - $typography_controls = $this->get_typography_controls(); - $extra_controls = call_user_func_array( 'array_merge', wp_list_pluck( $typography_controls, 'choices' ) ); - + $settings = []; $all_controls = array_merge( - $typography_controls, - $extra_controls + $this->get_typography_controls(), + $this->get_typography_extra_controls(), + $this->get_typography_extra_controls( false ) ); foreach ( $all_controls as $control ) { @@ -413,7 +411,7 @@ public function add_typography_controls() { */ $controls = []; - foreach ( $typography_controls as $control ) { + foreach ( $all_controls as $control ) { $controls[ $control['id'] ] = new Google_Fonts_Control( $this->wp_customize, $this->prepare_option_name( $control['id'] ), @@ -425,20 +423,6 @@ public function add_typography_controls() { 'choices' => ( ! empty( $control['choices'] ) ) ? $control['choices'] : [], ] ); - - foreach ( $control['choices'] as $choice ) { - $controls[ $choice['id'] ] = new Google_Fonts_Control( - $this->wp_customize, - $this->prepare_option_name( $choice['id'] ), - [ - 'section' => 'typography', - 'priority' => 10, - 'label' => $choice['label'], - 'css_vars' => $choice['css_vars'], - 'choices' => ( ! empty( $choice['choices'] ) ) ? $choice['choices'] : [], - ] - ); - } } $this->add_controls( $controls ); @@ -772,55 +756,54 @@ function ( $image ) { * @return string */ public function get_google_fonts_url( $context = '' ) { - $icons_style = $this->get_icon_style( '+' ); - $merged_fonts = [ 'Material+Icons' . $icons_style ]; - $fonts = []; + $icons_style = $this->get_icon_style( '+' ); + $font_families = [ 'Material+Icons' . $icons_style ]; + $fonts = []; if ( 'block-editor' === $context ) { - $merged_fonts[] = 'Material+Icons+Outlined'; + $font_families[] = 'Material+Icons+Outlined'; } // Get the font families used. foreach ( $this->get_typography_controls() as $control ) { - $fonts[ $control['id'] ] = [ + $type = 'head_font_family' === $control['id'] ? 'head' : 'body'; + $fonts[ $type ] = [ 'family' => $this->get_option( $control['id'] ), 'variants' => [], ]; } + // Get the extra font controls. + $typography_extra_controls = array_merge( + $this->get_typography_extra_controls(), + $this->get_typography_extra_controls( false ) + ); + // Get the variant/weight used for each font control. - foreach ( $this->get_typography_controls() as $c ) { - $variants = []; - foreach ( $c['choices'] as $control ) { - $value = json_decode( $this->get_option( $control['id'] ), true ); - - if ( ! empty( $value ) && ! empty( $value['weight'] ) ) { - $weight = $value['weight']; - } else { - $weight = $control['weight']['default']; - } + foreach ( $typography_extra_controls as $control ) { + $value = json_decode( $this->get_option( $control['id'] ), true ); + $weight = 'regular'; - $variants[] = $weight; + if ( ! empty( $value ) && ! empty( $value['weight'] ) ) { + $weight = $value['weight']; + } else { + $weight = $control['weight']['default']; + } + if ( false !== strpos( $control['id'], 'headline_' ) ) { + $fonts['head']['variants'][] = $weight; + } else { + $fonts['body']['variants'][] = $weight; } - $fonts[ $c['id'] ]['variants'] = $variants; } - // Use font family with key to make it unique and merge it's variants. - $font_families = []; foreach ( $fonts as $font ) { - $variants = str_replace( 'regular', '400', implode( ',', array_unique( $font['variants'] ) ) ); - $font_family = str_replace( ' ', '+', $font['family'] ); - $font_families[ $font_family ] = array_merge( isset( $font_families[ $font_family ] ) ? $font_families[ $font_family ] : [], explode( ',', $variants ) ); - } - - // Merge variants and make it unique. - foreach ( $font_families as $family => $variants ) { - $merged_fonts[] = $family . ':' . implode( ',', array_unique( $variants ) ); + $variants = str_replace( 'regular', '400', implode( ',', array_unique( $font['variants'] ) ) ); + $font_families[] = str_replace( ' ', '+', $font['family'] ) . ':' . $variants; } $fonts_url = - add_query_arg( 'family', implode( '|', $merged_fonts ), '//fonts.googleapis.com/css' ); + add_query_arg( 'family', implode( '|', array_unique( $font_families ) ), '//fonts.googleapis.com/css' ); /** * Filter Google Fonts URL. @@ -908,8 +891,7 @@ public function get_frontend_css() { $color_vars[] = esc_html( "--mdc-theme-surface-mix-12: $mix_12;" ); } - $typography_controls = $this->get_typography_controls(); - foreach ( $typography_controls as $control ) { + foreach ( $this->get_typography_controls() as $control ) { $value = $this->get_option( $control['id'] ); $fallback = 'sans-serif'; @@ -931,10 +913,10 @@ public function get_frontend_css() { } } - $typography_extra_controls = wp_list_pluck( $typography_controls, 'choices' ); - - // Merge all controls. - $typography_extra_controls = call_user_func_array( 'array_merge', $typography_extra_controls ); + $typography_extra_controls = array_merge( + $this->get_typography_extra_controls(), + $this->get_typography_extra_controls( false ) + ); foreach ( $typography_extra_controls as $control ) { $value = json_decode( $this->get_option( $control['id'] ), true ); @@ -953,7 +935,7 @@ public function get_frontend_css() { esc_html( $var ), esc_html( $value[ $type ] ) ); - } elseif ( 'weight' === $type ) { + } else { $font_vars[] = sprintf( '%s: %s !important;', esc_html( $var ), @@ -969,20 +951,6 @@ public function get_frontend_css() { esc_html( $control['css_vars']['style'] ), esc_html( $font_style ) ); - } elseif ( 'tracking' === $type ) { - $font_size = isset( $value['size'] ) ? $value['size'] : 16; - $line_height = $value[ $type ] / $font_size; - $font_vars[] = sprintf( - '%s: %srem !important;', - esc_html( $var ), - esc_html( $line_height ) - ); - } else { - $font_vars[] = sprintf( - '%s: %s !important;', - esc_html( $var ), - esc_html( $value[ $type ] ) - ); } } } @@ -1127,10 +1095,7 @@ public function get_design_styles() { 'on_background_color_dark' => '#ffffff', 'footer_color' => '#ffffff', 'on_footer_color' => '#000000', - 'display_font_family' => 'Roboto', - 'headline_font_family' => 'Roboto', - 'title_font_family' => 'Roboto', - 'label_font_family' => 'Roboto', + 'head_font_family' => 'Roboto', 'body_font_family' => 'Roboto', 'global_radius' => '4', 'button_radius' => '4', @@ -1165,10 +1130,7 @@ public function get_design_styles() { 'on_background_color' => '#000000', 'footer_color' => '#ffffff', 'on_footer_color' => '#000000', - 'display_font_family' => 'Raleway', - 'headline_font_family' => 'Raleway', - 'title_font_family' => 'Raleway', - 'label_font_family' => 'Raleway', + 'head_font_family' => 'Raleway', 'body_font_family' => 'Raleway', 'global_radius' => '16', 'button_radius' => '16', @@ -1203,10 +1165,7 @@ public function get_design_styles() { 'on_background_color' => '#000000', 'footer_color' => '#ffffff', 'on_footer_color' => '#000000', - 'display_font_family' => 'Merriweather', - 'headline_font_family' => 'Merriweather', - 'title_font_family' => 'Merriweather', - 'label_font_family' => 'Merriweather', + 'head_font_family' => 'Merriweather', 'body_font_family' => 'Merriweather', 'global_radius' => '0', 'button_radius' => '0', @@ -1241,10 +1200,7 @@ public function get_design_styles() { 'on_background_color' => '#442c2e', 'footer_color' => '#fff1ee', 'on_footer_color' => '#442c2e', - 'display_font_family' => 'Rubik', - 'headline_font_family' => 'Rubik', - 'title_font_family' => 'Rubik', - 'label_font_family' => 'Rubik', + 'head_font_family' => 'Rubik', 'body_font_family' => 'Rubik', 'global_radius' => '8', 'button_radius' => '8', @@ -1352,31 +1308,40 @@ public function get_color_controls_variant( $variant ) { * @return array */ public function get_typography_controls() { - $default_fonts = [ - 'display' => 'Roboto', - 'headline' => 'Roboto', - 'title' => 'Roboto Medium', - 'label' => 'Roboto Medium', - 'body' => 'Roboto Medium', - ]; - - $controls = []; - foreach ( $default_fonts as $base_key => $default_font ) { - $controls[] = [ - 'id' => sprintf( '%s_font_family', $base_key ), - 'label' => ucfirst( $base_key ), + return [ + [ + 'id' => 'head_font_family', + 'label' => __( 'Headlines & Subtitles', 'material-design' ), 'css_vars' => [ 'family' => [ - sprintf( '--md-sys-typescale-%s-large-font', $base_key ), - sprintf( '--md-sys-typescale-%s-medium-font', $base_key ), - sprintf( '--md-sys-typescale-%s-small-font', $base_key ), + '--mdc-typography-headline1-font-family', + '--mdc-typography-headline2-font-family', + '--mdc-typography-headline3-font-family', + '--mdc-typography-headline4-font-family', + '--mdc-typography-headline5-font-family', + '--mdc-typography-headline6-font-family', + '--mdc-typography-subtitle1-font-family', + '--mdc-typography-subtitle2-font-family', ], ], - 'choices' => $this->get_typography_extra_controls( $base_key ), - ]; - } - - return $controls; + 'choices' => $this->get_typography_extra_controls(), + ], + [ + 'id' => 'body_font_family', + 'label' => __( 'Body & Captions', 'material-design' ), + 'css_vars' => [ + 'family' => [ + '--mdc-typography-font-family', + '--mdc-typography-body1-font-family', + '--mdc-typography-body2-font-family', + '--mdc-typography-caption-font-family', + '--mdc-typography-button-font-family', + '--mdc-typography-overline-font-family', + ], + ], + 'choices' => $this->get_typography_extra_controls( false ), + ], + ]; } /** @@ -1675,212 +1640,143 @@ public function get_typography_size_controls( $args ) { return $args; } - /** - * Get tracking controls. - * - * @param mixed $args Customized values. - * - * @return array Values to use in control. - */ - public function get_tracking_controls( $args ) { - $args = wp_parse_args( - $args, - [ - 'label' => __( 'Tracking (Letter spacing)', 'material-design' ), - 'type' => 'number', - 'min' => -5, - 'default' => 0, - 'max' => 100, - ] - ); - - return $args; - } - - /** - * Get tracking controls. - * - * @param mixed $args Customized values. - * - * @return array Values to use in control. - */ - public function get_line_height_controls( $args ) { - $args = wp_parse_args( - $args, - [ - 'label' => __( 'Line height', 'material-design' ), - 'type' => 'number', - 'min' => 0, - 'default' => 0, - 'max' => 64, - ] - ); - - return $args; - } - /** * Build typography size and weight controls. * - * @param string $token Token name like Display, Headline, Title etc.. + * @param bool $headlines Whether or not this are headlines. * * @return array Values for controllers. */ - public function get_typography_extra_controls( $token ) { + public function get_typography_extra_controls( $headlines = true ) { $controls = []; - $default_fonts_size = [ - 'display' => [ - 'large' => 120, - 'medium' => 110, - 'small' => 96, - ], - 'headline' => [ - 'large' => 60, - 'medium' => 48, - 'small' => 34, - ], - 'title' => [ - 'large' => 24, - 'medium' => 20, - 'small' => 16, - ], - 'label' => [ - 'large' => 16, - 'medium' => 14, - 'small' => 11, - ], - 'body' => [ - 'large' => 16, - 'medium' => 14, - 'small' => 12, - ], - ]; - - $default_tracking = [ - 'display' => [ - 'large' => -1.5, - 'medium' => -1.5, - 'small' => -1.5, - ], - 'headline' => [ - 'large' => -0.5, - 'small' => 0.25, - ], - 'title' => [ - 'medium' => 0.15, - 'small' => 0.1, - ], - 'label' => [ - 'large' => 0.15, - 'medium' => 0.1, - 'small' => 0.1, - ], - 'body' => [ - 'large' => 0.25, - 'medium' => 0.4, - 'small' => 0.4, - ], - ]; + if ( $headlines ) { + $default_sizes = [ 96, 60, 48, 34, 24, 20 ]; + $default_weights = [ + '100', + '100', + 'regular', + 'regular', + 'regular', + '500', + ]; - $default_weight = [ - 'display' => [ - 'large' => 300, - 'medium' => 300, - 'small' => 300, - ], - 'headline' => [ - 'large' => 300, - 'medium' => 400, - 'small' => 400, - ], - 'title' => [ - 'large' => 400, - 'medium' => 500, - 'small' => 500, - ], - 'label' => [ - 'large' => 400, - 'medium' => 500, - 'small' => 500, - ], - 'body' => [ - 'large' => 400, - 'medium' => 400, - 'small' => 400, - ], - ]; + for ( $i = 1; $i < 7; $i ++ ) { + $id = sprintf( 'headline_%s', $i ); + $controls[] = [ + 'id' => $id, + 'setting' => $this->prepare_option_name( $id ), + 'css_vars' => [ + 'size' => sprintf( '--mdc-typography-headline%s-font-size', $i ), + 'weight' => sprintf( '--mdc-typography-headline%s-font-weight', $i ), + 'style' => sprintf( '--mdc-typography-headline%s-font-style', $i ), + ], + 'value' => $this->get_option( $id ), + 'label' => sprintf( + /* translators: Number of heading to display */ + esc_html__( 'Headline %s', 'material-design' ), + $i + ), + 'size' => $this->get_typography_size_controls( + [ + 'default' => intval( $default_sizes[ $i - 1 ] ), + 'max' => 96, + ] + ), + 'weight' => $this->get_typography_weight_controls( + [ + 'default' => $default_weights[ $i - 1 ], + ] + ), + ]; + } - $default_line_height = [ - 'display' => [ - 'large' => 6, - 'medium' => 6, - 'small' => 6, - ], - 'headline' => [ - 'large' => 3.75, - 'medium' => 3.125, - 'small' => 2.5, - ], - 'title' => [ - 'large' => 2, - 'medium' => 2, - 'small' => 1.75, - ], - 'label' => [ - 'large' => 1.75, - 'medium' => 1.375, - 'small' => 1.125, - ], - 'body' => [ - 'large' => 1.5, - 'medium' => 1.25, - 'small' => 1.25, - ], - ]; + $default_sizes = [ 16, 14 ]; + $default_weights = [ + 'regular', + '500', + ]; - $sub_tokens = [ 'large', 'medium', 'small' ]; - - foreach ( $sub_tokens as $sub_t ) { - $id = sprintf( '%s_%s', $token, $sub_t ); - $controls[] = [ - 'id' => $id, - 'setting' => $this->prepare_option_name( $id ), - 'css_vars' => [ - 'lineHeight' => sprintf( '--md-sys-typescale-%s-%s-line-height', $token, $sub_t ), - 'size' => sprintf( '--md-sys-typescale-%s-%s-size', $token, $sub_t ), - 'tracking' => sprintf( '--md-sys-typescale-%s-%s-tracking', $token, $sub_t ), - 'weight' => sprintf( '--md-sys-typescale-%s-%s-weight', $token, $sub_t ), + for ( $i = 1; $i < 3; $i ++ ) { + $id = sprintf( 'subtitle_%s', $i ); + $controls[] = [ + 'id' => $id, + 'setting' => $this->prepare_option_name( $id ), + 'css_vars' => [ + 'size' => sprintf( '--mdc-typography-subtitle%s-font-size', $i ), + 'weight' => sprintf( '--mdc-typography-subtitle%s-font-weight', $i ), + 'style' => sprintf( '--mdc-typography-subtitle%s-font-style', $i ), + ], + 'value' => $this->get_option( $id ), + 'label' => sprintf( + /* translators: Number of heading to display */ + esc_html__( 'Subtitle %s', 'material-design' ), + $i + ), + 'size' => $this->get_typography_size_controls( + [ + 'default' => intval( $default_sizes[ $i - 1 ] ), + ] + ), + 'weight' => $this->get_typography_weight_controls( + [ + 'default' => $default_weights[ $i - 1 ], + ] + ), + ]; + } + } else { + $keys = [ + 'body1' => [ + 'label' => __( 'Body 1', 'material-design' ), + 'size' => 16, + 'weight' => 'regular', + ], + 'body2' => [ + 'label' => __( 'Body 2', 'material-design' ), + 'size' => 14, + 'weight' => 'regular', + ], + 'button' => [ + 'label' => __( 'Button', 'material-design' ), + 'size' => 14, + 'weight' => '500', + ], + 'caption' => [ + 'label' => __( 'Caption', 'material-design' ), + 'size' => 12, + 'weight' => 'regular', + ], + 'overline' => [ + 'label' => __( 'Overline', 'material-design' ), + 'size' => 10, + 'weight' => 'regular', ], - 'value' => $this->get_option( $id ), - 'label' => sprintf( - /* translators: %1$s Token and %2$s Sub-token name. */ - esc_html__( '%1$s %2$s', 'material-design' ), - ucfirst( $token ), - $sub_t - ), - 'size' => $this->get_typography_size_controls( - [ - 'default' => $default_fonts_size[ $token ][ $sub_t ], - 'max' => 140, - ] - ), - 'weight' => $this->get_typography_weight_controls( - [ - 'default' => $default_weight[ $token ][ $sub_t ], - ] - ), - 'lineHeight' => $this->get_line_height_controls( - [ - 'default' => $default_line_height[ $token ][ $sub_t ], - ] - ), - 'tracking' => $this->get_tracking_controls( - [ - 'default' => isset( $default_tracking[ $token ][ $sub_t ] ) ? $default_tracking[ $token ][ $sub_t ] : 0, - ] - ), ]; + + foreach ( $keys as $key => $settings ) { + $controls[] = [ + 'id' => esc_html( $key ), + 'setting' => $this->prepare_option_name( $key ), + 'label' => esc_html( $settings['label'] ), + 'css_vars' => [ + 'size' => sprintf( '--mdc-typography-%s-font-size', $key ), + 'weight' => sprintf( '--mdc-typography-%s-font-weight', $key ), + 'style' => sprintf( '--mdc-typography-%s-font-style', $key ), + ], + 'value' => $this->get_option( $key ), + 'size' => $this->get_typography_size_controls( + [ + 'default' => intval( $settings['size'] ), + ] + ), + 'weight' => $this->get_typography_weight_controls( + [ + 'default' => $settings['weight'], + ] + ), + ]; + } } return $controls; diff --git a/plugin/php/templates/partials/card-content.php b/plugin/php/templates/partials/card-content.php index 766994ee7..f01c49182 100644 --- a/plugin/php/templates/partials/card-content.php +++ b/plugin/php/templates/partials/card-content.php @@ -33,7 +33,7 @@ $post_content = wp_trim_words( get_the_excerpt(), $content_length, ' […]' ); if ( ! empty( $show_content ) && ! empty( $post_content ) ) : ?> -
+

diff --git a/plugin/php/templates/partials/card-header.php b/plugin/php/templates/partials/card-header.php index 604c76845..670c54682 100644 --- a/plugin/php/templates/partials/card-header.php +++ b/plugin/php/templates/partials/card-header.php @@ -30,12 +30,12 @@ ?>
-

+

-

+

diff --git a/plugin/tests/e2e/specs/block-editor/blocks/render/blocks.html b/plugin/tests/e2e/specs/block-editor/blocks/render/blocks.html index 0d6d2db33..550194ea7 100644 --- a/plugin/tests/e2e/specs/block-editor/blocks/render/blocks.html +++ b/plugin/tests/e2e/specs/block-editor/blocks/render/blocks.html @@ -52,7 +52,6 @@

@@ -64,19 +63,21 @@
- Card Title
-

Card - Title

-

Card Secondary

-
+ class="mdc-card__media mdc-card__media--16-9 material-design-card__media material-design-card-with-text-under-media"> + Card Title
+

Card Title

+

Card Secondary

+
+
Card Supporting
- @@ -84,30 +85,29 @@

Card Secondary

- +
  • accessibilityList Item 1
  • + class="mdc-list-item__text">List Item 1
  • account_balance_walletList Item 2
  • + class="mdc-list-item__text">List Item 2
  • account_treeList Item 3
  • + class="mdc-list-item__text">List Item 3
  • 6_ft_apartList Item 4
  • + class="mdc-list-item__text">List Item 4
  • 5gList Item 5
  • + class="mdc-list-item__text">List Item 5
  • account_balance_walletList Item 6
  • + class="mdc-list-item__text">List Item 6
@@ -214,21 +213,20 @@

test

  • + href="http://localhost:8088/wp-content/uploads/2020/10/material-demo-photo-1558905586-b023029262f1-5-683x1024.jpeg">
  • + href="http://localhost:8088/wp-content/uploads/2020/10/material-demo-photo-1558905585-24d5d344c91d-5-1024x683.jpeg">
  • -
  • + href="http://localhost:8088/wp-content/uploads/2020/10/material-demo-photo-1531306760863-7fb02a41db12-5-1024x683.jpeg">
@@ -241,58 +239,53 @@

test

+ id="material-design-name-7" name="material-design-name-7" type="text" required class="mdc-text-field__input" + aria-labelledby="label-material-design-name-7" data-form="contact" data-meta="name" data-label="Name" />
-
+ +
+ id="material-design-email-9" name="material-design-email-9" type="email" required class="mdc-text-field__input" + aria-labelledby="label-material-design-email-9" data-form="contact" data-meta="email" data-label="Email" />
-
+ +
+ id="material-design-website-11" name="material-design-website-11" type="url" class="mdc-text-field__input" + aria-labelledby="label-material-design-website-11" data-form="contact" data-meta="website" data-label="Website" />
- -
+
+ class="mdc-text-field__ripple">
- -
+
-
diff --git a/plugin/tests/js/block-editor/blocks/card/__snapshots__/edit.test.js.snap b/plugin/tests/js/block-editor/blocks/card/__snapshots__/edit.test.js.snap index 09754871e..4de0ec88f 100644 --- a/plugin/tests/js/block-editor/blocks/card/__snapshots__/edit.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/__snapshots__/edit.test.js.snap @@ -566,7 +566,7 @@ Object {

@@ -575,7 +575,7 @@ Object {

@@ -585,7 +585,7 @@ Object {
@@ -1176,7 +1176,7 @@ Object {

@@ -1185,7 +1185,7 @@ Object {

@@ -1195,7 +1195,7 @@ Object {
@@ -1867,7 +1867,7 @@ Object {

@@ -1876,7 +1876,7 @@ Object {

@@ -1886,7 +1886,7 @@ Object {
@@ -2477,7 +2477,7 @@ Object {

@@ -2486,7 +2486,7 @@ Object {

@@ -2496,7 +2496,7 @@ Object {
@@ -3155,7 +3155,7 @@ Object {

@@ -3164,7 +3164,7 @@ Object {

@@ -3743,7 +3743,7 @@ Object {

@@ -3752,7 +3752,7 @@ Object {

diff --git a/plugin/tests/js/block-editor/blocks/card/__snapshots__/save.test.js.snap b/plugin/tests/js/block-editor/blocks/card/__snapshots__/save.test.js.snap index 2bc3567d6..c05e94aa8 100644 --- a/plugin/tests/js/block-editor/blocks/card/__snapshots__/save.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/__snapshots__/save.test.js.snap @@ -47,18 +47,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -124,18 +124,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -282,18 +282,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -359,18 +359,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -517,12 +517,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -589,12 +589,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

diff --git a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-primary.test.js.snap b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-primary.test.js.snap index b84d2ae08..5ebbe1e78 100644 --- a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-primary.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-primary.test.js.snap @@ -9,7 +9,7 @@ Object { class="material-design-card__primary" >

Test Secondary text

@@ -21,7 +21,7 @@ Object { class="material-design-card__primary" >

Test Secondary text

@@ -90,7 +90,7 @@ Object { class="material-design-card__primary" >

Test Title

@@ -102,7 +102,7 @@ Object { class="material-design-card__primary" >

Test Title

@@ -173,7 +173,7 @@ Object {

@@ -189,7 +189,7 @@ Object {

@@ -262,7 +262,7 @@ Object {

@@ -278,7 +278,7 @@ Object {

@@ -351,7 +351,7 @@ Object {

@@ -360,7 +360,7 @@ Object {

@@ -376,7 +376,7 @@ Object {

@@ -385,7 +385,7 @@ Object {

@@ -456,12 +456,12 @@ Object { class="material-design-card__primary" >

Test Title

Test Secondary text

@@ -473,12 +473,12 @@ Object { class="material-design-card__primary" >

Test Title

Test Secondary text

diff --git a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-supporting-text.test.js.snap b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-supporting-text.test.js.snap index dd56ca7c5..dde96474d 100644 --- a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-supporting-text.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/card-supporting-text.test.js.snap @@ -6,7 +6,7 @@ Object { "baseElement":
Test supporting text
@@ -14,7 +14,7 @@ Object { , "container":
Test supporting text
@@ -81,7 +81,7 @@ Object {
@@ -93,7 +93,7 @@ Object {
diff --git a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/horizontal-card-layout.test.js.snap b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/horizontal-card-layout.test.js.snap index 0e5a974b4..5a3dd77af 100644 --- a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/horizontal-card-layout.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/horizontal-card-layout.test.js.snap @@ -46,12 +46,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -116,12 +116,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -267,12 +267,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -299,12 +299,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -411,12 +411,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -480,12 +480,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -626,12 +626,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -691,12 +691,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

diff --git a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/vertical-card-layout.test.js.snap b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/vertical-card-layout.test.js.snap index 7f6799453..fcec2f734 100644 --- a/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/vertical-card-layout.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/card/components/__snapshots__/vertical-card-layout.test.js.snap @@ -46,18 +46,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -121,18 +121,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -277,18 +277,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -314,18 +314,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -427,12 +427,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -443,7 +443,7 @@ Object { tabindex="0" />
Test supporting text
@@ -502,12 +502,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -518,7 +518,7 @@ Object { tabindex="0" />
Test supporting text
@@ -666,12 +666,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -679,7 +679,7 @@ Object {
Test supporting text
@@ -746,12 +746,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -759,7 +759,7 @@ Object {
Test supporting text
@@ -899,18 +899,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -969,18 +969,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -1120,12 +1120,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -1142,12 +1142,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -1155,7 +1155,7 @@ Object {

Test supporting text
@@ -1214,12 +1214,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -1236,12 +1236,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -1249,7 +1249,7 @@ Object {
Test supporting text
@@ -1393,18 +1393,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -1467,18 +1467,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -1618,18 +1618,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -1688,18 +1688,18 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

Test supporting text
@@ -1844,12 +1844,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

@@ -1914,12 +1914,12 @@ Object { class="material-design-card__primary" >

Test title

Test secondary text

diff --git a/plugin/tests/js/block-editor/blocks/cards-collection/__snapshots__/edit.test.js.snap b/plugin/tests/js/block-editor/blocks/cards-collection/__snapshots__/edit.test.js.snap index 3d8e6c194..499534a21 100644 --- a/plugin/tests/js/block-editor/blocks/cards-collection/__snapshots__/edit.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/cards-collection/__snapshots__/edit.test.js.snap @@ -1248,7 +1248,7 @@ Object {

@@ -1257,7 +1257,7 @@ Object {

@@ -1267,7 +1267,7 @@ Object {
@@ -1329,7 +1329,7 @@ Object {

@@ -1338,7 +1338,7 @@ Object {

@@ -1348,7 +1348,7 @@ Object {
@@ -1410,7 +1410,7 @@ Object {

@@ -1419,7 +1419,7 @@ Object {

@@ -1429,7 +1429,7 @@ Object {
@@ -2687,7 +2687,7 @@ Object {

@@ -2696,7 +2696,7 @@ Object {

@@ -2706,7 +2706,7 @@ Object {
@@ -2768,7 +2768,7 @@ Object {

@@ -2777,7 +2777,7 @@ Object {

@@ -2787,7 +2787,7 @@ Object {
@@ -2849,7 +2849,7 @@ Object {

@@ -2858,7 +2858,7 @@ Object {

@@ -2868,7 +2868,7 @@ Object {
@@ -4206,7 +4206,7 @@ Object {

@@ -4215,7 +4215,7 @@ Object {

@@ -4225,7 +4225,7 @@ Object {
@@ -4281,7 +4281,7 @@ Object {

@@ -4290,7 +4290,7 @@ Object {

@@ -4300,7 +4300,7 @@ Object {
@@ -4356,7 +4356,7 @@ Object {

@@ -4365,7 +4365,7 @@ Object {

@@ -4375,7 +4375,7 @@ Object {
@@ -5631,7 +5631,7 @@ Object {

@@ -5640,7 +5640,7 @@ Object {

@@ -5650,7 +5650,7 @@ Object {
@@ -5706,7 +5706,7 @@ Object {

@@ -5715,7 +5715,7 @@ Object {

@@ -5725,7 +5725,7 @@ Object {
@@ -5781,7 +5781,7 @@ Object {

@@ -5790,7 +5790,7 @@ Object {

@@ -5800,7 +5800,7 @@ Object {
@@ -6801,7 +6801,7 @@ Object {

@@ -6810,7 +6810,7 @@ Object {

@@ -6867,7 +6867,7 @@ Object {

@@ -6876,7 +6876,7 @@ Object {

@@ -6933,7 +6933,7 @@ Object {

@@ -6942,7 +6942,7 @@ Object {

@@ -7862,7 +7862,7 @@ Object {

@@ -7871,7 +7871,7 @@ Object {

@@ -7928,7 +7928,7 @@ Object {

@@ -7937,7 +7937,7 @@ Object {

@@ -7994,7 +7994,7 @@ Object {

@@ -8003,7 +8003,7 @@ Object {

@@ -12435,7 +12435,7 @@ exports[`blocks: material/cards-collection: Edit removes one card from the ui is className="material-design-card__primary" >

Title goes here

Secondary text

Supporting text
@@ -124,18 +124,18 @@ Object { class="material-design-card__primary" >

Title goes here

Secondary text

Supporting text
@@ -274,18 +274,18 @@ Object { class="material-design-card__primary" >

Title goes here

Secondary text

Supporting text
@@ -343,18 +343,18 @@ Object { class="material-design-card__primary" >

Title goes here

Secondary text

Supporting text
@@ -493,12 +493,12 @@ Object { class="material-design-card__primary" >

Title goes here

Secondary text

@@ -557,12 +557,12 @@ Object { class="material-design-card__primary" >

Title goes here

Secondary text

diff --git a/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit-with-select.test.js.snap b/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit-with-select.test.js.snap index 234176d77..58f04e727 100644 --- a/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit-with-select.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit-with-select.test.js.snap @@ -53,14 +53,14 @@ Object { class="single-post-card__primary" >

Example 1 Title

Example 1 excerpt @@ -454,14 +454,14 @@ Object { class="single-post-card__primary" >

Example 2 Title

Example 2 excerpt @@ -528,14 +528,14 @@ Object { class="single-post-card__primary" >

Example 1 Title

Example 1 excerpt @@ -595,14 +595,14 @@ Object { class="single-post-card__primary" >

Example 2 Title

Example 2 excerpt diff --git a/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit.test.js.snap b/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit.test.js.snap index 234176d77..58f04e727 100644 --- a/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/common-posts-list/__snapshots__/edit.test.js.snap @@ -53,14 +53,14 @@ Object { class="single-post-card__primary" >

Example 1 Title

Example 1 excerpt @@ -454,14 +454,14 @@ Object { class="single-post-card__primary" >

Example 2 Title

Example 2 excerpt @@ -528,14 +528,14 @@ Object { class="single-post-card__primary" >

Example 1 Title

Example 1 excerpt @@ -595,14 +595,14 @@ Object { class="single-post-card__primary" >

Example 2 Title

Example 2 excerpt diff --git a/plugin/tests/js/block-editor/blocks/common-posts-list/components/__snapshots__/card-header.test.js.snap b/plugin/tests/js/block-editor/blocks/common-posts-list/components/__snapshots__/card-header.test.js.snap index 3733d2e1f..1584e0473 100644 --- a/plugin/tests/js/block-editor/blocks/common-posts-list/components/__snapshots__/card-header.test.js.snap +++ b/plugin/tests/js/block-editor/blocks/common-posts-list/components/__snapshots__/card-header.test.js.snap @@ -9,14 +9,14 @@ Object { class="single-post-card__primary" >

Test Title