Skip to content
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

[FEATURE] Add migration for Bootstrap 4 -> 5 hidden classes #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NamelessCoder
Copy link

@NamelessCoder NamelessCoder commented Jul 26, 2024

Adds a migration that converts hidden-* to d-*-none classes in FlexForm data in DB.

Note that this only converts the classes 1:1 which means it functions as a "hide column on this size and any larger size". In order to make it a "hide column only on this size", a template change is required which for every breakpoints adds an additional class if d-*-none is designated, to make the column visible again on the next breakpoint.

To hide a column on larger sizes you just add the d-*-none class on the breakpoint where hiding starts and the column will be hidden on that size and any larger size.

Inversely, to make the functionality "show only on this and larger size" you would have set d-*-none on the smaller sizes and d-*-block on larger sizes. This however is not supported by the templates that ship with the extension.

For example, d-md-none would need to become d-md-none d-lg-block. Unfortunately it doesn't seem like it's possible to force Bootstrap to use whichever display type the HTML element type would naturally have, so this would have to be a decision on a template-by-template basis. If any element (column) is NOT a "block" display type, then the needed display type would have to be specified instead of "block".

Note that this PR requires the same Services.yaml change that is in #75.

Adds a migration that converts "hidden-*" to "d-*-none" classes in
FlexForm data in DB.

Note that this only converts the classes 1:1 which means it functions
as a "hide column on this size and any larger size". In order to make
it a "hide column only on this size", a template change is required
which for every breakpoints adds an additional class if "d-*-none" is
designated, to make the column visible again on the next breakpoint.

To _hide_ a column on larger sizes you just add the "d-*-none" class
on the breakpoint where hiding starts and the column will be hidden on
that size and any larger size.

Inversely, to make the functionality "show only on this and larger
size" you would have set "d-*-none" on the smaller sizes and
"d-*-block" on larger sizes. This however is not supported by the
templates that ship with the extension.

For example, "d-md-none" would need to become "d-md-none d-lg-block".
Unfortunately it doesn't seem like it's possible to force Bootstrap to
use whichever display type the HTML element type would naturally have,
so this would have to be a decision on a template-by-template basis.
If any element (column) is NOT a "block" display type, then the needed
display type would have to be specified instead of "block".
@RozbehSharahi
Copy link
Owner

Wow very nice.

Will check that these days ...

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants