Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Goban/style.css

From Wikipedia, the free encyclopedia
/* TemplateStyles for [[Module:Goban]]: draws a Go board with CSS only.
 *
 * The module sets font-size on .goban inline (the "tile size" argument), and
 * every dimension below is in em, so one intersection is exactly 1em square.
 */
.goban {
	display: table;
	line-height: 1;
	color: #000;
	background: #E8C27A;
	font-family: sans-serif;
	font-style: normal;
	font-weight: normal;
	text-indent: 0;
	letter-spacing: normal;
	user-select: none;
}
.goban *,
.goban *::before,
.goban *::after {
	box-sizing: border-box;
}
.goban-grid {
	display: block;
}
.goban-row {
	display: flex;
}

/* One intersection: the grid lines are two background layers, the first
 * horizontal and the second vertical, each 0.04em thick through the centre. */
.goban-pt {
	position: relative;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 1em;
	height: 1em;
	background-image: linear-gradient(#000, #000), linear-gradient(#000, #000);
	background-repeat: no-repeat;
	background-size: 100% 0.04em, 0.04em 100%;
	background-position: 50% 50%, 50% 50%;
}
/* Board edges: the line towards the edge is dropped (it runs from the
 * centre, less half a stroke so that the corner is filled). */
.goban-u {
	background-size: 100% 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 50% 50%, 50% 100%;
}
.goban-d {
	background-size: 100% 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 50% 50%, 50% 0;
}
.goban-l {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em 100%;
	background-position: 100% 50%, 50% 50%;
}
.goban-r {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em 100%;
	background-position: 0 50%, 50% 50%;
}
.goban-ul {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 100% 50%, 50% 100%;
}
.goban-ur {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 0 50%, 50% 100%;
}
.goban-dl {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 100% 50%, 50% 0;
}
.goban-dr {
	background-size: calc(50% + 0.02em) 0.04em, 0.04em calc(50% + 0.02em);
	background-position: 0 50%, 50% 0;
}

/* Hoshi */
.goban-hoshi::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0.2em;
	height: 0.2em;
	margin: -0.1em 0 0 -0.1em;
	border-radius: 50%;
	background: #000;
}
/* Red ring on an empty point (the "c" suffix) */
.goban-c::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0.6em;
	height: 0.6em;
	margin: -0.3em 0 0 -0.3em;
	border: 0.08em solid #f00;
	border-radius: 50%;
}

/* Stones */
.goban-stone {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 98%;
	height: 98%;
	border-radius: 50%;
	font-size: 0.512em;
	padding-top: 0.14em;
	white-space: nowrap;
}
.goban-b {
	color: #fff;
	background: radial-gradient(circle at 30% 30%, #777, #222 24%, #000 81%);
}
.goban-w {
	color: #000;
	background: radial-gradient(circle at 47% 49%, #fff 46%, #ddd 59%, #777 65%);
}
/* Triangle (a glyph) and square (a border) marks on a stone */
.goban-T,
.goban-S {
	padding-top: 0;
}
.goban-T {
	font-size: 0.7em;
}
.goban-S::before {
	content: "";
	width: 56%;
	height: 56%;
	border: 0.07em solid currentColor;
}

/* Letter and X marks on an empty point */
.goban-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80%;
	height: 80%;
	background: #E8C27A;
	font-size: 0.614em;
	font-style: italic;
	text-transform: lowercase;
}
.goban-X {
	font-size: 0.89em;
	font-style: normal;
	text-transform: none;
	padding-top: 0.14em;
}
.goban-bare {
	background-image: none;
}
.goban-label {
	font-family: monospace;
	font-size: 0.632em;
	font-style: normal;
	padding-top: 0.14em;
}
.goban-3 {
  font-size: 0.4em;
}
/* Unrecognised tile codes are shown as text so the mistake is visible */
.goban-unknown {
	font-size: 0.4em;
	font-style: normal;
	text-transform: none;
	overflow: hidden;
}