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

--file-margins css var could be split #161

Open
daledesilva opened this issue Nov 23, 2024 · 0 comments
Open

--file-margins css var could be split #161

daledesilva opened this issue Nov 23, 2024 · 0 comments

Comments

@daledesilva
Copy link

As a developer, I'm trying to make sure my visual elements line up with the horizontal margins of the text in the note.
To do this, I'm using something similar to the below (but it could equally be padding-right or margin-inline, etc.

right: var(file-margins, 5%);

This works on desktop because file-margins is defined as var(--size-4-6), however, on mobile it fails but doesn't trigger the fall back because file-margins is now given 2 values: var(--size-4-2) var(--size-4-6)

These values will change depending on the theme and therefore file-margins is not usable unless you're using explicitly on something that can take margin on all 4 sides.

This may well be the purpose of file-margins, however, it leaves there no way to use an individual margin value if needed (Either in a plugin or theme).

I'd propose adding 2 or 4 more variables so that the definitions could be:

--file-margin-block: var(--size-4-2);
--file-margin-inline: var(--size-4-6);
--file-margins: var(--file-margin-block) var(--file-margin-inline);

That way devs could utilise logical values without breaking anything existing.

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

No branches or pull requests

1 participant