Skip to content

Fix scope css - #3922

Merged
jokasimr merged 5 commits into
mainfrom
fix-scope-css
Jul 2, 2026
Merged

jokasimr merged 5 commits into
mainfrom
fix-scope-css

Conversation

@jokasimr

@jokasimr jokasimr commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3921

This will break the repr in older browsers that don't support scope. But I don't think that is a problem.

@jokasimr
jokasimr requested a review from YooSunYoung July 1, 2026 13:13
box-sizing: border-box !important;
}

:scope .sc-header > label,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these :scope selectors required? From what I understand, the @scope is enough so that these rules only apply to our own elements.

@jokasimr jokasimr Jul 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's true, the :scope selectors are not to protect the outer page from our rules, it's a specificity "tie-breaker" to protect our settings from the outer scope. They could be removed and replaced with !important. But if we can get away with something more gentle, that seems good to me.

Seems like a misunderstanding on my part. Most of the :scope selectors here can probably be removed.

grid-template-columns:
max-content max-content max-content max-content max-content max-content
max-content !important;
grid-template-areas: "name parent objtype shape dtype unit preview" !important;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did you remove this? Was this broken all along?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the old grid-area rules were ignored because the identifiers were quoted, but that accidentally made the layout work, because then the content was then laid out according to the default layout.

But when this was fixed the rows started overlapping like this:

Screenshot from 2026-07-01 15-32-30

So for now I removed the templates since the layout seems to work anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And it looks fine in notebooks as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it looks fine

@jokasimr

jokasimr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Rendered docs can be found here: https://remote-unzip.scipp.deno.net/scipp/scipp/fix-scope-css

@jokasimr
jokasimr merged commit 44b6c0a into main Jul 2, 2026
4 checks passed
@jokasimr
jokasimr deleted the fix-scope-css branch July 2, 2026 08:14
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.

Scipp html repr breaks when surrounding page has CSS rules that interfere (mkdocs).

2 participants