Chap04 -> Styling components with Emotion -> Styling the App component -> style css prop use tagged template literal

Chap04
Jason Zhu 2022-03-28 17:56:13 +11:00
parent 2005072dea
commit c98972dec9
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +0,0 @@
.container {
font-family: 'Segoe UI', 'Helvetica', sans-serif;
font-size: 16px;
color: #5c5a5a;
}

View File

@ -1,11 +1,19 @@
/** @jsxImportSource @emotion/react */
import { css } from '@emotion/react';
import React from 'react'; import React from 'react';
import { Header } from './Header'; import { Header } from './Header';
import style from './App.module.css';
import { HomePage } from './HomePage'; import { HomePage } from './HomePage';
function App() { function App() {
return ( return (
<div className={style.container}> <div
css={css`
font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
font-size: 16px;
color: #5c5a5a;
`}
>
<Header /> <Header />
<HomePage /> <HomePage />
</div> </div>