<main>
	<h1>I'm styled by CSS Variables</h1>
	<h2>I'm using fallbacks for my styles</h2>
	<h2 class="add-styles">I'm using custom properties that are created within my class selector</h2>
</main>
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@700&display=swap');

:root {
	--primaryColour: hsla(4, 99%, 66%, 1);
	--secondaryColour: hsla(155, 61%, 51%, 1);
	--secondaryBackgroundColour: hsla(343, 6%, 21%, 1);
	--backgroundColour: hsla(207, 100%, 96%, 1);
}

* {
	box-sizing: border-box;
}

main {
	display: grid;
	place-content: center;
	min-height: 100vh;
	background-color: var(--backgroundColour);
	padding: 3em 5em;
}

h1 {
	font-family: 'Atkinson Hyperlegible', sans-serif;
	letter-spacing: -0.5px;
	font-size: 3rem;
	color: var(--primaryColour);
	text-align: center;
}

h2 {
	font-family: 'Atkinson Hyperlegible', sans-serif;
	letter-spacing: -0.5px;
	font-size: 1.5rem;
	padding: 1.25rem 3rem;
	text-align: center;
	color: var(--changeColour, hotpink);
	background-color: var(--changeBgColour, black);
	max-width: 550px;
	line-height: 1.4;
	margin: 0 auto 40px;
}

.add-styles {
	--changeColour: var(--secondaryColour);
	--changeBgColour: var(--secondaryBackgroundColour);
	color: var(--changeColour, lightgreen);
	background-color: var(--changeBgColour, black)
}

@media (max-width: 425px) {
	h1 {
		font-size: 2.5rem;
	}
	
	h2 {
		font-size: 1rem;
	}
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.