{"id":2107,"date":"2022-07-29T11:31:21","date_gmt":"2022-07-29T02:31:21","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=2107"},"modified":"2023-01-15T19:16:02","modified_gmt":"2023-01-15T10:16:02","slug":"styled-components","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=2107","title":{"rendered":"styled-components"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">styled-components\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>CSS in JS\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e00\u3064\u3067\u3059\u3002CSS in JS\u3068\u306f\u305d\u306e\u540d\u306e\u901a\u308aJS\u306e\u4e2d\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u3053\u306eCSS in JS\u3092\u4f7f\u3046\u3053\u3068\u3067<strong>React\u601d\u60f3\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5358\u4f4d\u3067\u306e\u7ba1\u7406\u304c\u30b9\u30bf\u30a4\u30eb\u306b\u3082\u53ef\u80fd<\/strong>\u306b\u306a\u308a\u307e\u3059\u3002<br>CSS\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001CSS\u3068\u540c\u3058\u8868\u73fe\u529b\u3067\u30b9\u30bf\u30a4\u30eb\u3092\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">styled-components\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h2>\n\n\n\n<p>styled-components\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm install --save styled-components<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\u578b\u5b9a\u7fa9<\/h4>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm install --save-dev @types\/styled-components<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u8a18\u8ff0<\/h2>\n\n\n\n<p>styled-components\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5b9f\u88c5\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u66f8\u5f0f\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>styled.\u8981\u7d20\u540d`\u30b9\u30bf\u30a4\u30eb`<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>import styled from &quot;styled-components&quot;\n\nexport default function Home() {\n  \/\/\u30bf\u30a4\u30c8\u30eb\n  const Title = styled.h1`\n    font-size: 1.5em;\n    text-align: center;\n    color: palevioletred;\n  `;\n\n  \/\/\u30e9\u30c3\u30d1\u30fc\n  const Wrapper= styled.section`\n    padding: 4em;\n    background: papayawhip;\n  `;\n\n  return (\n    &lt;Wrapper&gt;\n      &lt;Title&gt;\n        Hello World!\n      &lt;\/Title&gt;\n    &lt;\/Wrapper&gt;\n  );\n}<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>styled-components\u3068\u306f\uff1f CSS in JS\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e00\u3064\u3067\u3059\u3002CSS in JS\u3068\u306f\u305d\u306e\u540d\u306e\u901a\u308aJS\u306e\u4e2d\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u3002 \u3053\u306eCSS in JS\u3092\u4f7f\u3046\u3053\u3068\u3067React\u601d\u60f3\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5358<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2107","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2107"}],"version-history":[{"count":3,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2107\/revisions"}],"predecessor-version":[{"id":2506,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2107\/revisions\/2506"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}