NickName:user4913694 Ask DateTime:2015-06-11T12:02:48 Hover color cross-site for each color If I have the following variable: @text-c: #cccccc; Is there a way to specify the hover variant of the color (in this case the colour #aaaaaa) so it applies cross-site, without having to add it in each separate :hover rule? Copyright Notice:Content Author:「user4913694」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/30771359/hover-color-cross-site-for-each-color Answers seven-phases-max 2015-06-11T04:39:42 Mixin and extend are probably what you're looking for. The variable itself does not say yet how or where you use it (be it either for some color property or not) or if you use it at all. \nSo instead of relying on some indirect logic, as there's no way for compiler to guess to insert :hover {color: #aaaaaa} for every element that has color: #cccccc, first of all because :hover \"sub-style\" is not inherited across elements like properties do (e.g. what if you just set body {color: @text-c}?), make it explicit, e.g. (not optimized variant just to illustrate the method):\n\n// \"color team\"\n.text-c() {\n color: #cccccc;\n &:hover {color: #aaaaaa}\n}\n\n// usage \n\ndiv.zoo {\n .text-c();\n}\n\nspan.park {\n .text-c();\n}\n\ntd#life {\n .text-c();\n}\n\n// etc.\n\n\nAn actual optimized (most likely extending some template instead of copying the same properties every time) would depend on how/where/how-often/etc. you're going to use it and (not-less-important) how (and if) you plan it to be customized (for example see @Harry's answer on how to make a generic mixin instead of color-value-hardcoded like I did above). ",