-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(global): revamp demo site to include document section examples
- Loading branch information
1 parent
c4d8706
commit f6817b0
Showing
7 changed files
with
236 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,63 @@ | ||
body { | ||
font-family: Tajawal, Arial, Helvetica, sans-serif; | ||
margin: 2rem; | ||
margin: 1rem; | ||
} | ||
|
||
img { | ||
// https://web.dev/optimize-cls/#modern-best-practice | ||
aspect-ratio: attr(width) / attr(height); | ||
margin-top: 1rem; | ||
header, | ||
footer { | ||
align-items: center; | ||
/* stylelint-disable plugin/no-unsupported-browser-features */ | ||
column-gap: 2rem; | ||
display: flex; | ||
flex-wrap: wrap; | ||
row-gap: 1rem; | ||
} | ||
|
||
header { | ||
border-bottom: 2px solid #d3d3d3; | ||
padding-bottom: 1rem; | ||
|
||
h1 { | ||
flex-grow: 1; | ||
margin: 0; | ||
} | ||
} | ||
|
||
nav { | ||
ul { | ||
align-items: center; | ||
display: flex; | ||
gap: 2rem; | ||
justify-content: flex-end; | ||
} | ||
} | ||
|
||
a, | ||
button { | ||
padding: 0.5rem; | ||
|
||
&:focus { | ||
border: 2px solid #00f; | ||
} | ||
} | ||
|
||
main { | ||
h2 { | ||
font-size: larger; | ||
font-weight: bold; | ||
margin: 1rem 0; | ||
} | ||
|
||
:last-child { | ||
margin-bottom: 1rem; | ||
} | ||
} | ||
|
||
footer { | ||
border-top: 2px solid #d3d3d3; | ||
padding-top: 1rem; | ||
|
||
small { | ||
flex-grow: 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
@charset 'UTF-8'; | ||
|
||
/* Vendors */ | ||
@import 'vendors/reset', 'vendors/sanitize'; | ||
|
||
/* Base styles */ | ||
@import 'base/base', 'base/fonts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
document | ||
?.querySelector('#footer-copyright') | ||
?.append( | ||
document.createTextNode(new Date().getFullYear() as unknown as string) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import '@/scss/index.scss'; | ||
// @PERFORMANCE-COMMENT | ||
// tells webpack to map generated webp to jpg | ||
import webpackLogo from '@/images/icon-square-small.jpg?as=webp'; | ||
|
||
const logo = document.createElement('img'); | ||
const header = document.querySelector('header'); | ||
header?.prepend(logo); | ||
logo.src = webpackLogo; | ||
logo.alt = 'Webpack Logo'; | ||
logo.height = 50; | ||
logo.width = 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
/* global document */ | ||
// eslint-disable-next-line import/no-unresolved | ||
import '@/scss/index.scss'; | ||
|
||
// Test webp generation from jpg source image | ||
import webpackLogo from '@/images/icon-square-small.jpg?as=webp'; | ||
|
||
document | ||
.querySelector('#copyright') | ||
?.appendChild(document.createTextNode(new Date().getFullYear().toString())); | ||
|
||
const logo = document.createElement('img'); | ||
logo.src = webpackLogo; | ||
logo.alt = 'Webpack Logo'; | ||
logo.height = 200; | ||
logo.width = 200; | ||
|
||
const app = document.querySelector('#root'); | ||
app?.append(logo); | ||
import './header'; | ||
import './footer'; | ||
|
||
// jest testing | ||
export const sum = (...a: number[]) => | ||
a.reduce((accumulator, value) => accumulator + value, 0); | ||
console.log(sum(1, 2, 3)); |