- This topic has 7 replies, 4 voices, and was last updated 1 year, 7 months ago by David.
-
AuthorPosts
-
August 23, 2020 at 2:22 pm #1415278Alex
Hi there,
I’m new to this framework. I think it’s a great framework that you’ve built. I’d like to use CSS Grid for laying out pages and such. I know I can override layout elements with my own. But I wanted to know if there are any plans to update the theme to use CSS Grid? And are you accepting PRs for this?August 23, 2020 at 2:33 pm #1415289DavidStaffCustomer SupportHi there,
GeneratePress 3.0 is about to be released soon.
Default installs of 3.0 will remove the legacy unsenantic grid and replace it with CSS Flexbox.Flexbox for the themes layout is far simpler to setup within the Customizer ie. no additional controls to maintain legacy behaviour. It also have more stable support across all browsers.
Whereas CSS Grid is more ‘complex’ and would require an additional control scheme. Also Grid Gap is not fully supported on all legacy browsers.
Of course with the new flex version – replacing it with CSS Grid will also be far simpler as there are no utility classes in the HTML ( which unsemantic required ).
August 27, 2020 at 4:47 pm #1421149AlexOh neat. =)
Thanks for the reply. Is there a place to preview or test out the upcoming version?
August 27, 2020 at 5:32 pm #1421163LeoStaffCustomer SupportNot yet – working out the last details before we release alpha testing 🙂
August 26, 2022 at 3:07 am #2324364JonathanAny update on when CSS grid is going to be implemented within generatepress blocks?
August 26, 2022 at 4:19 am #2324424DavidStaffCustomer SupportHi there,
we don’t have any firm plans on adding CSS Grid to GenerateBlocks ( or the theme ).
It is something we are experimenting with, but the major hurdle is creating a UI that not only works but is actually understandable.There are a couple of tools out there that assist with the CSS generation of a CSS Grid.
This is one i like:And implementing that into a GB Container block is quite simple.
Happy to assist with any CSS if you want to try.August 29, 2022 at 3:52 am #2326945JonathanI’m ok with writing vanilla grid css so what would your recommendations be about applying it to say a block layout with Generatepress. Will the css show within the UI or just simply show on the frontend?
August 29, 2022 at 6:18 am #2327093DavidStaffCustomer SupportYou can load the CSS in the editor as well.
If the CSS is in the Customizer > Additional CSS then add this PHP Snippet:
add_filter( 'block_editor_settings_all', function( $editor_settings ) { $css = wp_get_custom_css_post()->post_content; $editor_settings['styles'][] = array( 'css' => $css ); return $editor_settings; } );
If you have the CSS saved in a child theme stylesheet then use this PHP Snippet:
add_filter( 'generate_editor_styles', function( $editor_styles ) { $editor_styles[] = 'your-editor-style.css'; return $editor_styles; } );
Change the
your-editor-style.css
to the name of the stylesheet.I would probably, use a Container Block for the parent Grid, and stack a load of Containers within for the grid items.
You could use a grid block, but that will load unnecessary Flex styles that may get in your way. -
AuthorPosts
- You must be logged in to reply to this topic.