-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support remote and local assets in custom CSS
(This includes images and fonts using url().) Using onResolve (as suggested in #786 (comment)) closes #786 supersedes #788
- Loading branch information
Showing
11 changed files
with
107 additions
and
10 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
--- | ||
style: style.css | ||
--- | ||
|
||
# CSS assets | ||
|
||
Atkinson Hyperlegible font is named after Braille Institute founder, J. Robert Atkinson. What makes it different from traditional typography design is that it focuses on letterform distinction to increase character recognition, ultimately improving readability. [We are making it free for anyone to use!](https://brailleinstitute.org/freefont) | ||
|
||
<figure> | ||
<div class="bg" style="height: 518px;"></div> | ||
<figcaption>This image is set with CSS.</figcaption> | ||
</figure> |
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,20 @@ | ||
@import url("observablehq:default.css"); | ||
@import url("observablehq:theme-air.css"); | ||
|
||
:root { | ||
--serif: "Atkinson Hyperlegible"; | ||
} | ||
|
||
div.bg { | ||
background-image: url("horse.jpg"); | ||
} | ||
|
||
div.dont-break-hashes { | ||
offset-path: url(#path); | ||
} | ||
|
||
@font-face { | ||
font-family: "Atkinson Hyperlegible"; | ||
src: url(https://fonts.gstatic.com/s/atkinsonhyperlegible/v11/9Bt23C1KxNDXMspQ1lPyU89-1h6ONRlW45G04pIoWQeCbA.woff2) | ||
format("woff2"); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
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,34 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>CSS assets</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="preload" as="style" href="./_import/style.a31bcaf4.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="./_import/style.a31bcaf4.css"> | ||
<link rel="modulepreload" href="./_observablehq/client.js"> | ||
<link rel="modulepreload" href="./_observablehq/runtime.js"> | ||
<link rel="modulepreload" href="./_observablehq/stdlib.js"> | ||
<script type="module"> | ||
|
||
import "./_observablehq/client.js"; | ||
|
||
</script> | ||
<aside id="observablehq-toc" data-selector="h1:not(:first-of-type)[id], h2:first-child[id], :not(h1) + h2[id]"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="css-assets" tabindex="-1"><a class="observablehq-header-anchor" href="#css-assets">CSS assets</a></h1> | ||
<p>Atkinson Hyperlegible font is named after Braille Institute founder, J. Robert Atkinson. What makes it different from traditional typography design is that it focuses on letterform distinction to increase character recognition, ultimately improving readability. <a href="https://brailleinstitute.org/freefont" target="_blank" rel="noopener noreferrer">We are making it free for anyone to use!</a></p> | ||
<figure> | ||
<div class="bg" style="height: 518px;"></div> | ||
<figcaption>This image is set with CSS.</figcaption> | ||
</figure> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-01-10T16:00:00">Jan 10, 2024</a>.</div> | ||
</footer> | ||
</div> |