Skip to content

Commit

Permalink
TXI-ify the base app
Browse files Browse the repository at this point in the history
  • Loading branch information
urfolomeus committed Jun 2, 2022
1 parent 0577d73 commit 5622ca7
Show file tree
Hide file tree
Showing 12 changed files with 236 additions and 65 deletions.
Binary file modified public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="A sandbox for helping us test A11y features"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>A11y Testing Sandbox</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 21 additions & 21 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
.App {
text-align: center;
/* Text */

h1 {
margin-top: 1rem;
font-size: 3.6rem;
}

.App-logo {
height: 40vmin;
pointer-events: none;
/* Layout */

.main {
padding: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
/* Logo */

.logoContainer {
padding-top: 10vmin;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
.logo {
height: 40vmin;
pointer-events: none;
}

.App-link {
color: #61dafb;
@media (prefers-reduced-motion: no-preference) {
.logo {
animation: logo-spin infinite 20s linear;
}
}

@keyframes App-logo-spin {
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
Expand Down
25 changes: 0 additions & 25 deletions src/App.js

This file was deleted.

17 changes: 17 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import "./App.css";
import logo from "./logo.svg";

function App() {
return (
<section className="main">
<header>
<h1>Accessibility Testing Sandbox</h1>
</header>
<div className="logoContainer">
<img src={logo} className="logo" alt="logo" />
</div>
</section>
);
}

export default App;
10 changes: 5 additions & 5 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';
import { render, screen } from "@testing-library/react";
import App from "./App";

test('renders learn react link', () => {
test("renders the page header", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
const pageHeader = screen.getByText(/Accessibility Testing Sandbox/i);
expect(pageHeader).toBeInTheDocument();
});
20 changes: 15 additions & 5 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
/**
* Use relative units for text: https://web.dev/accessible-responsive-design/#use-relative-units-for-text
* By default browsers set font-size to 16px, which makes it harder for us to figure out relative sizing
* using rem/em values. To make this easier we reset the base value to 10px. Some users prefer to change
* the default font-size and so we don't want to hard code to 10px. As such we can use a relative reset
* to get our base font-size.
*
* 16px * 0.65 = 10px
*/
html {
font-size: 62.5%;
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: "Roboto", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
15 changes: 9 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";

const root = ReactDOM.createRoot(document.getElementById('root'));
import "./reset.css";
import "./index.css";

import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
Expand Down
38 changes: 37 additions & 1 deletion src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions src/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
html,
body,
div,
span,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
abbr,
address,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
samp,
small,
strong,
sub,
sup,
var,
b,
i,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}

body {
line-height: 1;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

nav ul {
list-style: none;
}

blockquote,
q {
quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}

a {
margin: 0;
padding: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

input,
select {
vertical-align: middle;
}

0 comments on commit 5622ca7

Please sign in to comment.