Closed justgook closed 7 years ago
You better need to keep units in your value definition.
Hi @TrySound I have the need to do this as well.
I see you have closed this, so there must be a resolution but I am not getting it.
I am not sure I understand what you mean by "You better need to keep units in your value definition"? What would that look like?
Thanks!
Hi @theinterned I meant keeping numbers and units separatly doesn't make lot of sense.
@value text: 16px;
ah okay ... so our use case is that we need to define values with units for use in our css modules, and share unitless values for use in javascript.
our "solution" for now is to use calc
like so:
/* values.css */
@value lineHeight: 20;
@value lineHeightPx: calc(lineHeight * 1px);
// some.js
@import { lineHeight } from "values.css";
const myHeight = 3 * lineHeight;
/* some.css */
@value lineHeightPx from "values.css";
.someThing {
line-height: lineHeightPx;
margin-bottom: lineHeightPx;
}
etc...
for some part i need units and for others not - so for me is just create raw + px-postfixed units that is totally same.. so i cannot found way how to append / clear units from values