move css into separate files

This commit is contained in:
Lyn Fugmann 2024-09-20 17:10:24 +02:00
parent afc3f1c577
commit bf4f142cb7
6 changed files with 152 additions and 128 deletions

30
_includes/footer.css Normal file
View file

@ -0,0 +1,30 @@
footer {
border-top: 1px dotted rgba(0,0,0,.15);
padding: 4rem 0;
}
#footerNav ul {
margin: 0;
padding: 0;
display: flex;
gap: 1em;
}
#footerNav li {
display: inline;
}
.footer-container {
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
display: grid;
grid-template-columns: auto auto;
grid-auto-flow: column;
grid-template-rows: 1fr 1fr;
gap: 1em;
}
.footer-container > :nth-last-child(-n + 2) {
text-align: end;
}

View file

@ -20,30 +20,5 @@
</footer> </footer>
{% css %} {% css %}
footer { {% include "footer.css" %}
border-top: 1px dotted rgba(0,0,0,.15);
padding: 4rem 0;
}
#footerNav ul {
margin: 0;
padding: 0;
display: flex;
gap: 1em;
}
#footerNav li {
display: inline;
}
.footer-container {
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
display: grid;
grid-template-columns: auto auto;
grid-auto-flow: column;
grid-template-rows: 1fr 1fr;
gap: 1em;
}
.footer-container > :nth-last-child(-n + 2) {
text-align: end;
}
{% endcss %} {% endcss %}

57
_includes/header.css Normal file
View file

@ -0,0 +1,57 @@
header {
display: flex;
position: sticky;
top: 0;
min-height: 6.4rem;
padding: 2rem 0;
backdrop-filter: blur(5px);
background-color: rgba(255,255,255,.92);
box-shadow: 0 3px 15px hsla(0,0%,39.2%,.12);
}
.header-container {
width: 100%;
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
align-items: center;
}
#mainNav ul {
margin: 0;
padding: 0;
}
#mainNav li {
display: inline;
margin-left: 1rem;
}
#mainNav a {
position: relative;
font-size: 16px;
font-family: Aileron;
font-weight: 500;
line-height: 2;
text-transform: uppercase;
color: var(--color-text);
text-decoration: none;
}
#mainNav a::after {
content: "";
position: absolute;
background: var(--color-primary);
opacity: 0;
bottom: -4px;
left: 0;
right: 0;
height: 2px;
transition: opacity .3s ease-out;
}
#mainNav a:hover::after {
opacity: 1;
}

View file

@ -8,55 +8,5 @@
</header> </header>
{% css %} {% css %}
header { {% include "header.css" %}
display: flex;
position: sticky;
top: 0;
min-height: 6.4rem;
padding: 2rem 0;
backdrop-filter: blur(5px);
background-color: rgba(255,255,255,.92);
box-shadow: 0 3px 15px hsla(0,0%,39.2%,.12);
}
.header-container {
width: 100%;
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
align-items: center;
}
#mainNav ul {
margin: 0;
padding: 0;
}
#mainNav li {
display: inline;
margin-left: 1rem;
}
#mainNav a {
position: relative;
font-size: 16px;
font-family: Aileron;
font-weight: 500;
line-height: 2;
text-transform: uppercase;
color: var(--color-text);
text-decoration: none;
}
#mainNav a::after {
content: "";
position: absolute;
background: var(--color-primary);
opacity: 0;
bottom: -4px;
left: 0;
right: 0;
height: 2px;
transition: opacity .3s ease-out;
}
#mainNav a:hover::after {
opacity: 1;
}
{% endcss %} {% endcss %}

62
_includes/page.css Normal file
View file

@ -0,0 +1,62 @@
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Aileron, sans-serif;
line-height: 1.5;
color: var(--color-text);
}
main {
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
}
h1, h2, h3, h4 {
color: var(--color-primary);
}
h1 {
font-weight: 700;
font-size: 2.8rem;
text-transform: uppercase;
}
h2 {
font-weight: 300;
font-size: 2.4rem;
line-height: 2;
}
h3 {
font-weight: 300;
font-size: 1.8rem;
line-height: 2;
}
h4 {
font-weight: 400;
font-size: 1.3rem;
line-height: 2;
}
h5 {
font-weight: 700;
font-size: 1rem;
margin-bottom: 1rem;
}
p {
line-height: 1.8;
}
:root {
font-size: 17px;
--page-width: 75rem;
--color-text: #495057;
--color-primary: {{ eseColor }};
}

View file

@ -24,55 +24,5 @@ eleventyComputed:
</html> </html>
{% css %} {% css %}
:root { {% include "page.css" %}
--page-width: 75rem;
--color-text: #495057;
--color-primary: {{ eseColor }};
font-size: 17px;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Aileron, sans-serif;
line-height: 1.5;
color: var(--color-text);
}
main {
max-width: var(--page-width);
margin-left: auto;
margin-right: auto;
}
h1, h2, h3, h4 {
color: var(--color-primary);
}
h1 {
font-weight: 700;
font-size: 2.8rem;
text-transform: uppercase;
}
h2 {
font-weight: 300;
font-size: 2.4rem;
line-height: 2;
}
h3 {
font-weight: 300;
font-size: 1.8rem;
line-height: 2;
}
h4 {
font-weight: 400;
font-size: 1.3rem;
line-height: 2;
}
h5 {
font-weight: 700;
font-size: 1rem;
margin-bottom: 1rem;
}
p {
line-height: 1.8;
}
{% endcss %} {% endcss %}