Skip to content

Commit fd895af

Browse files
authored
Merge pull request #452 from material-components/fix/card-margin
Fix card spacing; Fix button spacing
2 parents 4a30619 + 2ee7bcf commit fd895af

File tree

6 files changed

+18
-38
lines changed

6 files changed

+18
-38
lines changed

plugin/assets/css/src/_frontend.css

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
@import "typography.css";
2626
@import "./components/contact-form.css";
2727
@import "./components/masonry-grid.css";
28-
@import "./components/card.css";
2928
@import "./components/core.css";
3029
@import "../../src/block-editor/blocks/common-posts-list/style.css";
3130
@import "../../src/block-editor/blocks/contact-form/inner-blocks/common/style.css";

plugin/assets/css/src/block/style/masonry.css

-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,3 @@
5454
.is-style-material-masonry.wp-block-query-loop.is-flex-container > li {
5555
width: 100% !important;
5656
}
57-
58-
.entry-content h2.post-card__title {
59-
margin: revert;
60-
}

plugin/assets/css/src/components/button.css

+4-22
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,14 @@
2929
.mdc-button {
3030
-moz-osx-font-smoothing: grayscale;
3131
-webkit-font-smoothing: antialiased;
32-
font-family: Roboto, sans-serif;
33-
34-
/* @alternate */
3532
font-family: var(--md-sys-typescale-label-large-font, Roboto, sans-serif);
36-
font-size: 0.875rem;
37-
38-
/* @alternate */
3933
font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
4034
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
41-
line-height: 2.25rem;
42-
43-
/* @alternate */
44-
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
4535
line-height: var(--md-sys-typescale-label-large-line-height, 1.25rem);
46-
font-weight: 500;
47-
48-
/* @alternate */
4936
font-weight: var(--md-sys-typescale-label-large-weight, 500);
50-
letter-spacing: 0.0892857143em;
51-
52-
/* @alternate */
5337
letter-spacing: 0.1px;
54-
text-decoration: none;
55-
56-
/* @alternate */
5738
-webkit-text-decoration: var(--mdc-typography-button-text-decoration, none);
58-
padding: 0 8px 0 8px;
39+
padding: 8px;
5940

6041
/* @alternate */
6142
position: relative;
@@ -66,6 +47,7 @@
6647
min-width: 64px;
6748
border: none;
6849
outline: none;
50+
white-space: nowrap;
6951

7052
/* @alternate */
7153
-webkit-user-select: none;
@@ -250,7 +232,7 @@ svg.mdc-button__icon {
250232
.mdc-button--elevated,
251233
.mdc-button--filled,
252234
.mdc-button--unelevated {
253-
padding: 0 16px 0 16px;
235+
padding: 10px 16px;
254236
}
255237

256238
.mdc-button--raised:not(:disabled),
@@ -319,7 +301,7 @@ svg.mdc-button__icon {
319301
}
320302

321303
.mdc-button--outlined {
322-
padding: 0 15px 0 15px;
304+
padding: 10px 15px;
323305
border-width: 1px;
324306
border-style: solid;
325307
}

plugin/assets/css/src/components/card.css

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
}
6161
}
6262

63+
.mdc-card__action--button {
64+
height: 40px;
65+
}
66+
6367
.mdc-card__media {
6468
background-position: 50%;
6569
background-repeat: no-repeat;
@@ -192,6 +196,7 @@
192196
color: var(--md-sys-color-on-surface, #000);
193197
}
194198

199+
.entry-content h2.post-card__title,
195200
.post-card__title {
196201
margin: 0;
197202
padding: 0;

plugin/assets/css/src/components/material.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,12 @@
321321
.wp-block-material-buttons {
322322
align-items: center;
323323
display: flex;
324+
flex-wrap: wrap;
325+
gap: 8px;
324326

325327
&.aligncenter {
326328
justify-content: center;
327329
}
328-
329-
& .mdc-button {
330-
margin-right: 8px;
331-
}
332330
}
333331

334332
/* Icon */

plugin/php/customizer/class-controls.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,12 @@ public function get_frontend_css() {
913913
esc_html( $font_style )
914914
);
915915
} elseif ( 'tracking' === $type ) {
916-
$font_size = isset( $value['size'] ) ? $value['size'] : 16;
917-
$line_height = $value[ $type ] / $font_size;
918-
$font_vars[] = sprintf(
916+
$font_size = isset( $value['size'] ) ? $value['size'] : 16;
917+
$line_tracking = $value[ $type ] / $font_size;
918+
$font_vars[] = sprintf(
919919
'%s: %srem !important;',
920920
esc_html( $var ),
921-
esc_html( $line_height )
921+
esc_html( $line_tracking )
922922
);
923923
} else {
924924
$font_vars[] = sprintf(
@@ -1714,9 +1714,9 @@ public function get_typography_extra_controls( $token ) {
17141714
'small' => 2.5,
17151715
],
17161716
'title' => [
1717-
'large' => 2,
1718-
'medium' => 2,
1719-
'small' => 1.75,
1717+
'large' => 1.33,
1718+
'medium' => 1.75,
1719+
'small' => 1.57,
17201720
],
17211721
'label' => [
17221722
'large' => 1.75,

0 commit comments

Comments
 (0)