Fallback First or Diplay Flex Support...

User 244626 Photo


Registered User
811 posts

Phillip Dias wrote:
What browsers or devices do not support flex?
As for not supporting grid its only old iPads isn't it and Microsoft with ie11 and Edge which lets face it are way behind the times anyhow.


My last comment was a "futuristic off the cuff" remark about what we might see in 10 or 20 years from now. Could it be possible that a browser would only support Grid ?

Here is my latest test for grid. If your browser supports the "true" spec of grid then you will see a Bootstrap 4 site using Grid Layout only. If your browser does not support grid, then you are redirected to another page built with Bootstrap 3 using no Grid OR Flex. The old row and columns stuff with components not built with flex.

https://gluexp.coffeecup.com/sd3/project10/index.html

My Edge browser does support Grid but IE11 does not.......oh well sorry IE11. IE11 gets a downgrade for being stubborn.
Bootstrap 5 CSS Grid.
User 244626 Photo


Registered User
811 posts

Frank Cook wrote:
It's tricky. If one sets display:none on a container then, of course, all its contents also fail to display. Alternate containers for the same content would seem therefore to involve duplicating the contents and therefore slowing page loading times (I assume that display:none items are still loaded by browsers).

I'm toying with various ideas for SD V3 as present, such as the following.
1. I have in mind always to start by setting the @supports rules to Display Flex and Display Grid in that order. Although I am likely to use only the Fallback First and Display Grid in practice, trying later to add Display Flex may be problematic as shown in the previous posts in this thread.
2. One can have a clear temporary indicator of the mode in which one is working by setting a 10px left border on the Body, which is different in each mode (e.g. solid green for Fallback First, dashed red for Display Flex, solid blue for Display Grid, as in https://fc7777.coffeecup.com/rgb-test-3.rsd). Although this will have to be removed before making pages public, it may have the further advantage of testing in 'Preview on...' what mode the chosen browser supports.
3. I intend to use just Fallback first and Display Grid unless I find an excellent reason for using Display Flex.
4. The only reasons I can think of for adding CSS Grid Layout to my current web pages are:
(a) better appearance, or
(b) improved functionality.
There seems no point in conversion to CSS Grid Layout otherwise.
5. I may, however, do the following with my RSD 2.5 pages even where I don't intend immediately to add CSS Grid Layout:
(a) import them to SD V3, setting up as in items 1 and 2 above;
(b) make the minimum changes that may be needed to ensure that the pages appear and work approximately as they did in RSD 2.5.
This should mean that
(i) I will be able to make any adjustments in SD V3 rather than going back to RSD 2.5;
(ii) future changes for better appearance or improved functionality will have been prepared for.

If anyone can see that any of the above notions may prove problematic, I will be glad to know of the likely problems.

Frank



Since we can chain together rules in a @supports why could not one add a (display:flex) supports and then add a (display:grid and not:display:flex) supports ? That would certainly separate out the css for the flex and grid display.
Bootstrap 5 CSS Grid.
User 244626 Photo


Registered User
811 posts

Unfortunatey we can only create simple @supports so display: grid and (not(display:flex) can not be achieved in the current build. Would be a nice feature update....:)
Bootstrap 5 CSS Grid.
User 379556 Photo


Registered User
1,535 posts

Twinstream wrote:
Since we can chain together rules in a @supports why could not one add a (display:flex) supports and then add a (display:grid and not:display:flex) supports ? That would certainly separate out the css for the flex and grid display.

I am very much a novice at this, and trying to learn. Considering such questions, even if hypothetical, can help clarify matters. The question raised creates in my thinking yet further questions.
1. Would the logic of that "and not" @supports rule mean that the only browsers which would take take notice of it would be browsers that do support CSS Grid Layout but don't support Flexbox? I suspect we may have to wait some time before such browsers appear.
2. What would one do when CSS Grid needs to incorporate flex containers? For example, centred menus which at lower viewports need more than one line, but at higher viewports are in one line only. As far as I can tell, Flexbox can do this easily without breakpoints, keeping the items in each line horizontally centred; CSS Grid seems incapable of making the items in the last line centred. I suspect that this may be something that is addressed in future developments of CSS Grid Layout.

I think the answer to item 1 may be 'Yes', and the response to item 2 may be someone revealing that it can be done in CSS Grid Layout without breakpoints.

Frank
User 244626 Photo


Registered User
811 posts

Frank Cook wrote:
Twinstream wrote:
Since we can chain together rules in a @supports why could not one add a (display:flex) supports and then add a (display:grid and not:display:flex) supports ? That would certainly separate out the css for the flex and grid display.

I am very much a novice at this, and trying to learn. Considering such questions, even if hypothetical, can help clarify matters. The question raised creates in my thinking yet further questions.
1. Would the logic of that "and not" @supports rule mean that the only browsers which would take take notice of it would be browsers that do support CSS Grid Layout but don't support Flexbox? I suspect we may have to wait some time before such browsers appear.
2. What would one do when CSS Grid needs to incorporate flex containers? For example, centred menus which at lower viewports need more than one line, but at higher viewports are in one line only. As far as I can tell, Flexbox can do this easily without breakpoints, keeping the items in each line horizontally centred; CSS Grid seems incapable of making the items in the last line centred. I suspect that this may be something that is addressed in future developments of CSS Grid Layout.

I think the answer to item 1 may be 'Yes', and the response to item 2 may be someone revealing that it can be done in CSS Grid Layout without breakpoints.

Frank


Ah yes, that logic of (display:grid and not:display:flex) would not work because every browser supporting grid obviously supports flex. Too futuristic....

Try this logic:

Create these @supports: "Display:Grid" and "Display:Flex and (not(Display:Grid)" (If we could create such in SD3)

The order would appear as follows in the @supports listing:

"Display:Grid"
"Display:Flex and (not(Display:Grid)"

A browser that only supports Flex skips the css in "Display Grid" and loads "Display:Flex and (not(Display:Grid)".

A browser that does support Grid loads "Display:Grid" css and
skips the css in "Display:Flex and (not(Display:Grid)".

I think this is what I am trying to achieve rather than mix css....which I think is the issue of cascading effect of css main style-sheet.

Is this a Logic pattern that works ?

Bootstrap 5 CSS Grid.
User 379556 Photo


Registered User
1,535 posts

Twinstream wrote:
The order would appear as follows in the @supports listing:
"Display:Grid"
"Display:Flex and (not(Display:Grid)"
...
I think this is what I am trying to achieve rather than mix css....which I think is the issue of cascading effect of css main style-sheet.

Is this a Logic pattern that works ?

That looks entirely logical to me.

The issue of the cascading effect of the main.css file may, I believe, be a problem that afflicts only those who in SD V3 have set the @supports rule for Display Grid, and then decide to add the @supports rule for Display Flex. Trying to change the order in the setup box (e.g. by deleting the Display Grid rule and then adding it again after the Display Flex rule) seems to wipe out all that one had set up for CSS Grid Layout.

Perhaps it would be better if, by default, SD V3 opened a new (or newly converted from RSD) project with the @supports rules for Display Grid and Display Flex already set up in that order. One could delete or just leave unused either of those rules if one didn't need them.

Frank

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.