Less hack compatibility, lesshack
Less hack compatibility
Css compatibility is inevitable, so how to hack when writing css code with less? If the css method is used to directly write a code similar to "\ 9", an error is returned. The following are two small methods I have tried for your reference only:
1. First define a variable "/* \ **/" and add this variable to the hack to compile the variable. No error will be reported:
@ Hack :~ "/* \ **/"; # Box {background-color @ {hack}: blue \ 9 ;}
The compiled css code is:
# Box {background-color/* \ **/: blue \ 9 ;}
2. the principle of the second method is similar to that of the first method. It just defines the hack symbol "\ 9" as a variable and adds it to the end of the less code so that the complete css hack code can be generated during compilation, no error is reported.
@ Hack :~ "\ 9"; # box {background-color: blue @ hack ;}
The compiled css code is the most familiar one:
# Box {background-color: blue \ 9 ;}