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

DISCUSSION: Make css grid area identifiers public again? #3450

Open
mhsdesign opened this issue Mar 29, 2023 · 2 comments
Open

DISCUSSION: Make css grid area identifiers public again? #3450

mhsdesign opened this issue Mar 29, 2023 · 2 comments

Comments

@mhsdesign
Copy link
Member

mhsdesign commented Mar 29, 2023

Description

With 8.2 we switched to css grid
With #3366 (unreleased 8.3) the css grid identifiers declared here:

grid-template-areas: 'primaryToolbar primaryToolbar primaryToolbar'

will be scoped to the css module (and the are name will obscurified)
thats why we use composition to apply the grid-area property:
composes: rightSidebar from '../style.module.css';

as proposed here: parcel-bundler/lightningcss#144 (comment)

Fyi, there is now an proposal in css-modules for global css grid identifier:

css-modules/css-modules#390

@Sebobo
Copy link
Member

Sebobo commented Mar 30, 2023

I had a similar issue in the media ui and when putting the areas and references into css variables, it works and keeps the names intact.

Which is actually even nicer for extensibility.

Example:

.container {
    --grid-areas: "left top right" "left main right";
    --grid-area-right: right;
    grid-template-areas: var(--grid-areas);
}

.gridRight {
    grid-area: var(--grid-area-right);
}

@mhsdesign
Copy link
Member Author

mhsdesign commented Mar 30, 2023

nice trick ^^ (makes sense that you had the same problem as youre also using parcels lightning css under the hood?)

so yes im fine with implementing it like this.

otherwise we could also do:

some global css file:

.my-css-grid {
    grid-template-areas: "left top right" "left main right";
}

.my-css-grid-right {
  grid-area: right;
}
.container {
    composes: my-css-grid from global;
}
.gridRight {
    composes: my-css-grid-right from global;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: In progress, but not this time ...
Development

No branches or pull requests

3 participants