{"id":2586,"date":"2023-11-14T12:32:15","date_gmt":"2023-11-14T04:32:15","guid":{"rendered":""},"modified":"2023-11-14T12:32:15","modified_gmt":"2023-11-14T04:32:15","slug":"Less Mixins","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/2586.html","title":{"rendered":"Less Mixins"},"content":{"rendered":"
\n
\n.round-borders {\n border-radius: 5px;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n}\n#menu {<\/span>\n color: gray;\n .round-borders;\n}<\/pre>\n<\/code>\n <\/div>\n
\n Mixin\u8f93\u51fa:\n <\/div>\n\n\n.round-borders {\n border-radius: 5px;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n}\n#menu {<\/span>\n color: gray;\n border-radius: 5px;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n}<\/pre>\n<\/code>\n <\/div>\n
lessMixin\u7684\u4f7f\u7528<\/h2>\n
\n\n\n Mixin <\/td>\n \u8bf4\u660e<\/td>\n<\/tr>\n \nNot Outputting the Mixin<\/td>\n \u60a8\u53ea\u9700\u5c06\u62ec\u53f7\u653e\u5728\u8f93\u51fa\u4e4b\u540e\uff0c\u5373\u53ef\u4f7fMixin\u5728\u8f93\u51fa\u4e2d\u6d88\u5931\u3002 <\/td>\n<\/tr>\n \nSelectors in Mixins<\/td>\n mixins\u53ef\u4ee5\u5305\u542b\u5c5e\u6027\u4ee5\u53ca\u9009\u62e9\u5668\u3002<\/td>\n<\/tr>\n \n\u547d\u540d\u7a7a\u95f4<\/td>\n \u547d\u540d\u7a7a\u95f4\u7528\u4e8e\u6309\u901a\u7528\u540d\u79f0\u5bf9\u6df7\u5408\u5305\u8fdb\u884c\u5206\u7ec4\u3002<\/td>\n<\/tr>\n \n\u53d7\u4fdd\u62a4\u7684\u547d\u540d\u7a7a\u95f4<\/td>\n \u5982\u679c\u5bf9\u540d\u79f0\u7a7a\u95f4\u5e94\u7528\u7684\u9632\u62a4\u6761\u4ef6\u8fd4\u56detrue\uff0c\u5219\u4f7f\u7528\u5176\u5b9a\u4e49\u7684\u6df7\u5408\u3002<\/td>\n<\/tr>\n \n!important\u5173\u952e\u5b57<\/td>\n !important\u5173\u952e\u5b57\u7528\u4e8e\u8986\u76d6\u7279\u5b9a\u5c5e\u6027\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n \u8ba9\u6211\u4eec\u4ee5\u4e00\u4e2a\u4f8b\u5b50\u6765\u6f14\u793a\u5728Less\u6587\u4ef6\u4e2d\u4f7f\u7528mixins\u3002\n <\/div>\n\n \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\"simple.html\"\u7684HTML\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u6570\u636e\u3002\n <\/div>\n\n HTML\u6587\u4ef6:simple.html\n <\/div>\n\n\n<!DOCTYPE html>\n<html>\n<head>\n <link rel=\"stylesheet\"<\/span> href=\"simple.css\"<\/span> type=\"text\/css\"<\/span> \/>\n <title>Less Mixin Example<\/title>\n<\/head>\n<body>\n<h1>Welcome to lidihuo<\/h1>\n<h3>MAIN BENEFITS YOU GET FROM OUR COMPANY :<\/h3>\n<p class=\"p1\"<\/span>> Life Time Validity.<\/p>\n<p class=\"p2\"<\/span>>Training by Java Professionals.<\/p>\n<p class=\"p3\"<\/span>>Small Batches to focus on each student.<\/p>\n<\/body>\n<\/html><\/pre>\n<\/code>\n <\/div>\n
\n \u73b0\u5728\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\"simple.less\"\u7684\u6587\u4ef6\u3002\u5b83\u7c7b\u4f3c\u4e8eCSS\u6587\u4ef6\u3002\u552f\u4e00\u7684\u533a\u522b\u662f\u5b83\u4ee5\" .less\"\u6269\u5c55\u540d\u4fdd\u5b58\u3002\n <\/div>\n\n less\u7684\u6587\u4ef6: simple.less\n <\/div>\n\n\n.p1{\n color:brown;\n}\n.p2{\n background : lightgreen;\n .p1<\/span>();\n}\n.p3{\n background : lightgrey;\n .p1;\n} <\/pre>\n<\/code>\n <\/div>\n
\n \u5c06\u6587\u4ef6\"simple.html\"\u548c\"simple.less\"\u90fd\u653e\u5165Node.js\u7684\u6839\u6587\u4ef6\u5939\u4e2d\n <\/div>\n\n \u73b0\u5728\uff0c\u6267\u884c\u4ee5\u4e0b\u4ee3\u7801: lessc simple.less simple.css\n <\/div>\n
<\/p>\n
\n \u8fd9\u5c06\u7f16\u8bd1\"simple.less\"\u6587\u4ef6\u3002\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a\" simple.css\"\u7684CSS\u6587\u4ef6\u3002\n <\/div>\n\n \u4f8b\u5982:\n <\/div>\n\n \u8fd9\u5c06\u7f16\u8bd1\"simple.less\"\u6587\u4ef6\u3002\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a\" simple.css\"\u7684CSS\u6587\u4ef6\u3002\n <\/div>\n\n \u4f8b\u5982:\n <\/div>\n
<\/p>\n
\n \u751f\u6210\u7684CSS\" simple.css\"\u5177\u6709\u4ee5\u4e0b\u4ee3\u7801:\n <\/div>\n\n\n.p1 {\n color: brown;\n}\n.p2 {\n background: lightgreen;\n color: brown;\n}\n.p3 {\n background: lightgrey;\n color: brown;\n}<\/pre>\n<\/code>\n <\/div>\n
\n Less \u53c2\u6570\u6df7\u5408
\n Less Mixins\u4f5c\u4e3a\u51fd\u6570
\n \u5c06\u89c4\u5219\u96c6\u4f20\u9012\u7ed9Mixins\n <\/div>\n <\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[177],"tags":[],"class_list":["post-2586","post","type-post","status-publish","format-standard","hentry","category-less-jc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/2586"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=2586"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/2586\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=2586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=2586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=2586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}