Skip to content

Commit

Permalink
Merge pull request #1 from crab85193/develop
Browse files Browse the repository at this point in the history
Headerの作成
  • Loading branch information
crab85193 authored Dec 15, 2024
2 parents 9160d8f + da16f07 commit 308fb44
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 62 deletions.
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

21 changes: 4 additions & 17 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
import React from "react";
import logo from "./logo.svg";
import "./App.css";
import Header from "./components/Header";
import "./assets/styles/reset.css";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="layout">
<Header />
</div>
);
}
Expand Down
File renamed without changes
34 changes: 34 additions & 0 deletions src/assets/styles/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.wrapper {
max-width: 1140px;
padding-left: 1rem;
padding-right: 1rem;
margin-left: auto;
margin-right: auto;
}

.brand {
font-weight: bold;
font-size: 20px;
text-decoration: none;
color: #222;
padding: 1.5rem 1rem;
}

.site-header {
position: relative;
background-color: #def7ff;
}

.site-header__wrapper {
padding-top: 1rem;
padding-bottom: 1rem;
}
@media (min-width: 600px) {
.site-header__wrapper {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 0;
padding-bottom: 0;
}
}
5 changes: 0 additions & 5 deletions src/index.css → src/assets/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
129 changes: 129 additions & 0 deletions src/assets/styles/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
16 changes: 16 additions & 0 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import "./../assets/styles/Header.css";

function Header() {
return (
<header className="site-header">
<div className="wrapper site-header__wrapper">
<a href="" className="brand">
都道府県別の総人口推移グラフ
</a>
</div>
</header>
);
}

export default Header;
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import "./assets/styles/index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

Expand Down
2 changes: 1 addition & 1 deletion src/App.test.tsx → src/tests/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";
import App from "./../App";

test("renders learn react link", () => {
render(<App />);
Expand Down
File renamed without changes.

0 comments on commit 308fb44

Please sign in to comment.