Skip to content

Commit

Permalink
constrain style to .markdown-body
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Oct 21, 2021
1 parent 446456e commit e8c376a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
7 changes: 5 additions & 2 deletions example/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ async function handler(_req: Request): Promise<Response> {
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
}
main {
max-width: 800px;
margin: 0 auto;
Expand All @@ -44,5 +47,5 @@ async function handler(_req: Request): Promise<Response> {
}
}

console.log("Server listening on http://localhost:8000");
listenAndServe(":8000", handler);
console.log("Server listening on http://localhost:8001");
listenAndServe(":8001", handler);
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
build:
cd style && npm install && npm run build
echo "/** @type {string} */\nexport const CSS = \``cat style/dist/main.css`\`;" > style.js
echo "/** @type {string} */\nexport const CSS = \``cat style/dist/main.css`\`;" > style.js

dev:
deno run --allow-net --allow-read --unstable --watch ./example/main.ts
4 changes: 2 additions & 2 deletions style.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions style/main.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
@import "@primer/css/color-modes/themes/light.scss";
@import "@primer/css/color-modes/themes/dark.scss";

@import "@primer/css/support/index.scss";
@import "@primer/css/base/index.scss";
.markdown-body {
@import "@primer/css/support/index.scss";
@import "@primer/css/base/index.scss";

background-color: var(--color-canvas-default);
color: var(--color-fg-default);
}

@import "@primer/css/markdown/index.scss";

Expand Down
13 changes: 0 additions & 13 deletions style/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion style/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"devDependencies": {
"@parcel/transformer-sass": "^2.0.0",
"@primer/css": "^18.0.1",
"normalize.css": "^8.0.1",
"parcel": "^2.0.0"
}
}

0 comments on commit e8c376a

Please sign in to comment.