- This topic has 22 replies, 6 voices, and was last updated 4 years, 2 months ago by Tom.
-
AuthorPosts
-
December 17, 2017 at 6:53 pm #451749Chad
Hi GP team,
I know… you just got done rewriting things. And now I come along and give more ideas. π
What if GeneratePress used CSS Grids top to bottom?
Of course make the standard stylesheet look like GP does now. But if GP were fully implemented using css grids… oh how cool would it be for designers. π
We could make the site do anything we wanted.
December 17, 2017 at 7:47 pm #451763LeoStaffCustomer SupportHi there,
Couple people have sort of mentioned this before.
See Tom’s replies here:
https://generatepress.com/forums/topic/gutenberg-prep/#post-446571
https://generatepress.com/forums/topic/any-plans-of-replacing-unsemantic-grid/#post-442648Hope this answers your question π
December 18, 2017 at 6:28 am #452088ChadHmm… I wasn’t referring to bits and pieces of the theme, but rather the entire theme overall.
Something along the lines of this: https://github.com/mor10/kuhn
I wonder if I could create a child theme off of GP, then drop in css like this:
@supports (grid-area: auto) { @media screen and (min-width: 61.875em) { .site { display: grid; grid-template-columns: 16.5em 1fr; grid-template-rows: 1fr minmax(1em, auto); grid-template-areas: "header main" "header sidebar" "header footer"; } .site-header { grid-area: header; } .site-main { grid-area: main; } .widget-area { grid-area: sidebar; } .site-footer { grid-area: footer; } } @media screen and (min-width: 1800px) { body:not(.archive-view) .site { grid-template-columns: 16.5em 1fr 16.5em; grid-template-rows: 1fr minmax(1em, auto); grid-template-areas: "header main sidebar" "header footer footer"; } } }
December 18, 2017 at 9:56 am #452318TomLead DeveloperLead DeveloperI would love to do this one day. Currently though, CSS Grid just isn’t supported widely enough.
There would also be the issue with backward-compatibility – many people are using the current CSS classes in their content.
One day, this will likely become an option you can toggle within the Customizer to switch to 100% CSS Grid π
December 18, 2017 at 6:37 pm #452555ChadFair answer Tom. I hadn’t done the research to learn how widely supported CSS Grids are… and it turns out it’s almost universally supported across modern browsers (which update themselves automatically). It’s even up to 76% of all active browsers supporting it — and growing each day. Yay!
https://caniuse.com/#feat=css-grid
I’d be more than willing to help you test this capability. I’d LOVE the ability to add a few CSS class overrides and completely change the layout of client sites on a whim — without any need to dig into the theme files. π
December 18, 2017 at 8:47 pm #452607TomLead DeveloperLead DeveloperI wonder if Edge has caught up yet – last I checked it was still a mess.
I’ll definitely do some research – I think it will require removing some markup etc.. which may be hard, but it’s something I’ll definitely be adding an option for at some point π
December 18, 2017 at 9:05 pm #452618ChadEdge has caught up… oh so recently. π
So glad MS implemented the auto update concept too β at least with Edge.
December 18, 2017 at 10:12 pm #452629ChadI started testing some drop in classes… by creating a child theme off of GP.
It’s definitely a work in progress but looks like this so far.
Using only this in the stylesheet:
@media screen and (min-width: 61.875em) { body { display: grid; grid-template-columns: 16.5em 1fr; grid-template-rows: 1fr minmax(1em, auto); grid-template-areas: "header main" "header sidebar" "header footer"; } .site-header { grid-area: header; } .site-main { grid-area: main; } .widget-area { grid-area: sidebar; } .site-footer { grid-area: footer; } } @media screen and (min-width: 1800px) { body { grid-template-columns: 16.5em 1fr 16.5em; grid-template-rows: 1fr minmax(1em, auto); grid-template-areas: "header main sidebar" "header footer footer"; } }
December 18, 2017 at 10:56 pm #452641TomLead DeveloperLead DeveloperSuper interesting – thanks for that. Might have to find some time to play with this over the holidays π
December 18, 2017 at 11:11 pm #452647ChadAwesome! Yea, if you look at the test site, I suspect there are some styles causing spacing/layout issues with the grids, but you’re the superhero here… I bet you could whip this grid support up no problem.
π
December 18, 2017 at 11:29 pm #452654ChadSorry to keep adding to this…
I’m just picturing things… GP is already super customizable. The plugin adding lots of capabilities to the customizer, the page headers, and the disable elements stuff in each post.
Adding in CSS Grids will basically make this theme capable of doing just about everything — especially for people who understand css.
I wonder if there would be some way to add css grid settings to the customizer without making it too limited?
December 19, 2017 at 10:03 am #453137TomLead DeveloperLead DeveloperTurning the page into a grid would have lots of benefits when it comes to the Customizer. For example the navigation location would only require GP to tweak some CSS instead of actually moving the navigation around in the markup.
December 19, 2017 at 2:45 pm #453361BurtJust my 2-cents, I like the unsemantic grid being used now – very lightweight and simple to work with. From what I can see as pointed out, grid isn’t supported well yet. But flex box seems to be and you can do some fun things with it ( even the current menu system in GP ) by adding custom css. Not difficult to master and supported- Here is a primary menu using flexbox – needs a bit of work still
December 19, 2017 at 5:15 pm #453426TomLead DeveloperLead DeveloperFlexbox is awesome as well, but usually does require some sort of javascript pollyfil to support older versions of IE.
Love the equal width menu items π
December 19, 2017 at 6:41 pm #453448ChadCSS grids are supported across every modern browser now. The only real concern is IE 11… but given 76.6% of active browsing supports CSS grids right now, I donβt believe compatibility will be a problem.
A combination of css grid and flex grid is probably best.
Something that can take you away from relying on a framework at all. No matter how light it is, it is still adding bulk.
I brought this up because I like the GP premium customizer stuff, and with css grids becoming supported, itβs almost as if itβs the final piece of the puzzle to make the theme truly customizable.
This is a great CSS grids talk: https://mor10.com/wceu2017/
-
AuthorPosts
- You must be logged in to reply to this topic.