As far as I remember syntax in the following example is invalid:
:root { --value: 5; } div { padding: var(--value) px; /* 5px */ }
We can not build up values in CSS the way it depicted in the example above, we should always combine it with the calc(), like this:
calc()
:root { --value: 5; } div { padding: calc(var(--value) * 1px); /* 5px */ }
Great catch!!!! Let me fix that, thank you!!!! 💪
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As far as I remember syntax in the following example is invalid:
We can not build up values in CSS the way it depicted in the example above,
we should always combine it with the
calc()
, like this:Great catch!!!! Let me fix that, thank you!!!! 💪