Created
October 1, 2019 16:34
-
-
Save himanoa/9a6bf27e09b0d6001522c905203b8810 to your computer and use it in GitHub Desktop.
コンポーネント時代のcss現実バージョン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import styled from "styled-components" | |
const Button = styled.div` | |
padding: 4px; | |
border: 1px solid #000; | |
` | |
export default React.memo(Button) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import css from "void-css" | |
/* | |
void-cssは架空のモジュールで以下のような感じだと思ってください。実装は無でビルドした時にbabelで消し去られる記述です | |
declare module void-css { | |
css(style: string[]): void | |
export css | |
} | |
*/ | |
css` | |
.button { | |
padding: 4px; | |
border: 1px solid #000; | |
} | |
` | |
const Button: React.FC<{}> = () => ( | |
<div class=".button"></div> | |
) | |
export default React.memo(Button) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="src_理想_button_1dxasdq"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.src_理想_button_1dxasdq { | |
.button { | |
padding: 4px; | |
border: 1px solid #000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
なにがいいたいか