Files
sweet/www/routes/gfm.css.ts
T
Luca Casonato 80598d07fd feat: use import maps instead of deps files (#209)
This commit updates fresh to use import maps instead of deps files in generated projects.
2022-05-23 19:35:15 +02:00

49 lines
948 B
TypeScript

import { Handlers } from "$fresh/server.ts";
import { gfm } from "../utils/markdown.ts";
// TODO(lucacasonato): hash the file and use the hash as the filename, and serve
// with high-cacheability headers.
const CSS = `${gfm.CSS}
ol.nested {
counter-reset: item;
}
ol.nested li {
display: block;
}
ol.nested li:before {
font-feature-settings: "kern" 1, "tnum" 1;
-webkit-font-feature-settings: "kern" 1, "tnum" 1;
-ms-font-feature-settings: "kern" 1, "tnum" 1;
-moz-font-feature-settings: "kern" 1, "tnum" 1;
content: counters(item, ".") ". ";
counter-increment: item;
}
.markdown-body ul {
list-style: disc;
}
.markdown-body ol {
list-style: numeric;
}
.toggle:checked + .toggled {
display: block;
}
`;
export const handler: Handlers = {
GET: () => {
return new Response(CSS, {
headers: {
"content-type": "text/css",
"cache-control": "public, max-age=31536000, immutable",
},
});
},
};