{"id":1566,"date":"2018-10-25T18:31:58","date_gmt":"2018-10-25T09:31:58","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1566"},"modified":"2018-10-25T18:31:58","modified_gmt":"2018-10-25T09:31:58","slug":"mixin","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/mixin\/","title":{"rendered":"@mixin"},"content":{"rendered":"<p>Sass\u306e@mixin\u3068\u3044\u3046\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u4eca\u307e\u3067\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u8a18\u8ff0\u3082\u3001\u52b9\u7387\u7684\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>@mixin \u306b\u4efb\u610f\u3067\u540d\u524d\u3092\u6307\u5b9a\u3057\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3072\u3068\u307e\u3068\u307e\u308a\u306e\u5b9a\u7fa9\u3068\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f7f\u7528\u3059\u308b\u3068\u304d\u306b\u306f\u3001@include\u3067\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\n@mixin font {\r\n     color:#333;\r\n     font-size:14px;\r\n     font-weight:bold;\r\n}\r\n.text {\r\n     @include font;\r\n}\r\n<\/pre>\n<p>\u307e\u305f\u5909\u6570\u3092\u4f7f\u3063\u3066<\/p>\n<pre>\r\n@mixin box($size) {\r\n     width: $size;\r\n     height: $size;\r\n}\r\n\u25a0scss\r\n.content {\r\n     @include box(300px);\r\n}\r\n\u25a0css{\r\n     width: 300px;\r\n     height: 300px;\r\n}\r\n<\/pre>\n<p>\u5909\u6570$size\u306b\u683c\u7d0d\u3055\u308c\u305fpx\u306e\u5024\u304cwidth\u3068height\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u3092\u6d3b\u7528\u3057\u3066\u3001\u6307\u5b9a\u306e\u591a\u3044\u30dd\u30b8\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u306a\u3069\u3092@mixin\u3092\u4f7f\u7528\u3059\u308b\u3068<\/p>\n<pre>\r\n@mixin position ($top: auto, $right: auto, $bottom: auto, $left: auto) {\r\n     position: absolute;\r\n     top: $top;\r\n     right: $right;\r\n     bottom: $bottom;\r\n     left: $left;\r\n}\r\n\r\n.content {\r\n     @include position(10px, 50px, 50px, 0);\r\n}\r\n\r\n.content {\r\n  position: absolute;\r\n  top: 10px;\r\n  right: 50px;\r\n  bottom: 50px;\r\n  left: 0px;\r\n}\r\n<\/pre>\n<p>\u4f4d\u7f6e\u306e\u6307\u5b9a\u304c@include position(10px, 50px, 50px, 0);\u306e\u4e00\u884c\u3060\u3051\u3067\u6e08\u3080\u306e\u3067\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3084\u4f5c\u696d\u52b9\u7387\u306b\u3082\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sass\u306e@mixin\u3068\u3044\u3046\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u4eca\u307e\u3067\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u8a18\u8ff0\u3082\u3001\u52b9\u7387\u7684\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u53ef\u80fd\u3067\u3059\u3002 @mixin \u306b\u4efb\u610f\u3067\u540d\u524d\u3092\u6307\u5b9a\u3057\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3072\u3068\u307e\u3068\u307e\u308a\u306e\u5b9a\u7fa9\u3068\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u4f7f\u7528\u3059\u308b\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-11 19:39:35","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1566"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1566"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1566\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}