{"id":16543,"date":"2022-02-05T16:26:35","date_gmt":"2022-02-05T07:26:35","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=16543"},"modified":"2023-05-27T18:23:47","modified_gmt":"2023-05-27T09:23:47","slug":"%e3%80%90css%e3%80%91%e3%80%8ctailwindcss%e3%80%8d%e3%81%ae%e5%86%8d%e5%88%a9%e7%94%a8%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=16543","title":{"rendered":"\u3010CSS\u3011\u300cTailwindCSS\u300d\u306e\u518d\u5229\u7528\u306b\u3064\u3044\u3066(@apply)\u3001\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc(@responsive\u3001@screen\u306a\u3069\uff09"},"content":{"rendered":"<h2>@apply<\/h2>\n<p>tailwind\u306f\u3069\u3046\u3057\u3066\u3082\u9577\u304f\u306a\u308b\u306e\u3067\u53ef\u8aad\u6027\u304c\u843d\u3061\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u5834\u5408\u306f\u4f3c\u305f\u3088\u3046\u306acss\u3092\u307e\u3068\u3081\u3066\u518d\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\uff08\u901a\u5e38\u306ecss\u306e\u3088\u3046\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u307f\u305f\u3044\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u306d\u3002\uff09<\/p>\n<h3>\u8a18\u8ff0\u65b9\u6cd5<\/h3>\n<h4>CSS<\/h4>\n<pre class=\"lang:default decode:true\">.matome {\r\n  @apply {tailwindcss\u306e\u8a18\u8ff0}\r\n}<\/pre>\n<h4>HTML<\/h4>\n<pre class=\"lang:default decode:true\">&lt;div class=\"matome\"&gt;\u307e\u3068\u3081&lt;\/div&gt;<\/pre>\n<h3>\u6ce8\u610f\u70b9<\/h3>\n<p>@apply\u3092\u4f7f\u3044\u3059\u304e\u308b\u3068\u7ba1\u7406\u304c\u5927\u5909\u306b\u306a\u308a\u305d\u308c\u306f\u305d\u308c\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3069\u3046\u3057\u3066\u3082\u4f7f\u3044\u56de\u3057\u304c\u591a\u304f\u306a\u308b\u3082\u306e\u306e\u307f\u4f7f\u3046\u3088\u3046\u306b\u3057\u3001\u3067\u304d\u308b\u3060\u3051\u307e\u3068\u3081\u305a\u306b\u8a18\u8ff0\u3057\u3066\u3044\u304f\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>VSCode\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408<\/h3>\n<p>@apply\u306bVSCode\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u304f\u3066\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u8272\u3005\u89e3\u6c7a\u7b56\u306f\u3042\u308b\u307f\u305f\u3044\u3067\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u300cPostCSS Language Support\u300d<\/strong><\/span>\u3068\u3044\u3046VSCode\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u89e3\u6c7a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u306e\u57fa\u672c\u7684\u306a\u8a18\u8ff0<\/h2>\n<h3>sm:${class\u540d}<\/h3>\n<p>640px\u4ee5\u4e0a\u306e\u5834\u5408\u3002\u300c\u30b9\u30de\u30db\u7aef\u672b\u306e\u6a2a\u5e45\u300d\u3092\u610f\u8b58\u3059\u308b\u5834\u5408\u306b\u4f7f\u3046\u3002<\/p>\n<h3>md:${class\u540d}<\/h3>\n<p>768px\u4ee5\u4e0a\u306e\u5834\u5408\u3002\u300c\u30bf\u30d6\u30ec\u30c3\u30c8\u306e\u6700\u5c0f\u5e45\u300d\u3092\u610f\u8b58\u3059\u308b\u5834\u5408\u306b\u4f7f\u3046\u3002\uff08iPad mini\u304c\u3053\u306e\u30b5\u30a4\u30ba\u306e\u305f\u3081\uff09<\/p>\n<h3>lg:${class\u540d}<\/h3>\n<p>1024px\u4ee5\u4e0a\u306e\u5834\u5408\u3002\u300c\u30bf\u30d6\u30ec\u30c3\u30c8\u306e\u6700\u5927\u5e45\u300d\u3092\u610f\u8b58\u3059\u308b\u5834\u5408\u306b\u4f7f\u3046\u3002(iPad Pro\u306e\u6a2a\u5e45\u304c\u3053\u308c\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\uff09\u3001\u57fa\u672c\u7684\u306b\u3053\u308c\u4ee5\u4e0a\u306e\u5e45\u306fPC\u30c7\u30b6\u30a4\u30f3\u3068\u6c7a\u3081\u3064\u3051\u3066PC\u30c7\u30b6\u30a4\u30f3\u306b\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<h3>xl:${class\u540d}<\/h3>\n<p>1280px\u4ee5\u4e0a\u306e\u5834\u5408\u3002\u5927\u304d\u3044\u30e2\u30cb\u30bf\u30fc\u306e\u6700\u5927\u30b5\u30a4\u30ba\u3092\u610f\u8b58\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u4f7f\u3046\u3002<\/p>\n<h3>2xl:${class\u540d}<\/h3>\n<p>1536px\u4ee5\u4e0a\u306e\u5834\u5408<\/p>\n<h2>\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u306e\u95be\u5024\u3092\u8a2d\u5b9a\uff08@responsive\uff09<\/h2>\n<p>\u300c@variants responsive \\{...}\u300d\u3092\u7701\u7565\u3057\u305f\u8a18\u8ff0\u65b9\u6cd5\u3002<span style=\"color: #ff0000;\"><strong>\u300ctailwind.config.js\u300d<\/strong><\/span>\u306b\u3066\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u30fc\u306e\u95be\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default decode:true\">@responsive {\r\n   .\u30af\u30e9\u30b9\u540d {}\r\n}<\/pre>\n<h2>\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u306e\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a\uff08@screen\uff09<\/h2>\n<p>Tailwind CSS\u306e\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u30fc\u306e\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u3046\u66f8\u304d\u65b9\u3067\u3059\u3002<\/p>\n<h3>\u30e1\u30ea\u30c3\u30c8<\/h3>\n<p>\u30e1\u30c7\u30a3\u30a2\u30af\u30a8\u30ea\u30fc\u306e\u8a18\u8ff0\u91cf\u3092\u6e1b\u3089\u3057\u3064\u3064\u3001@screen\u306b\u66f8\u304d\u65b9\u3092\u7d71\u4e00\u3067\u304d\u307e\u3059\u3002\u69d8\u3005\u306a\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u4e71\u7acb\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u4fee\u6b63\u3084\u8abf\u67fb\u306a\u3069\u306e\u624b\u9593\u3092\u8efd\u6e1b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default decode:true  \">@screen sm {\r\n  .\u30af\u30e9\u30b9\u540d {}\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"@apply tailwind\u306f\u3069\u3046\u3057\u3066\u3082\u9577\u304f\u306a\u308b\u306e\u3067\u53ef\u8aad\u6027\u304c\u843d\u3061\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u5834\u5408\u306f\u4f3c\u305f\u3088\u3046\u306acss\u3092\u307e\u3068\u3081\u3066\u518d\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\uff08\u901a\u5e38\u306ecss\u306e\u3088\u3046\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u307f\u305f\u3044\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u306d\u3002\uff09 \u8a18\u8ff0\u65b9\u6cd5 CSS [&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\/16543"}],"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=16543"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16543\/revisions"}],"predecessor-version":[{"id":20135,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16543\/revisions\/20135"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16543"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}