Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Add Type Safety For Length Units In Sizes #7

Open
JamieB-gu opened this issue Aug 10, 2020 · 1 comment
Open

Add Type Safety For Length Units In Sizes #7

JamieB-gu opened this issue Aug 10, 2020 · 1 comment

Comments

@JamieB-gu
Copy link
Contributor

Decide whether to introduce a more sophisticated type for a size value, which will allow us to avoid some usages of calc by calculating some values server-side. For example:

const enum Length {
    Px,
    Vw,
    Percentage,
}

type SizeValue = {
    unit: Length;
    value: number;
}

type Size = {
    breakpoint: Breakpoint;
    size: SizeValue;
}
This was referenced Aug 10, 2020
@mxdvl mxdvl linked a pull request Sep 11, 2020 that will close this issue
@mxdvl mxdvl closed this as completed Sep 11, 2020
@mxdvl mxdvl removed a link to a pull request Sep 11, 2020
@mxdvl mxdvl reopened this Sep 11, 2020
@mxdvl
Copy link
Member

mxdvl commented Sep 11, 2020

Sorry… this need to stay open as it’s for upcoming work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants