{"id":16559,"date":"2022-02-05T18:24:10","date_gmt":"2022-02-05T09:24:10","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=16559"},"modified":"2023-10-08T00:01:20","modified_gmt":"2023-10-07T15:01:20","slug":"%e3%80%90css%e3%80%91%e3%80%8cpostcss%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=16559","title":{"rendered":"\u3010CSS\u3011\u300cpostcss\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">PostCSS\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>Node.js\u88fd\u306eCSS\u5909\u63db\u30c4\u30fc\u30eb\u3067\u3059\u3002\u3055\u307e\u3056\u307e\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067CSS\u30d5\u30a1\u30a4\u30eb\u306b\u3055\u307e\u3056\u307e\u306a\u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u5909\u63db\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001Sass\u3084Tailwind\u3068\u7d44\u307f\u5408\u308f\u305b\u3067\u4f7f\u3046\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3055\u307e\u3056\u307e\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f8b<\/h3>\n\n\n\n<ul>\n<li>\u30d9\u30f3\u30c0\u30fc\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3002(autoprefixer\uff09<\/li>\n\n\n\n<li>\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u9806\u756a\u3092\u5165\u308c\u66ff\u3048\u308b\u3002(CSS Declaration Sorter)<\/li>\n\n\n\n<li>sass\u306a\u3069\u3067\u30d0\u30e9\u30d0\u30e9\u306b\u306a\u3063\u305f\u540c\u3058\u30bb\u30ec\u30af\u30bf\u306e\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u30fc\u3092\u4e00\u3064\u306b\u307e\u3068\u3081\u3066\u304f\u308c\u308b\u3002(css-mqpacker)<\/li>\n\n\n\n<li>\u672a\u6765\u306ecss\u3092\u4eca\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u89e3\u91c8\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002\uff08cssnext\uff09<\/li>\n\n\n\n<li>css\u30ea\u30f3\u30bf\u30fc\uff08stylelint\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">PostCSS\u306e\u5b9f\u614b<\/h2>\n\n\n\n<p>CSS\u30d1\u30fc\u30b5\u30fc(\u5909\u63db\u30c4\u30fc\u30eb)\u3067\u3059\u3002\u5909\u63db\u904e\u7a0b\u306e\u4e2d\u3067\u4e0a\u8ff0\u3057\u305f\u5404\u7a2e\u30d7\u30e9\u30b0\u30a4\u30f3(autoprefixer\u306a\u3069)\u306b\u3088\u308b\u5909\u63db\u51e6\u7406\u3092\u8272\u3005\u3084\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tailwind\u3092\u4f7f\u3046<\/h2>\n\n\n\n<p>\u307b\u3068\u3093\u3069\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001postcss\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066Tailwindcss\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8a2d\u5b9a<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">postcss.config.js<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">module.exports = {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  }\n}<\/pre>\n\n\n\n<p>\u901a\u5e38\u306f\u3001postcss\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066\u300ctailwindcss\u300d\u3084\u300cautoprefixer\u300d\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306a\u5f62\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">package.json<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u3092\u3057\u3066postcss\u306e\u30d3\u30eb\u30c9\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002(\u672c\u756a\u5411\u3051\u306e\u30d3\u30eb\u30c9\u3068\u958b\u767a\u74b0\u5883\u5411\u3051\u306e\u30d3\u30eb\u30c9\u3092\u5206\u3051\u305f\u308a\u3057\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  \"scripts\": {\n    \"dev\": \"postcss style.css -o dist.css\",\n    \"build\": \"NODE_ENV=production postcss style.css -o dist.css\"\n  },<\/pre>\n\n\n\n<p>\u7b2c\u4e00\u5f15\u6570\u304c\u3001\u30d3\u30eb\u30c9\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3001-o\u3067\u51fa\u529b\u5148\u306ecss\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>postcss-cli\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm i -D postcss-cli\nnpm run build<\/pre>\n\n\n\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u30d3\u30eb\u30c9\u5f8c\u306ecss\uff08\u4eca\u56de\u3067\u3044\u3048\u3070\u3001dist.css\uff09\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VSCode\u306e\u30d7\u30e9\u30b0\u30a4\u30f3<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">PostCSS Language Support<\/h3>\n\n\n\n<p>\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5165\u308c\u308b\u3053\u3068\u3067PostCSS\u306e\u69cb\u6587\u306a\u3069\u3092\u89e3\u91c8\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"PostCSS\u3068\u306f\uff1f Node.js\u88fd\u306eCSS\u5909\u63db\u30c4\u30fc\u30eb\u3067\u3059\u3002\u3055\u307e\u3056\u307e\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067CSS\u30d5\u30a1\u30a4\u30eb\u306b\u3055\u307e\u3056\u307e\u306a\u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u5909\u63db\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u5b9f\u52d9\u3067\u306f\u3001Sass\u3084Tailwind\u3068\u7d44\u307f\u5408\u308f\u305b [&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\/16559"}],"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=16559"}],"version-history":[{"count":12,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16559\/revisions"}],"predecessor-version":[{"id":23516,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16559\/revisions\/23516"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16559"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}