thoughtis / cata

WordPress parent theme for Thought & Expression Co.
GNU General Public License v3.0
1 stars 0 forks source link

Remove our custom block library CSS #153

Closed douglas-johnson closed 1 year ago

douglas-johnson commented 1 year ago

Background

When the block editor was just for post content, we wrote our own CSS for all the blocks. When the block editor moved into Full Site Editing, there were too many blocks and we added a concatenated CSS file with the core block css for blocks we didn't especially need to customize.

As of WordPress 6.2 I feel the WP core block library's CSS is good enough to use. We have used it on Thought Catalog and removed the uses of the columns block from Creepy Catalog that would conflict with the core block library's CSS.

This will also resolve #125

Acceptance Criteria

Details

Issues I noticed

.wp-block-post-template.is-flex-container {
    gap:1.25rem;
}

@media (min-width:600px){
    .wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{
      width:calc(50% - .625rem);
    }
    .wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{
      width:calc(33.33333% - .83333rem);
    }
    .wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{
      width:calc(25% - .9375rem);
    }
    .wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{
      width:calc(20% - 1rem);
    }
    .wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{
      width:calc(16.66667% - 1.04167rem);
    }
}
douglas-johnson commented 1 year ago

@jessica-townsend This has the potential to spiral since it nearly affects every site. I think we'll learn a lot from making a beta version and testing it with the child themes, so that should probably the first goal.

jessica-townsend commented 1 year ago

@douglas-johnson are there any frequently used blocks that you were concerned about? I tested the blocks that had CSS removed in addition to browsing the sites on Creepy Catalog, Collective World, and Shop Catalog, and these are the blocks that had significant differences:

Here's a screenshot of before removing CSS screencapture-collectiveworld-thoughtnet-vipdev-lndo-site-local-block-css-test-2023-05-22-15_14_45

And after removing CSS screencapture-collectiveworld-thoughtnet-vipdev-lndo-site-local-block-css-test-2023-05-22-15_14_13

I think the calendar, file, and gallery blocks may need custom CSS for them to look the same as before. I think the others can be fixed in the editor, but for buttons it'd probably be a good idea to add default styles through theme.json.

douglas-johnson commented 1 year ago
jessica-townsend commented 1 year ago

@douglas-johnson beta2 works well for Shop Catalog and Collective World. There are some issues with buttons on Creepy Catalog and Clearing Farm due to conflicts with childtheme-specific CSS. It may be easier to explain the padding discrepancy between the default button and outline button on a call, so let me know if you would like to do that.

For all of these though, there isn't a hover state change or the "press down" effect on click anymore for buttons. If we want to bring these back, I know that theme.json has ":active", ":hover", and ":focus" properties for blocks and elements, or we could add custom CSS.

jessica-townsend commented 1 year ago

Updated padding on clearing farm: https://thoughtcatalog-network-develop.go-vip.net/clearing-farm/book-now/

douglas-johnson commented 1 year ago

A note for when we're working on this again, do we need this currentColor? https://github.com/thoughtis/cata/blame/0.8.7/assets/src/less/elements/links.less#L9

Its working without it on the parent theme, and dropping it makes the buttons easier to style