{"id":20567,"date":"2024-11-19T11:35:26","date_gmt":"2024-11-19T03:35:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20567\/"},"modified":"2024-11-19T11:35:26","modified_gmt":"2024-11-19T03:35:26","slug":"sublime%e6%80%8e%e4%b9%88%e7%94%a8less","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20567\/","title":{"rendered":"sublime\u600e\u4e48\u7528less"},"content":{"rendered":"<blockquote><p>\n  \u5728 sublime text \u4e2d\u4f7f\u7528 less \u6d89\u53ca\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 less \u63d2\u4ef6\u521b\u5efa less \u6587\u4ef6 (.less)\u7f16\u5199 less \u4ee3\u7801\u7f16\u8bd1 less \u6587\u4ef6\uff08\u53ef\u9009\uff09less \u7684\u91cd\u8981\u529f\u80fd\u5305\u62ec\u53d8\u91cf\u3001\u5d4c\u5957\u548c\u6df7\u5408\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040306002227729.jpg\" class=\"aligncenter\" title=\"sublime\u600e\u4e48\u7528less\u63d2\u56fe\" alt=\"sublime\u600e\u4e48\u7528less\u63d2\u56fe\" \/><\/p>\n<p><strong>Sublime Text \u4e2d\u4f7f\u7528 LESS<\/strong><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 LESS\uff1f<\/strong><\/p>\n<p>Sublime Text \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u4f7f\u7528 LESS\uff08\u4e00\u79cd CSS \u6269\u5c55\u8bed\u8a00\uff09\u3002\u8981\u4f7f\u7528 LESS\uff0c\u60a8\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 LESS \u63d2\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 Sublime Text \u7684 <strong>Package Control<\/strong> \u63a7\u5236\u53f0\uff08\u4f7f\u7528\u5feb\u6377\u952e Ctrl + Shift + P\uff09\u3002<\/li>\n<li>\u8f93\u5165 Install Package \u5e76\u9009\u62e9 it\u3002<\/li>\n<li>\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165 LESS \u5e76\u5b89\u88c5\u8be5\u63d2\u4ef6\u3002<\/li>\n<\/ul>\n<p><strong>2. \u521b\u5efa LESS \u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528 .less \u4f5c\u4e3a\u6269\u5c55\u540d\uff08\u4f8b\u5982\uff0cmystyle.less\uff09\u3002<\/li>\n<\/ul>\n<p><strong>3. \u7f16\u5199 LESS \u4ee3\u7801\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728 LESS \u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u7f16\u5199 LESS \u4ee3\u7801\u3002LESS \u8bed\u6cd5\u7c7b\u4f3c\u4e8e CSS\uff0c\u4f46\u63d0\u4f9b\u4e86\u53d8\u91cf\u3001\u5d4c\u5957\u548c\u6df7\u5408\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002<\/li>\n<\/ul>\n<p><strong>4. \u7f16\u8bd1 LESS \u6587\u4ef6\uff08\u53ef\u9009\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Sublime Text \u4e2d\u7684 LESS \u63d2\u4ef6\u4f1a\u81ea\u52a8\u7f16\u8bd1 LESS \u6587\u4ef6\uff0c\u4f46\u60a8\u4e5f\u53ef\u4ee5\u624b\u52a8\u8fdb\u884c\u7f16\u8bd1\u3002<\/li>\n<li>\u8981\u624b\u52a8\u7f16\u8bd1\uff0c\u8bf7\u8f6c\u5230 <strong>LESS<\/strong> \u83dc\u5355\u5e76\u9009\u62e9 <strong>Compile to CSS<\/strong>\u3002<\/li>\n<\/ul>\n<p><strong>LESS \u4e2d\u7684\u91cd\u8981\u529f\u80fd\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u53d8\u91cf\uff1a<\/strong>\u7528\u4e8e\u5b58\u50a8\u548c\u91cd\u7528\u503c\u3002<\/li>\n<li> <strong>\u5d4c\u5957\uff1a<\/strong>\u5141\u8bb8\u60a8\u5c06\u6837\u5f0f\u5d4c\u5957\u5728\u5176\u4ed6\u6837\u5f0f\u4e2d\u3002<\/li>\n<li> <strong>\u6df7\u5408\uff1a<\/strong>\u5141\u8bb8\u60a8\u521b\u5efa\u53ef\u91cd\u7528\u7684\u6837\u5f0f\u7247\u6bb5\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528 LESS \u7f16\u5199\u7b80\u5355\u6837\u5f0f\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>@primary-color: #007bff;\n\nbody {\n  color: @primary-color;\n  background-color: #f5f5f5;\n}\n\na {\n  color: darken(@primary-color, 10%);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u751f\u6210\u4ee5\u4e0b CSS\uff1a<\/p>\n<pre>body {\n  color: #007bff;\n  background-color: #f5f5f5;\n}\n\na {\n  color: #0063d6;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u7528less\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 sublime text \u4e2d\u4f7f\u7528 less \u6d89\u53ca\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 less \u63d2\u4ef6\u521b\u5efa less \u6587\u4ef6 (.less)\u7f16\u5199 less \u4ee3\u7801\u7f16\u8bd1 less \u6587\u4ef6\uff08\u53ef\u9009\uff09less \u7684\u91cd\u8981\u529f\u80fd\u5305\u62ec\u53d8\u91cf\u3001\u5d4c\u5957\u548c\u6df7\u5408\u3002 Sublime Text \u4e2d\u4f7f\u7528 LESS \u5982\u4f55\u4f7f\u7528 LESS\uff1f Sublime Text \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u4f7f\u7528 LESS\uff08\u4e00\u79cd CSS \u6269\u5c55\u8bed\u8a00\uff09\u3002\u8981\u4f7f\u7528 LESS\uff0c\u60a8\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 LESS \u63d2\u4ef6\uff1a \u6253\u5f00 Sublime Text \u7684 Package Control \u63a7\u5236\u53f0\uff08\u4f7f\u7528\u5feb\u6377\u952e Ctrl + Shift + P\uff09\u3002 \u8f93\u5165 Install Package \u5e76\u9009\u62e9 it\u3002 \u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165 LESS \u5e76\u5b89\u88c5\u8be5\u63d2\u4ef6\u3002 2. \u521b\u5efa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20567","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20567"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20567\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}