{"id":16579,"date":"2022-02-06T10:16:11","date_gmt":"2022-02-06T01:16:11","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=16579"},"modified":"2023-10-08T00:08:27","modified_gmt":"2023-10-07T15:08:27","slug":"%e3%80%90css%e3%80%91tailwind-css%e3%81%aejitjust-in-time%e3%83%a2%e3%83%bc%e3%83%89%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=16579","title":{"rendered":"\u3010CSS\u3011Tailwind CSS3\u4ee5\u964d\u306eJIT(Just In Time)\u30e2\u30fc\u30c9\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Twailwindcss2\u307e\u3067\u306f<\/h2>\n\n\n\n<p>purge.css\u3092\u4f7f\u3044\u307e\u3059\u3002\u901a\u5e38\u3001tailwindcss\u306f71kb\u307b\u3069\u306e\u5bb9\u91cf\u306a\u306e\u3067\u3059\u304c\u3001\u3055\u3089\u306b\u4e0d\u8981\u306acss\u3092\u524a\u9664\u3057\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u826f\u304f\u306a\u308a\u307e\u3059\u3002\uff08\u3061\u306a\u307f\u306b\u3001bootstrap\u3068\u304b\u3067\u306f\u307e\u3060\u3053\u306e\u6280\u8853\u306f\u5c0e\u5165\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u524a\u9664\u5f8c\u306e\u5bb9\u91cf<\/h3>\n\n\n\n<p>\u901a\u5e38\u5229\u7528\u3067\u3042\u308c\u3070\u3001<span style=\"color: #ff0000;\"><strong>10kb\u7a0b\u5ea6<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tailwind3\u4ee5\u964d\u3067\u5c0e\u5165\u3055\u308c\u305fJIT\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>tailwind.config.js\u306e\u4e2d\u306econtent\u306b\u6307\u5b9a\u3057\u305f\u3082\u306e\u306b\u95a2\u3057\u3066\u306f\u3001\u5b9f\u969b\u306b\u4f7f\u308f\u308c\u305fCSS\u3060\u3051\u304c\u4f7f\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\uff08tailwindcss2\u307e\u3067\u306epurge\u3068\u540c\u3058\u52b9\u679c\u3067\u3059\u306d\u3002\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JIT\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d3\u30eb\u30c9\u304c\u65e9\u3044<\/h3>\n\n\n\n<p>\u30d3\u30eb\u30c9\u304c\u65e9\u3044\u306e\u306b\u672c\u756a\u540c\u69d8\u306e\u8efd\u91cf\u306aCSS\u3092\u4f7f\u3063\u3066\u958b\u767a\u3092\u7d9a\u3051\u3089\u308c\u308b\u3068\u3044\u3046\u826f\u3044\u3068\u3053\u308d\u3069\u308a\u3067\u3059\u3002\u958b\u767a\u4e2d\u3082\u4f55\u4e07\u884c\u3082\u3042\u308b\u3088\u3046\u306a\u5de8\u5927\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u3044\u3061\u3044\u3061\u8aad\u307f\u8fbc\u3093\u3067\u3044\u305f\u3089\u660e\u3089\u304b\u306b\u8aad\u307f\u8fbc\u307f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306f\u843d\u3061\u3066\u3057\u307e\u3044\u307e\u3059\u304b\u3089\u306d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d0\u30ea\u30a2\u30f3\u30c8\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/h3>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300cmd\u300d\u3068\u300chover\u300d\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">md:hover:font-bold<\/pre>\n\n\n\n<p>\u306a\u305c\u901a\u5e38\u306e\u8a2d\u5b9a\u3067\u306f\u3067\u304d\u306a\u304b\u3063\u305f\u3068\u3044\u3046\u3068\u7d44\u307f\u5408\u308f\u305b\u304c\u7121\u9650\u5927\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u884c\u6570\u304c\u5927\u304d\u304f\u306a\u308a\u3059\u304e\u308b\u305f\u3081\u3002\u305f\u3060\u3001JIT\u3067\u3042\u308c\u3070\u5fc5\u8981\u306a\u90e8\u5206\u3060\u3051\u751f\u6210\u3059\u308b\u306e\u3067\u3053\u3046\u3044\u3046\u306e\u304c\u53ef\u80fd\u306b\u306a\u3063\u305f\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u67d4\u8edf\u6027\u304c\u9ad8\u3044<\/h3>\n\n\n\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">top-[113px]<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4e0a\u304c\u308b\u3002<\/h3>\n\n\n\n<p>\u672c\u756a\u30d3\u30eb\u30c9\u6642\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001JIT\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u300cNODE_ENV=production\u300d\u306e\u90e8\u5206\u304c\u306a\u304f\u3066\u3082purge\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3067\u3059\u3002\uff08\u305f\u3060\u3001tailwind CSS3\u4ee5\u964d\u306fpurge\u81ea\u4f53\u304c\u306a\u304f\u306a\u308acontent\u306b\u306a\u3063\u305f\u306e\u3067\u95a2\u4fc2\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"build\": \"NODE_ENV=production postcss style.css -o dist.css\"<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8a2d\u5b9a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">tailwind.config.js<\/h3>\n\n\n\n<p>\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067JIT\u3092\u9069\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">module.exports = {\n  mode: \"jit\",\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">package.json<\/h3>\n\n\n\n<p>\u958b\u767a\u6642\u306e\u30d3\u30eb\u30c9\u30b3\u30de\u30f3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u305d\u3046\u3059\u308b\u3053\u3068\u3067\u9069\u5b9c\u66f8\u304d\u63db\u3048\u308b\u305f\u3073\u306b\u65b0\u3057\u3044CSS\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3089\u53d6\u3063\u3066\u304d\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    \"dev\": \"TAILWIND_MODE=watch postcss style.css -o dist.css -w\",<\/pre>\n","protected":false},"excerpt":{"rendered":"Twailwindcss2\u307e\u3067\u306f purge.css\u3092\u4f7f\u3044\u307e\u3059\u3002\u901a\u5e38\u3001tailwindcss\u306f71kb\u307b\u3069\u306e\u5bb9\u91cf\u306a\u306e\u3067\u3059\u304c\u3001\u3055\u3089\u306b\u4e0d\u8981\u306acss\u3092\u524a\u9664\u3057\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u826f\u304f\u306a\u308a\u307e\u3059\u3002\uff08\u3061\u306a\u307f\u306b\u3001bootst [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[64],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16579"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16579"}],"version-history":[{"count":14,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16579\/revisions"}],"predecessor-version":[{"id":23518,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16579\/revisions\/23518"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16579"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}