Title and legend
Card styles¶
The title card and the legend take the same Tailwind words for place, colour, type and shape.
kh.map(states, "fill-[density] scheme-q5",
title="Population density", title_style="top-center bg-white/80 bg-blur font-serif text-3xl",
legend_style="bottom-right bg-slate-900/80 text-white rounded-xl shadow-lg")
Words not given keep the theme's look: white cards on light basemaps, slate cards on dark ones.
Place¶
| Word | Short | Sits |
|---|---|---|
top-left |
tl |
top left (the title's default) |
top-center |
tc |
top centre |
top-right |
tr |
top right |
middle-left |
ml |
left edge, centred |
middle-right |
mr |
right edge, centred |
bottom-left |
bl |
bottom left |
bottom-center |
bc |
bottom centre |
bottom-right |
br |
bottom right (the legend's default) |
above |
outside, over the map | |
below |
outside, under the map |
Cards sharing a place stack.
Colour and surface¶
| Word | Does |
|---|---|
bg-<colour> |
background, any colour with /opacity: bg-white/80, bg-[#121212]/90, bg-transparent |
bg-blur |
frosted glass behind a see-through background |
text-<colour> |
text colour |
border, border-2, border-<colour> |
an outline |
rounded-none, -sm, rounded, -md, -lg, -xl, -2xl, -3xl, -full |
corner radius, 0 to fully round |
shadow-none, -sm, shadow, -md, -lg |
shadow |
opacity-<0-100> |
the whole card |
accent-<colour> |
colour of *starred* title words |
Type¶
| Word | Does |
|---|---|
font-sans, font-serif, font-mono |
system typefaces |
font-[Playfair_Display] |
any Google Font, loaded for you; underscores stand for spaces |
text-xs, -sm, -base, -lg, -xl, -2xl to -6xl |
size: 12 to 60 px; on a title card it sizes the title |
font-thin to font-black |
weight 100 to 900 |
italic, uppercase, tracking-tight to tracking-widest |
style; on a title card, the title line only |
text-left, text-center, text-right |
alignment |
Size and layout¶
| Word | Does |
|---|---|
p-<n> |
padding, in steps of 4 px: p-0, p-4 = 16 px |
w-<n> |
width, in steps of 4 px: w-80 = 320 px |
flex-row |
legend classes in one wrapping row, like a caption |
Errors¶
A word kharita does not know raises CardStyleError with the closest word: rounded-xxl suggests rounded-xl.