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

Render widget groups in the back end with CSS grid #7087

Merged
merged 21 commits into from May 22, 2024

Conversation

zoglo
Copy link
Contributor

@zoglo zoglo commented Apr 4, 2024

Reviving #2053 with this for Contao ^5.3 and the new introduced classes (w25, w33, w50, w66, w75).
Could be merged with additional changes and would be BC-compatible due to the widget-group wrapper.

Keep in mind this is the reworked CSS-Grid based on @m-vo's solution for the backend widgets as discussed in the contao call for #1024.


Rewrite

Also grouped most media-queries so it's mobile first (not the split-button tho, doesn't make sense for that one)


Additional classes

Introcuded .w16 on that occasion


Custom properties

Following custom properties were added:

Custom property Description
--widget-col-amount Column amount of the backend-grid
(Defaults to 12)
--widget-cols Amount of space that this takes per row
(Can be used to create more specific widget classes)
--widget-gap-rows Row gap for widget-group container
--widget-gap-cols Column gap for widget-group container

@zoglo zoglo marked this pull request as draft April 4, 2024 20:28
@zoglo
Copy link
Contributor Author

zoglo commented Apr 4, 2024

Questionable if we'd need other classes than .w25,.w33,.w50,.w66,.w75.
I changed this to a Draft PR due to possible optimizations with custom properties and not using "max-width" media queries.

Tbh, @m-vo's PR was flawless, it just needed some love and some edge-cases.

zoglo and others added 3 commits April 9, 2024 18:34
Co-authored-by: Martin Auswöger <martin@auswoeger.com>
- do not use column-gap on handhelds (overflow issue)
- do not use !important for .clr
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
core-bundle/contao/themes/flexible/styles/basic.css Outdated Show resolved Hide resolved
zoglo and others added 2 commits April 9, 2024 23:08
Co-authored-by: Fritz Michael Gschwantner <fmg@inspiredminds.at>
@zoglo zoglo marked this pull request as ready for review April 9, 2024 21:22
- added `--widget-col-amount`
- added `--widget-cols`
@zoglo
Copy link
Contributor Author

zoglo commented Apr 9, 2024

I think this PR is finished if the solution mentioned in #7087 (comment) is fine.

The last commit Use custom properties for backend widgets and introduce w16-class introduces custom properties so people can modify their backend grid based on the following custom properties (This doesn't have to apply to the whole backend and can be controlled by adding a specific class to a parent).

Custom property Description
--widget-col-amount Column amount of the backend-grid
(Defaults to 12)
--widget-cols Amount of space that this takes per row
(Can be used to create more specific widget classes)

@zoglo zoglo requested review from fritzmg and ausi April 9, 2024 21:49
@fritzmg
Copy link
Contributor

fritzmg commented Apr 10, 2024

This CSS is already desktop

On that note, may be it should be changed to mobile first? This would simplify the grid CSS even more.

@zoglo
Copy link
Contributor Author

zoglo commented Apr 10, 2024

On that note, may be it should be changed to mobile first? This would simplify the grid CSS even more.

Could do that for the grid. I'd prefer having .split-button in the max-media-query though

@zoglo zoglo marked this pull request as draft April 10, 2024 20:25
- also introduce `--widget-gap-rows` and `--widget-gap-cols`
@zoglo
Copy link
Contributor Author

zoglo commented Apr 10, 2024

@fritzmg

I did the CS and did the following changes:

Media queries

Grouped all media-queries so it's mobile first (not the split-button tho, doesn't make sense for that one)

Custom properties

Added the following ones for more customization, see initial description for the other ones

Custom property Description
--widget-gap-rows Row gap for widget-group container
--widget-gap-cols Column gap for widget-group container

@zoglo zoglo marked this pull request as ready for review April 10, 2024 21:14
@zoglo zoglo requested a review from fritzmg April 10, 2024 21:14
- consider sub-palettes
- consider `non-width` classes (always 100% width)
- reset cbx styles properly
fritzmg
fritzmg previously approved these changes Apr 11, 2024
Copy link
Contributor

@fritzmg fritzmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice 👍

Approving tentatively (haven't tested everything exhaustively.)

@leofeyer leofeyer added this to the 5.4 milestone Apr 11, 2024
@leofeyer leofeyer linked an issue May 2, 2024 that may be closed by this pull request
@leofeyer leofeyer changed the title Render widget groups with CSS grid (see #2053) Render widget groups in the back end with CSS grid May 10, 2024
@leofeyer leofeyer force-pushed the feature/grid-widget-backend branch from 79b6216 to 1ec3509 Compare May 10, 2024 10:48
@leofeyer
Copy link
Member

I like the concept a lot. Well done!

@zoglo zoglo requested a review from leofeyer May 10, 2024 14:37
@leofeyer leofeyer enabled auto-merge (squash) May 22, 2024 10:05
@leofeyer
Copy link
Member

Thank you @zoglo.

@leofeyer leofeyer merged commit c8e1d25 into contao:5.x May 22, 2024
18 checks passed
@fritzmg
Copy link
Contributor

fritzmg commented May 22, 2024

🎉

leofeyer added a commit that referenced this pull request May 23, 2024
Description
-----------

Follow-up on #7087

### Before

<img width="847" alt="" src="https://github.com/contao/contao/assets/1192057/0acc60fa-e73b-4bc1-9a4f-57f49bc0e69c">

### After

<img width="782" alt="" src="https://github.com/contao/contao/assets/1192057/52deebc2-9863-45ca-af14-ad46c1ac7234">

Commits
-------

c008fe2 Fix the `.nogrid` backwards compatibility layer
b1eb3bc Use the :is() selector
c23109b Convert `*:not` to `:not`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fehler bei w50-Klasse
4 participants