{"id":1419,"date":"2022-07-16T09:39:59","date_gmt":"2022-07-16T01:39:59","guid":{"rendered":"https:\/\/zhuxinyong.com\/?p=1419"},"modified":"2022-07-18T11:38:41","modified_gmt":"2022-07-18T03:38:41","slug":"tailwindcss-chou-qu-gong-gong-yang-shi","status":"publish","type":"post","link":"https:\/\/zhuxinyong.com\/?p=1419","title":{"rendered":"Tailwindcss \u62bd\u53d6\u516c\u5171\u6837\u5f0f"},"content":{"rendered":"<p>\u6700\u8fd1\u7528 React + Tailwindcss \u505a\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u9875\u9762\uff1a<a href=\"https:\/\/productly-kappa.vercel.app\/\" target=\"_blank\" rel=\"noopener\">https:\/\/productly-kappa.vercel.app\/<\/a><\/p>\n<p>\u9047\u5230\u4e86\u4e00\u4e2a\u590d\u7528\u7684\u95ee\u9898\uff1a\u4e00\u4e2a\u6837\u5f0f\u591a\u6b21\u4f7f\u7528\uff0c\u600e\u4e48\u529e\uff1f<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/zhuxinyong.com\/wp-content\/uploads\/2022\/07\/16579358446227.jpg\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/zhuxinyong.com\/wp-content\/uploads\/2022\/07\/16579358572768.jpg\" alt=\"\" \/><\/p>\n<p>\u5b98\u65b9\u4e5f\u7ed9\u4e86\u4e00\u4e9b\u5efa\u8bae\uff1a<a href=\"https:\/\/tailwindcss.com\/docs\/reusing-styles\" target=\"_blank\" rel=\"noopener\">https:\/\/tailwindcss.com\/docs\/reusing-styles<\/a><\/p>\n<p>\u8fd9\u6b21\u6211\u4eec\u53ea\u8ba8\u8bba\u4e00\u79cd\uff1a<code>@apply<\/code>\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-plain_text\">&lt;!-- Before extracting a custom class --&gt;\n&lt;button class=&quot;py-2 px-4 bg-blue-500 text-white font-semibold rounded-lg shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-opacity-75&quot;&gt;\n  Save changes\n&lt;\/button&gt;\n\n&lt;!-- After extracting a custom class --&gt;\n&lt;button class=&quot;btn-primary&quot;&gt;\n  Save changes\n&lt;\/button&gt;\n<\/code><\/pre>\n<pre class=\"line-numbers\"><code class=\"language-plain_text\">@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer components {\n  .btn-primary {\n    @apply py-2 px-4 bg-blue-500 text-white font-semibold rounded-lg shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-opacity-75;\n  }\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/zhuxinyong.com\/wp-content\/uploads\/2022\/07\/16579364756285.jpg\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7528 React + Tailwindcss \u505a\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u9875\u9762\uff1ahttps:\/\/productl&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,20,3],"tags":[155,127],"class_list":["post-1419","post","type-post","status-publish","format-standard","hentry","category-all","category-frontend","category-tech","tag-apply","tag-tailwindcss"],"_links":{"self":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/1419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1419"}],"version-history":[{"count":1,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/1419\/revisions"}],"predecessor-version":[{"id":1420,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/1419\/revisions\/1420"}],"wp:attachment":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}