Comments (6)
Ugh, it seems impossible to get the computed value of a CSS counter. So we can't populate our cross-reference with e.g., "Theorem 1" when using CSS counters to generate "1".
I've asked on mastodon https://bonn.social/@pkra/111314587141501059
from laml-wc.
Maybe for the best to keep it in the main node.
from laml-wc.
For the record, this was the css I was looking at
chapter- {
counter-reset: thmCounter;
}
thm- {
counter-increment: thmCounter;
}
thm- > statement-label::after {
content: ' ' counter(thmCounter) '. ';
}
blame-::before{
content: ' ('
}
blame-::after{
content: ') '
}
<thm- id="thm-cantor">
<blame->Cantor</blame->
The set of all real numbers is uncountable.
</thm->
giving us something like
from laml-wc.
Ah, I should push the code switching from "b" to "statement-label" elements (in the statement custom element).
from laml-wc.
Right now I'm thinking all we can do is to choose either the statement-label or the blame (and the given ID as fallback if things fail). Then the elements have to do the heavy work of making those meaningful. That makes ref-
simple but only by shifting.
from laml-wc.
As it turns out, counters are hard (for me). First, I had to do the bad thing and grab some code from SO to get a counter to work at all -- and not understanding enough about custom elements and their constructors to really be sure it's how I'd like it to work -- plus, what I have right now wouldn't survive re-arranging the DOM.
Second, there's the problem of counter reset. The "best" I've come up is resetting in the constructor of the sectioning element. But of course that means I need custom elements for all sectioning. Probably not a huge deal since we only have section
in HTML.
But still. It all feels horrid since CSS counters give me all of this for free.
This comment should be for a new issue, I suppose.
from laml-wc.
Related Issues (19)
- reconsider name- HOT 4
- go through laml backlog HOT 1
- work out a JS solution in lieu of CSS counters HOT 5
- proofs should not be enumerated
- think about proof- HOT 1
- SSR HOT 3
- move script to end of body
- naming HOT 9
- dual design HOT 15
- revise proof
- next steps for ref- HOT 7
- optional qed placement
- table of contents HOT 6
- better SSR
- add landing page and SSR output
- look into penrose (for cichon's diagram)
- sprinkle some aria
- add pagedjs demo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laml-wc.