Skip to content

Instantly share code, notes, and snippets.

View sebastiano-guerriero's full-sized avatar

Sebastiano Guerriero sebastiano-guerriero

View GitHub Profile
@sebastiano-guerriero
sebastiano-guerriero / video.html
Last active August 29, 2015 14:11
HTML5 video element
<video controls autoplay loop width=”360” height=”240” poster=”placeholder.jpg”>
<source src="assets/video.mp4" type="video/mp4">
<source src="assets/video.webm" type="video/webm">
</video>
:root {
--font-primary: sans-serif;
--font-secondary: serif;
/* set base values */
--text-base-size: 1em;
--text-scale-ratio: 1.2;
}
body {
:root {
--font-primary: sans-serif;
--font-secondary: serif;
/* set base values */
--text-base-size: 1em;
--text-scale-ratio: 1.2;
/* type scale */
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
:root {
/* set base values */
--text-base-size: 1em;
--text-scale-ratio: 1.2;
/* type scale */
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
--text-sm: calc(1em / var(--text-scale-ratio));
--text-md: calc(1em * var(--text-scale-ratio));
--text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio));
:root {
--baseline: 24px;
/* spacing values */
--space-sm: calc(var(--baseline)/2);
--space-md: var(--baseline);
--space-lg: calc(var(--baseline)*2);
--space-xl: calc(var(--baseline)*3);
}
:root {
/* spacing values */
--space-xxxs: 0.25em;
--space-xxs: 0.375em;
--space-xs: 0.5em;
--space-sm: 0.75em;
--space-md: 1.25em;
--space-lg: 2em;
--space-xl: 3.25em;
--space-xxl: 5.25em;
.component {
font-size: 1.2em;
}
.component h1 {
font-size: 3em; // the size is no longer affected by the --text-scale-ratio
font-size: calc(var(--text-base-size) * 3); // use base size to create new value - off scale
font-size: calc(var(--text-xxl) - 0.8em); // use original font size to create new value - off scale
font-size: var(--text-xl); // update the value of the font size using a different variable
}
:root {
/* typography */
--color-text: var(--gray-10);
--color-text-heading: var(--black);
--color-text-subtle: var(--gray-6);
--color-link: var(--color-primary);
--color-link-visited: var(--color-primary-dark);
}
body {
:root {
/* typography */
--color-text: var(--gray-10);
--color-text-heading: var(--black);
--color-text-subtle: var(--gray-6);
--color-link: var(--color-primary);
--color-link-visited: var(--color-primary-dark);
}
.theme--dark {