Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel: update link styles #6517

Merged
merged 4 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions pixel/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,10 @@ Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, feature
box-shadow: var(--wp--custom--shadow);
}

/* Post title styles */
.wp-block-post-title a {
/* Links */
a:where(:not(.wp-element-button)) {
text-underline-offset: .3em;
text-decoration-thickness: 2px;
}

.wp-block-post-title a:hover,
.wp-block-post-title a:focus {
text-decoration-style: dotted;
}

.wp-block-post-title a:active {
text-decoration-style: solid;
/* text-decoration-thickness: 2px; */
}

/*
Expand Down Expand Up @@ -70,15 +61,6 @@ Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, feature
border-color: var(--wp--preset--color--primary);
}

/* Categories */
.taxonomy-category > a {
text-decoration: none;
}

.taxonomy-category > a:hover {
text-decoration: underline;
}

.wp-block-pullquote cite {
font-size: 0.75rem;
font-style: normal;
Expand Down
102 changes: 94 additions & 8 deletions pixel/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,44 @@
"left": "0.25rem !important",
"right": "0.25rem !important"
}
},
"elements": {
"link": {
":active": {
"typography": {
"textDecoration": "underline dotted"
}
},
":focus": {
"typography": {
"textDecoration": "underline solid"
}
}
}
}
},
"core/post-content": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the Figma, links inside post content should be italicized in :active, :focus:, :hover states. I added a config for that here, but I noticed that it broke the block margins even though it should be a valid config:

Screen Shot 2022-09-07 at 10 39 28 AM

Any idea why? I will investigate and open a bug report upstream if needed, but we may need to find a workaround in the meantime.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reported here: WordPress/gutenberg#43955

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a workaround added explicit spacing -> blockGap in post-content to fix the issue.

"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
},
"elements": {
"link": {
":active": {
"typography": {
"fontStyle": "italic"
}
},
":focus": {
"typography": {
"fontStyle": "italic"
}
},
":hover": {
"typography": {
"fontStyle": "italic"
}
}
}
}
},
"core/post-date": {
Expand All @@ -300,11 +338,6 @@
"link": {
"typography": {
"textDecoration": "none"
},
":hover": {
"typography": {
"textDecoration": "underline"
}
}
}
}
Expand All @@ -327,6 +360,38 @@
"fontStyle": "italic"
}
},
"core/query-pagination": {
"elements": {
"link": {
"typography": {
"textDecoration": "none"
}
}
}
},
"core/query-pagination-next": {
"typography": {
"fontWeight": "500"
}
},
"core/query-pagination-numbers": {
"typography": {
"fontWeight": "500"
},
"elements": {
"link": {
"typography": {
"fontWeight": "300",
"textDecoration": "none"
}
}
}
},
"core/query-pagination-previous": {
"typography": {
"fontWeight": "500"
}
},
"core/quote": {
"border": {
"color": "var(--wp--preset--color--primary)",
Expand Down Expand Up @@ -369,8 +434,14 @@
"fontFamily": "var(--wp--preset--font-family--uni-05-53)",
"fontSize": "0.875rem",
"fontWeight": "400",
"textTransform": "uppercase",
"textDecoration": "none"
"textTransform": "uppercase"
},
"elements": {
"link": {
"typography": {
"textDecoration": "none"
}
}
}
}
},
Expand Down Expand Up @@ -467,11 +538,26 @@
"link": {
"color": {
"text": "var(--wp--preset--color--primary)"
},
":hover": {
"typography": {
"textDecoration": "underline dotted"
}
},
":focus": {
"typography": {
"textDecoration": "underline dotted"
}
},
":active": {
"typography": {
"textDecoration": "underline solid"
}
}
}
},
"spacing": {
"blockGap": "30px",
"blockGap": "var(--wp--custom--gap--vertical)",
"padding": {
"bottom": "var(--wp--custom--spacing--outer)",
"left": "var(--wp--custom--spacing--outer)",
Expand Down