Skip to content

Commit

Permalink
Add CSS stylesheet
Browse files Browse the repository at this point in the history
Mark function idents and zero-width operator with appropriate classes
such that they can be selected with CSS and correct space around them
added.

Also move the cancel enclose style rule to the CSS stylesheet.

Fixes: #103
  • Loading branch information
runarberg committed Jun 7, 2024
1 parent c0c6732 commit 4cfda6e
Show file tree
Hide file tree
Showing 31 changed files with 368 additions and 68 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and include the **module**:

```html
<script type="module" src="mathup.js"></script>
<link rel="stylesheet" href="mathup.css" />
```

…the **custom element**:
Expand All @@ -38,6 +39,7 @@ and include the **module**:

```html
<script src="mathup.iife.js"></script>
<link rel="stylesheet" href="mathup.css" />
```

#### Usage
Expand Down
14 changes: 12 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,29 @@ <h5>Client</h5>
>min</a
>)
</li>

<li>
Stylesheet (<a
href="https://cdn.jsdelivr.net/npm/mathup/dist/mathup.css"
download
>full</a
>; <em>not needed for custom element</em>)
</li>
</ul>

<p>…and include the <b>module</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>
<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;
&lt;<span class="hl-tag-name">link</span> <span class="hl-keyword">rel</span>=<span class="hl-string">"stylesheet"</span> <span class="hl-keyword">href</span>=<span class="hl-string">"mathup.css"</span> /&gt;</code></pre>

<p>…the <b>custom element</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"math-up-element.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>

<p>…or the <b>script</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.iife.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>
<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.iife.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;
&lt;<span class="hl-tag-name">link</span> <span class="hl-keyword">rel</span>=<span class="hl-string">"stylesheet"</span> <span class="hl-keyword">href</span>=<span class="hl-string">"mathup.css"</span> /&gt;</code></pre>
</section>

<section id="usage">
Expand Down
147 changes: 147 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"jsdom": "^22.1.0",
"prettier": "3.0.3",
"rollup": "^4.3.0",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^5.2.2"
}
}
14 changes: 14 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import path from "node:path";

import babel from "@rollup/plugin-babel";
import terser from "@rollup/plugin-terser";
import copy from "rollup-plugin-copy";

/**
* @typedef {import("rollup").RollupOptions} RollupOptions
Expand Down Expand Up @@ -47,10 +50,21 @@ const defaultConfig = {
plugins: [terser()],
},
],

plugins: [
babel({
babelHelpers: "runtime",
}),

copy({
targets: [
{
src: path.resolve("./src/stylesheets/core.css"),
dest: path.resolve("dist/"),
rename: "mathup.css",
},
],
}),
],
};

Expand Down
Loading

0 comments on commit 4cfda6e

Please sign in to comment.