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

Unable to use position: running() CSS property #164

Open
rymarren opened this issue Sep 16, 2022 · 0 comments
Open

Unable to use position: running() CSS property #164

rymarren opened this issue Sep 16, 2022 · 0 comments

Comments

@rymarren
Copy link

I am experiencing an issue while using Material UI styled components, which uses this package for CSS types. I was directed to open an issue here by MUI folks: mui/material-ui#34313

Steps to reproduce 🕹

Barebones example:

const StyledThing = styled('div')({ position: 'running(elementName)' });

Current behavior 😯

I get a TS error stating:

The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.

Syntax: static | relative | absolute | sticky | fixed

Initial value: static

Chrome	Firefox	Safari	Edge	IE
1	1	1	12	4
@see — [https://developer.mozilla.org/docs/Web/CSS/position](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

Type '"running(elementName)"' is not assignable to type 'PositionProperty | PropsFunc<{}, PositionProperty | undefined> | undefined'.ts(2322)

Expected behavior 🤔

There should be no TS error, this should work.

Context 🔦

https://developer.mozilla.org/en-US/docs/Web/CSS/position#formal_syntax and https://www.w3.org/TR/css-gcpm-3/#running-syntax describe this new syntax.

This CSS rule is important for creating web experiences that can be printed. See https://pagedjs.org/documentation/7-generated-content-in-margin-boxes/#running-elements%3A-headers%2Ffooter-with-specific-(complex)-content for an example.

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