Reputation: 55
I have a div with display: grid;
I am using css properties / variables to have a dynamic website, which I then update via javascript.
I managed to achieve this using scss
grid-template-columns: var(--user-column-width) $days-shown + unquote('fr');
The question is, is it possible to have something like
grid-template-columns: var(--user-column-width) var(--days-shown)fr;
I did not yet succeed in combining the variable and fractions together. So if possible, how can it be done?
Thanks
Upvotes: 0
Views: 556
Reputation: 2929
You can use calc(1fr * var(--days-shown))
to achieve this, as long as --days-show
is unitless.
Upvotes: 1