1
0
mirror of https://github.com/oceanprotocol/status synced 2024-11-22 01:36:59 +01:00

🐚 initial commit

This commit is contained in:
Matthias Kretschmann 2019-09-16 14:53:19 +02:00
parent f28c5f64be
commit 81d5cf13e5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
18 changed files with 1805 additions and 185 deletions

20
.eslintrc Normal file
View File

@ -0,0 +1,20 @@
{
"extends": [
"oceanprotocol",
"oceanprotocol/react",
"prettier/react",
"prettier/standard",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"env": {
"es6": true,
"browser": true,
"jest": true
},
"settings": {
"react": {
"version": "16.8"
}
}
}

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2
}

View File

@ -1,68 +1,40 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). [![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
## Available Scripts <h1 align="center">status</h1>
In the project directory, you can run: > 🐚 Overview and status checks of all Ocean Protocol RPC network connections. https://status.oceanprotocol.com
### `npm start` <img width="1373" alt="Screen Shot 2019-09-16 at 14 51 28" src="https://user-images.githubusercontent.com/90316/64959471-7ff30000-d891-11e9-84be-96151bb7ea2d.png">
Runs the app in the development mode.<br> - [🏄 Get Started](#-get-started)
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - [🎁 Contributing](#-contributing)
- [🏛 License](#-license)
The page will reload if you make edits.<br> ## 🏄 Get Started
You will also see any lint errors in the console.
### `npm test` ```bash
npm install
npm start
```
Launches the test runner in the interactive watch mode.<br> ## 🎁 Contributing
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build` See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.
Builds the app for production to the `build` folder.<br> ## 🏛 License
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br> ```text
Your app is ready to be deployed! Copyright 2019 Ocean Protocol Foundation Ltd.
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
### `npm run eject` http://www.apache.org/licenses/LICENSE-2.0
**Note: this is a one-way operation. Once you `eject`, you cant go back!** Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own. limitations under the License.
```
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

1086
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,26 @@
{ {
"name": "networks", "name": "@oceanprotocol/status",
"version": "0.1.0", "version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1"
},
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"eslintConfig": { "dependencies": {
"extends": "react-app" "@oceanprotocol/art": "^2.2.0",
"@oceanprotocol/typographies": "^0.1.0",
"axios": "^0.19.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1"
},
"devDependencies": {
"eslint-config-oceanprotocol": "^1.5.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-prettier": "^3.1.0",
"node-sass": "^4.12.0",
"prettier": "^1.18.2"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [

View File

@ -10,34 +10,13 @@
content="Web site created using create-react-app" content="Web site created using create-react-app"
/> />
<link rel="apple-touch-icon" href="logo192.png" /> <link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
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>Ocean Protocol Networks Status</title>
-->
<title>React App</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body> </body>
</html> </html>

View File

@ -1,6 +1,6 @@
{ {
"short_name": "React App", "short_name": "Ocean",
"name": "Create React App Sample", "name": "Ocean Protocol Networks Status",
"icons": [ "icons": [
{ {
"src": "favicon.ico", "src": "favicon.ico",
@ -20,6 +20,6 @@
], ],
"start_url": ".", "start_url": ".",
"display": "standalone", "display": "standalone",
"theme_color": "#000000", "theme_color": "#ffffff",
"background_color": "#ffffff" "background_color": "#141414"
} }

View File

@ -1,33 +0,0 @@
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}
.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;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,26 +1,26 @@
import React from 'react'; import React from 'react'
import logo from './logo.svg'; import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo-white.svg'
import './App.css'; import './App.scss'
import networks from './networks.json'
import Network from './Network'
function App() { export default function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <header className="header">
<img src={logo} className="App-logo" alt="logo" /> <Logo />
<h1>Ocean Protocol Status</h1>
<p> <p>
Edit <code>src/App.js</code> and save to reload. Testing all RPC network connections from your browser, refreshed every
5 sec.
</p> </p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header> </header>
</div>
);
}
export default App; <div className="networks">
{networks.map((network, i) => (
<Network key={i} network={network} />
))}
</div>
</div>
)
}

82
src/App.scss Normal file
View File

@ -0,0 +1,82 @@
@import './styles/variables';
.App {
text-align: center;
padding: $spacer / 2;
}
h1, h2 {
color: $brand-white;
}
.header {
h1 {
margin-bottom: $spacer / 2;
}
p {
font-size: $font-size-large;
color: $brand-white;
margin: auto;
max-width: 35rem;
}
svg {
width: 85px;
height: 85px;
}
}
.networks {
display: grid;
gap: $spacer;
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
margin-top: $spacer * 2;
}
.network {
border: 1px solid $brand-grey-dark;
padding: $spacer;
border-radius: $border-radius;
text-align: left;
h2 {
margin-bottom: $spacer / 4;
margin-top: 0;
span { color: $brand-grey-light; font-size: $font-size-base; }
}
p:last-child {
margin-bottom: 0;
}
}
.block {
a {
color: $brand-grey-lighter;
}
}
.status {
margin-bottom: 0;
}
.success {
color: $green;
}
.error {
color: $red;
}
.latency {
display: inline-block;
margin-left: $spacer / 4;
font-size: $font-size-mini;
}
.clientVersion {
font-size: $font-size-mini;
}

View File

@ -1,9 +1,9 @@
import React from 'react'; import React from 'react'
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom'
import App from './App'; import App from './App'
it('renders without crashing', () => { it('renders without crashing', () => {
const div = document.createElement('div'); const div = document.createElement('div')
ReactDOM.render(<App />, div); ReactDOM.render(<App />, div)
ReactDOM.unmountComponentAtNode(div); ReactDOM.unmountComponentAtNode(div)
}); })

115
src/Network.js Normal file
View File

@ -0,0 +1,115 @@
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import axios from 'axios'
// Measure response time and deliver as `response.duration`
axios.interceptors.request.use(
config => {
config.metadata = { startTime: new Date() }
return config
},
error => Promise.reject(error)
)
axios.interceptors.response.use(
response => {
response.config.metadata.endTime = new Date()
response.duration =
response.config.metadata.endTime - response.config.metadata.startTime
return response
},
error => {
error.config.metadata.endTime = new Date()
error.duration =
error.config.metadata.endTime - error.config.metadata.startTime
return Promise.reject(error)
}
)
async function getStatusAndBlock(network, setStatus, setBlock, setLatency) {
try {
const response = await axios.post(network.url, {
method: 'eth_blockNumber',
params: [],
id: 1,
jsonrpc: '2.0'
})
if (response.status !== 200) {
setStatus('Offline')
return
}
setStatus('Online')
setLatency(response.duration)
const blockNumber = parseInt(response.data.result, 16)
setBlock(blockNumber)
} catch (error) {
console.error(error.message)
}
}
async function getClientVersion(network, setClientVersion) {
try {
const response = await axios.post(network.url, {
method: 'web3_clientVersion',
params: [],
id: 1,
jsonrpc: '2.0'
})
setClientVersion(response.data.result)
} catch (error) {
console.error(error.message)
}
}
export default function Network({ network }) {
const [status, setStatus] = useState('...')
const [block, setBlock] = useState('...')
const [latency, setLatency] = useState('...')
const [clientVersion, setClientVersion] = useState('...')
useEffect(() => {
getStatusAndBlock(network, setStatus, setBlock, setLatency)
getClientVersion(network, setClientVersion)
const timer = setInterval(() => {
getStatusAndBlock(network, setStatus, setBlock, setLatency)
getClientVersion(network, setClientVersion)
}, 5000) // run every 5 sec.
return () => clearInterval(timer)
}, [network])
const isOnline = status === 'Online'
return (
<div className="network">
<h2>
{network.name} <span>{network.type}</span>
</h2>
<p>
<code>{network.url}</code>
</p>
<p className="status">
<span className={isOnline ? 'success' : 'error'}>{status}</span>
<span className="latency">{latency} ms</span>
</p>
<p className="block">
At block #<a href={`${network.explorer}/blocks/${block}`}>{block}</a>
</p>
<p className="clientVersion">{clientVersion}</p>
</div>
)
}
Network.propTypes = {
network: PropTypes.shape({
name: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
explorer: PropTypes.string.isRequired
})
}

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

View File

@ -1,12 +1,9 @@
import React from 'react'; import React from 'react'
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom'
import './index.css'; import './styles/global.scss'
import App from './App'; import App from './App'
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker'
ReactDOM.render(<App />, document.getElementById('root')); ReactDOM.render(<App />, document.getElementById('root'))
// If you want your app to work offline and load faster, you can change serviceWorker.register()
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

View File

@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

20
src/networks.json Normal file
View File

@ -0,0 +1,20 @@
[
{
"name": "Pacific",
"type": "Mainnet",
"url": "https://pacific.oceanprotocol.com",
"explorer": "https://submarine.oceanprotocol.com"
},
{
"name": "Nile",
"type": "Testnet",
"url": "https://nile.dev-ocean.com",
"explorer": "https://submarine.nile.dev-ocean.com"
},
{
"name": "Duero",
"type": "Testnet",
"url": "https://duero.dev-ocean.com",
"explorer": "https://submarine.duero.dev-ocean.com"
}
]

View File

@ -0,0 +1,62 @@
// Colors
$brand-white: #fff;
$brand-black: #141414;
$brand-pink: #ff4092;
$brand-purple: #7b1173;
$brand-violet: #e000cf;
$brand-blue: #11597b;
$brand-grey: #41474e;
$brand-grey-light: #8b98a9;
$brand-grey-dark: #303030;
$brand-grey-lighter: #e2e2e2;
$green: #5fb359;
$red: #d80606;
$orange: #b35f36;
$yellow: #eac146;
$brand-gradient: linear-gradient(to right bottom, $brand-purple, $brand-pink);
$body-background: $brand-black;
// Fonts
$font-family-base: 'Sharp Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
Helvetica, Arial, sans-serif;
$font-family-title: 'Sharp Sans Display', -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif;
$font-family-monospace: 'Fira Code', 'Fira Mono', Menlo, Monaco, Consolas,
'Courier New', monospace;
$font-size-root: 16px;
$font-size-base: 1rem;
$font-size-large: 1.2rem;
$font-size-small: .85rem;
$font-size-mini: .65rem;
$font-size-text: $font-size-base;
$font-size-label: $font-size-base;
$font-size-title: 1.4rem;
$font-size-h1: 3rem;
$font-size-h2: 1.7rem;
$font-size-h3: 1.4rem;
$font-size-h4: $font-size-large;
$font-size-h5: 1.1rem;
$font-weight-base: 500;
$font-weight-bold: 600;
$line-height: 1.6;
// Sizes
$spacer: 2rem;
$page-frame: .75rem;
$break-point--small: 640px;
$break-point--medium: 860px;
$break-point--large: 1140px;
$break-point--huge: 1400px;
$brand-border-width: 1px;
$border-radius: .2rem;
$narrowWidth: 35rem;

334
src/styles/global.scss Normal file
View File

@ -0,0 +1,334 @@
@import 'variables';
@import '../../node_modules/@oceanprotocol/typographies/sass/ocean-typo.scss';
*,
*:before,
*:after {
box-sizing: border-box;
}
/* stylelint-disable selector-max-id */
html,
body,
#root {
height: 100%;
}
/* stylelint-enable selector-max-id */
html {
font-size: $font-size-root;
}
body {
color: $brand-grey-light;
font-size: $font-size-base;
font-family: $font-family-base;
font-weight: $font-weight-base;
line-height: $line-height;
background: $body-background;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: relative;
margin: 0;
@media screen and (min-width: $break-point--small) {
padding: $page-frame;
}
}
a {
text-decoration: none;
color: $brand-pink;
transition: .2s ease-out;
&:hover,
&:focus {
color: darken($brand-pink, 15%);
text-decoration: none;
transform: translate3d(0, -.1rem, 0);
}
&:active {
color: darken($brand-pink, 15%);
text-decoration: none;
transform: none;
transition: none;
}
}
p {
margin: 0;
margin-bottom: $spacer / $line-height;
}
// Lists
/////////////////////////////////////
ul {
li {
&:before {
content: ' \25AA'; // Black Small Square: &#9642;
top: -2px;
}
}
}
ol {
counter-reset: ol-counter;
li {
&:before {
content: counter(ol-counter) '.';
counter-increment: ol-counter;
font-weight: $font-weight-bold;
top: -1px;
}
}
ul li:before {
content: ' \25AA';
}
}
ul,
ol {
margin-top: 0;
margin-bottom: $spacer;
padding-left: $spacer / $line-height;
list-style: none;
li {
position: relative;
display: block;
&:before {
position: absolute;
left: -($spacer / $line-height);
color: $brand-grey-light;
user-select: none;
}
+ li {
margin-top: $spacer / 8;
}
ul,
ol,
p {
margin-bottom: 0;
margin-top: $spacer / 8;
}
}
}
// Inline typography
/////////////////////////////////////
b,
strong,
.bold {
font-weight: $font-weight-bold;
}
em,
.italic {
font-style: italic;
}
small {
font-size: $font-size-small;
display: inline-block;
}
abbr[title],
dfn {
text-transform: none;
font-style: normal;
font-size: inherit;
border-bottom: 1px dashed $brand-grey-light;
cursor: help;
font-feature-settings: inherit;
}
h1,
h2,
h3,
h4,
h5 {
font-family: $font-family-title;
color: inherit;
line-height: 1.2;
font-weight: $font-weight-bold;
}
h1 {
font-size: $font-size-h1;
}
h2 {
font-size: $font-size-h2;
}
h3 {
font-size: $font-size-h3;
}
h4 {
font-size: $font-size-h4;
}
h5 {
font-size: $font-size-h5;
}
// Responsive Media
/////////////////////////////////////
figure,
img,
svg,
video,
audio,
embed,
canvas,
picture {
max-width: 100%;
height: auto;
margin: 0 auto;
display: block;
}
hr {
margin: $spacer 0;
border: 0;
border-bottom: .1rem solid $brand-grey-lighter;
}
// Quotes
/////////////////////////////////////
q {
font-style: italic;
}
cite {
font-style: normal;
text-transform: uppercase;
}
blockquote,
blockquote > p {
font-style: italic;
color: lighten($brand-grey, 15%);
}
blockquote {
margin: 0 0 $spacer;
padding-left: $spacer / 2;
border-left: .2rem solid $brand-grey-lighter;
@media screen and (min-width: $break-point--small) {
padding-left: $spacer / $line-height;
}
}
// Tables
/////////////////////////////////////
table {
width: 100%;
margin-bottom: $spacer * $line-height;
border-collapse: collapse;
th,
td {
border: 0;
margin: 0;
padding: $spacer / 2;
border-bottom: 1px solid $brand-grey-lighter;
text-align: left;
font-size: 90%;
&[align='center'] {
text-align: center;
}
&[align='right'] {
text-align: right;
}
}
th {
font-weight: 600;
}
}
// Code
/////////////////////////////////////
code,
kbd,
pre,
samp {
font-family: $font-family-monospace;
font-size: $font-size-small;
border-radius: $border-radius;
text-shadow: none;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
h1 &,
h2 &,
h3 &,
h4 &,
h5 & {
font-size: inherit;
}
}
:not(pre) > code {
color: inherit;
display: inline-block;
}
a > code {
color: $brand-pink;
}
pre {
display: block;
margin-bottom: $spacer;
padding: 0;
background: lighten($brand-grey-lighter, 5%);
// make 'em scrollable
overflow: auto;
-webkit-overflow-scrolling: touch;
code {
padding: $spacer;
white-space: pre;
display: block;
color: $brand-grey-lighter;
overflow-wrap: normal;
word-wrap: normal;
word-break: normal;
overflow: auto;
}
}
// Selection
/////////////////////////////////////
::-moz-selection {
background: $brand-grey-light;
color: #fff;
}
::selection {
background: $brand-grey-light;
color: #fff;
}