If you already use Bootstrap: the kit, and what we'd change about it #40
fcapolini
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Most people who find Markout aren't shopping for a framework. They have a page
that already uses Bootstrap, it already looks right, and they want to add some
behaviour to it without a build step and without rewriting it in something
else. That's the person
@markout-lang/bootstrap-kitis for.Bootstrap 5.3 as Markout components — 27 of them plus
baseandtheme,following Bootstrap's own cheatsheet,
with the id wiring, the ARIA attributes and the repetition written once.
The pitch is one example
Bootstrap's own markup for a modal with a trigger — ids that have to agree in
three places,
aria-labelledbypointing at one of them, and a nesting you copyfrom the docs every time:
The same thing through the kit:
Nobody writes an id. Nobody writes an
aria-attribute. The footer is a namedslot with a working Close button as its default, so a modal that doesn't need a
custom one doesn't mention it.
And because it's Markout, there's a second door Bootstrap's markup has no way
to express — state:
::openis a value the page owns. Bootstrap's own API gets there throughnew bootstrap.Modal(el).show(), which is a verb and therefore not somethingmarkup can say. Binding it to a value is the whole difference between "a modal
you click open" and "a modal that is open when the page says it is".
What it does not do
It is not a fork of Bootstrap, and doesn't want to be. The CSS and JS still
come from Bootstrap — jsDelivr 5.3.8 with SRI hashes by default, and four
tokens to point it somewhere else:
That matters for a CSP that allows no third-party origin, an air-gapped build,
a pinned vendored copy, or — most often — your own Bootstrap compiled from
Sass with your own variables. The kit's theming tokens only reach what
Bootstrap exposes as CSS custom properties; pointing
bsCssUrlat your build ishow the kit gets out of the way of a real design system.
all.htmis the ordinary import even though it pulls in everything: a componentno tag on the page uses is dropped before the page is served.
The comparison you're actually making
If you're a Bootstrap user adding logic to a page, you are almost certainly
weighing this against Alpine, not against React. That's a fair fight and we'd
rather have it in the open: Alpine drops in with a
<script src>and needsnothing else, which is a lower floor than we have today. What it has no
primitive for is reusable markup — there's no way to declare a parameterised
chunk of HTML and instantiate it, so the modal above stays 20 lines every time
you need one, or moves into whatever renders your pages.
If you've tried both, that comparison is the most useful thing you could post
here.
What we'd like to know
The kit is 0.4.0 and shaped by one person's guesses about what a Bootstrap page
needs. Concretely:
did you reach for and not find?
::name/::title/::openthe right convention?::marks acomponent parameter. It reads fine in isolation; we don't know how it reads
after a hundred lines of it.
Compiling from source with your variables is a different, bigger idea.
documented in the kit's README —
bs-accordion-itemreaching for$host,bs-paginationhaving to say::currentbecausepageis taken, tooltipsand popovers building their plugin from a handler. Those are the three we
found. We'd like to hear the fourth.
Kit source is in
kits/bootstrap-kit/,one file per component, each with the reasoning at the top.
All reactions