-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Post excerpt block - add color, fontSize, lineHeight, and text alignment. #23945
Merged
Addison-Stavlo
merged 12 commits into
master
from
update/post-excerpt-block-color-typrography-flags
Jul 20, 2020
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1e8c93e
add text align
Addison-Stavlo 1af97c8
add wrapper and line-height inherit
Addison-Stavlo 691c73f
php format
Addison-Stavlo 2311564
get this working in site editor?
Addison-Stavlo c477041
set initial readMore, get rid of extra parent component
Addison-Stavlo 55357ca
styles to ensure link color is shown
Addison-Stavlo a62b280
no elipsis
Addison-Stavlo 29f30d5
dont initialize for now /shrug
Addison-Stavlo 404fe64
add custom warning if no post found in context
Addison-Stavlo 1c32d9b
more simple error fix
Addison-Stavlo 5821974
actually we need this warning... otherwise user can edit what cannot …
Addison-Stavlo b0a3cf8
get rid of important
Addison-Stavlo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.wp-block-post-excerpt { | ||
.wp-block-post-excerpt__excerpt, | ||
.wp-block-post-excerpt__more-text { | ||
line-height: inherit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, this should most likely not be called
align
, but rathertextAlign
. I knowalign
is how the Paragraph block does it, but this is confusing since there is also block alignment, which (if using thesupports
flag) usesalign
as its attribute name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed,
textAlign
oralignText
would be preferable (I was following the paragraph block's lead at first here). I saw thealign
support hook is for block alignment as well and noticed the confusion. I wonder how many other blocks have this conflicted naming convention, but we should start updating them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or would it be better to similarly update the
align
hook to beblockAlign
or something similar?If this is more recent than some of the blocks that use
align
for textAlign, then less people should be effected by the change. That is, Im assuming if we updated the paragraph block's attr name then a user who updates their Gutenberg version will have whatever alignment settings they saved lost?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a compatibility layer for changing a block attribute name? I think there is something for updating a block to a newer version without loosing settings 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be good, at the very least for now I will update the FSE blocks that are using
align
for text alignment to usetextAlign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is indeed a way to easily handle (what would otherwise be backward-incompatible) changes in block attribute schemas:
https://developer.wordpress.org/block-editor/developers/block-api/block-deprecation/
A lot of core blocks already make use this, storing their deprecated versions in a
deprecated.js
file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated for the FSE blocks specifically - #24077