Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ const styles = css\`.button{color:red;background:blue;padding:10px 20px;}.contai

const styledComponent = styled\`background-color:#ffffff;border-radius:4px;padding:8px;\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`.reset{margin:0;padding:0;box-sizing:border-box;}\`;

const styledDiv = styled.div\`width:100%;height:100vh;background-color:#f0f0f0;\`;

const styledLink = styled["a"]\`text-decoration:none;color:#007bff;font-weight:bold;\`;

const styledButton = styled(Button)\`font-size:16px;color:#333;padding:12px 24px;\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = <div css={\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}>Hello World</div>;

const styledJsx = <style jsx>{\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}</style>;

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -48,6 +68,8 @@ npm install package

const mixedStyles = css\`.button{color:red;}\`;

const mixedStyled = styled.button\`padding:10px;\`;

const mixedQuery = gql\`query{users{name}}\`;

const mixedTemplate = html\`<div><h1>Title</h1></div>\`;
Expand Down Expand Up @@ -157,6 +179,62 @@ const styledComponent = styled\`
padding: 8px;
\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`
.reset {
margin: 0;
padding: 0;
box-sizing: border-box;
}
\`;

const styledDiv = styled.div\`
width: 100%;
height: 100vh;
background-color: #f0f0f0;
\`;

const styledLink = styled["a"]\`
text-decoration: none;
color: #007bff;
font-weight: bold;
\`;

const styledButton = styled(Button)\`
font-size: 16px;
color: #333;
padding: 12px 24px;
\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = (
<div
css={\`
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
\`}
>
Hello World
</div>
);

const styledJsx = (
<style jsx>{\`
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
\`}</style>
);

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -225,6 +303,10 @@ const mixedStyles = css\`
}
\`;

const mixedStyled = styled.button\`
padding: 10px;
\`;

const mixedQuery = gql\`
query {
users {
Expand Down Expand Up @@ -348,6 +430,26 @@ const styles = css\`.button{color:red;background:blue;padding:10px 20px;}.contai

const styledComponent = styled\`background-color:#ffffff;border-radius:4px;padding:8px;\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`.reset{margin:0;padding:0;box-sizing:border-box;}\`;

const styledDiv = styled.div\`width:100%;height:100vh;background-color:#f0f0f0;\`;

const styledLink = styled["a"]\`text-decoration:none;color:#007bff;font-weight:bold;\`;

const styledButton = styled(Button)\`font-size:16px;color:#333;padding:12px 24px;\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = <div css={\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}>Hello World</div>;

const styledJsx = <style jsx>{\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}</style>;

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -384,6 +486,8 @@ npm install package

const mixedStyles = css\`.button{color:red;}\`;

const mixedStyled = styled.button\`padding:10px;\`;

const mixedQuery = gql\`query{users{name}}\`;

const mixedTemplate = html\`<div><h1>Title</h1></div>\`;
Expand Down Expand Up @@ -493,6 +597,62 @@ const styledComponent = styled\`
padding: 8px;
\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`
.reset {
margin: 0;
padding: 0;
box-sizing: border-box;
}
\`;

const styledDiv = styled.div\`
width: 100%;
height: 100vh;
background-color: #f0f0f0;
\`;

const styledLink = styled["a"]\`
text-decoration: none;
color: #007bff;
font-weight: bold;
\`;

const styledButton = styled(Button)\`
font-size: 16px;
color: #333;
padding: 12px 24px;
\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = (
<div
css={\`
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
\`}
>
Hello World
</div>
);

const styledJsx = (
<style jsx>{\`
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
\`}</style>
);

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -561,6 +721,10 @@ const mixedStyles = css\`
}
\`;

const mixedStyled = styled.button\`
padding: 10px;
\`;

const mixedQuery = gql\`
query {
users {
Expand Down Expand Up @@ -684,6 +848,26 @@ const styles = css\`.button{color:red;background:blue;padding:10px 20px;}.contai

const styledComponent = styled\`background-color:#ffffff;border-radius:4px;padding:8px;\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`.reset{margin:0;padding:0;box-sizing:border-box;}\`;

const styledDiv = styled.div\`width:100%;height:100vh;background-color:#f0f0f0;\`;

const styledLink = styled["a"]\`text-decoration:none;color:#007bff;font-weight:bold;\`;

const styledButton = styled(Button)\`font-size:16px;color:#333;padding:12px 24px;\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = <div css={\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}>Hello World</div>;

const styledJsx = <style jsx>{\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}</style>;

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -720,6 +904,8 @@ npm install package

const mixedStyles = css\`.button{color:red;}\`;

const mixedStyled = styled.button\`padding:10px;\`;

const mixedQuery = gql\`query{users{name}}\`;

const mixedTemplate = html\`<div><h1>Title</h1></div>\`;
Expand Down Expand Up @@ -815,6 +1001,32 @@ const styles = css\`.button{color:red;background:blue;padding:10px 20px;}.contai

const styledComponent = styled\`background-color:#ffffff;border-radius:4px;padding:8px;\`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global\`.reset{margin:0;padding:0;box-sizing:border-box;}\`;

const styledDiv = styled.div\`width:100%;height:100vh;background-color:#f0f0f0;\`;

const styledLink = styled["a"]\`text-decoration:none;color:#007bff;font-weight:bold;\`;

const styledButton = styled(Button)\`font-size:16px;color:#333;padding:12px 24px;\`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = (
<div css={\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}>
Hello World
</div>
);

const styledJsx = (
<style jsx>{\`display: flex; align-items: center; justify-content: center; height: 100vh;\`}</style>
);

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -851,6 +1063,8 @@ npm install package

const mixedStyles = css\`.button{color:red;}\`;

const mixedStyled = styled.button\`padding:10px;\`;

const mixedQuery = gql\`query{users{name}}\`;

const mixedTemplate = html\`<div><h1>Title</h1></div>\`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ const styles = css`.button{color:red;background:blue;padding:10px 20px;}.contain

const styledComponent = styled`background-color:#ffffff;border-radius:4px;padding:8px;`;

// ============================================================================
// Member Expression Tags - styled.div, styled.button, etc.
// ============================================================================

const cssGlobal = css.global`.reset{margin:0;padding:0;box-sizing:border-box;}`;

const styledDiv = styled.div`width:100%;height:100vh;background-color:#f0f0f0;`;

const styledLink = styled["a"]`text-decoration:none;color:#007bff;font-weight:bold;`;

const styledButton = styled(Button)`font-size:16px;color:#333;padding:12px 24px;`;

// ============================================================================
// Plain template strings within css props or styled-jsx
// ============================================================================

const cssProp = <div css={`display: flex; align-items: center; justify-content: center; height: 100vh;`}>Hello World</div>;

const styledJsx = <style jsx>{`display: flex; align-items: center; justify-content: center; height: 100vh;`}</style>;

// ============================================================================
// GraphQL - Tagged template literals with gql and graphql tags
// ============================================================================
Expand Down Expand Up @@ -42,6 +62,8 @@ npm install package

const mixedStyles = css`.button{color:red;}`;

const mixedStyled = styled.button`padding:10px;`;

const mixedQuery = gql`query{users{name}}`;

const mixedTemplate = html`<div><h1>Title</h1></div>`;
Expand Down
Loading
Loading