How to pass parameters to css classes

前端 未结 8 2128
我在风中等你
我在风中等你 2020-12-08 09:57

I want to know is it possible to add some flexibility to css via this:

where .round i

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 10:17

    For anyone stumbling across this in 2018, whilst not fully supported CSS variables now give you the ability to pass a variable directly into your class.

    You can also define root variables and pass them in as well

    This is also scoped to the element as well. If you set the --radius in one element is wont effect another element. Pretty jazzy right!

提交回复
热议问题