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

Refactor Layout #915

Merged
merged 3 commits into from
May 20, 2023
Merged

Conversation

redaktorscha
Copy link
Contributor

Fix Layout component (JS ->TS convertion), 'media' and 'rem' utils; add typings
fixes #902

utils/media.ts Outdated
import { css } from 'styled-components';
import { RuleSet } from 'styled-components/dist/types';

export const mobile = (inner: ReturnType<typeof css>): RuleSet<object> => css`
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to remove RuleSet<object> for these and use the same ReturnType<typeof css> annotation. Perhaps store it to a local type so you can reuse it?

type CSSUtilType = ReturnType<typeof css>

@quantizor
Copy link
Contributor

Thanks for helping with this work! Should be good to merge after that last small refactoring.

@redaktorscha
Copy link
Contributor Author

Thanks for helping with this work! Should be good to merge after that last small refactoring.

fixed & pushed

Copy link
Contributor

@quantizor quantizor left a comment

Choose a reason for hiding this comment

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

Thank you!

@quantizor quantizor merged commit 6377621 into styled-components:main May 20, 2023
@redaktorscha
Copy link
Contributor Author

Thank you!

you're very welcome! )

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.

Help wanted, conversion to TS
2 participants