Skip to content

Commit 7c9bbd4

Browse files
committed
Add reusable base stylesheet and starter template
Extract shared element-level styles from src/site.less into base/base.less: - Brand tokens via --ogis-* custom properties on :root, overridable for rebranding - Semantic HTML only, no classes required Add base/index.html starter template proving the stylesheet works with bare semantic markup. Multi-page Vite build with a stable assets/base.css output name; simplify index.html (drop inline li rule and #container id); ignore .opencode/ temp dir. Files changed: - .gitignore - README.md - base/base.less - base/index.html - index.html - src/site.less - vite.config.js
1 parent a8cf8b1 commit 7c9bbd4

7 files changed

Lines changed: 269 additions & 138 deletions

File tree

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ dist-ssr
2121
*.njsproj
2222
*.sln
2323
*.sw?
24+
2425
dist
26+
27+
# Session temp files
28+
.opencode/

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
last_commit: "a8cf8b10a6a016449ddb85344a29402ed508f28c"
3+
4+
---
5+
16
[![ogis.org](SCREENSHOT.png)](https://www.ogis.org)

‎base/base.less‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// base — minimal organisational base styles. Semantic HTML, no classes.
2+
// Brand tokens: override the --ogis-* custom properties on :root in any
3+
// consumer to rebrand without touching the element rules below.
4+
5+
:root {
6+
--ogis-bg: #001000;
7+
--ogis-bg-alt: #002400;
8+
--ogis-fg: #eee;
9+
--ogis-accent: #0dd70d;
10+
--ogis-footer-bg: #111;
11+
--ogis-font: monospace;
12+
--ogis-container-width: 1024px;
13+
}
14+
15+
body {
16+
margin: 0;
17+
padding: 0;
18+
font-family: var(--ogis-font);
19+
color: var(--ogis-fg);
20+
font-size: 110%;
21+
background-color: var(--ogis-bg);
22+
}
23+
24+
a {
25+
color: var(--ogis-accent) !important;
26+
text-decoration: none;
27+
border-bottom: 1px dotted var(--ogis-accent);
28+
}
29+
30+
p.lead {
31+
font-size: 130%;
32+
}
33+
34+
main {
35+
img {
36+
max-width: 100%;
37+
display: block;
38+
padding: 15px 15px 15px 0;
39+
40+
&.right {
41+
@media (min-width: 480px) {
42+
float: right;
43+
padding: 0 0 15px 15px;
44+
}
45+
}
46+
}
47+
48+
ul li,
49+
ol li {
50+
margin: 5px 0;
51+
overflow-wrap: break-word;
52+
}
53+
}
54+
55+
header,
56+
main,
57+
footer {
58+
max-width: var(--ogis-container-width);
59+
margin: 0 auto;
60+
}
61+
62+
section {
63+
padding: 15px;
64+
65+
&:nth-child(odd) {
66+
background-color: var(--ogis-bg-alt);
67+
}
68+
}
69+
70+
footer {
71+
padding: 15px;
72+
background-color: var(--ogis-footer-bg);
73+
74+
ul {
75+
list-style: none;
76+
padding: 0;
77+
margin: 0;
78+
}
79+
}

‎base/index.html‎

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<!--
5+
base — starter template
6+
=============================
7+
This page doubles as the proof that base.less works with bare,
8+
semantic HTML and zero custom classes. The only classes used anywhere
9+
on this page are the two utilities provided by the base stylesheet:
10+
11+
.lead — a larger, emphasised paragraph
12+
img.right — floats an image to the right on wider screens
13+
14+
Everything else relies purely on element selectors (body, header, main,
15+
section, footer, ul, li, a, ...) and the brand tokens defined on :root.
16+
17+
To use the base stylesheet in your own project, copy the compiled
18+
dist/assets/base.css file and link it in your own pages.
19+
-->
20+
<meta charset="UTF-8" />
21+
<link rel="icon" href="data:," />
22+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
23+
<title>base — starter template</title>
24+
<link rel="stylesheet" href="./base.less" />
25+
</head>
26+
<body>
27+
<header>
28+
<h1>Example Organisation</h1>
29+
<p>Tagline goes here — a short description of what we do.</p>
30+
</header>
31+
32+
<main>
33+
<section>
34+
<p class="lead">
35+
This is a lead paragraph. It is slightly larger than body text and is
36+
intended to draw the reader into a section.
37+
</p>
38+
39+
<p>
40+
Everything below is plain semantic markup. Sections alternate
41+
background colour automatically — no classes required. Links pick up
42+
the organisation's accent colour and a dotted underline.
43+
</p>
44+
45+
<p>Here is a list of example links:</p>
46+
47+
<ul>
48+
<li><a href="#">Example link number one</a></li>
49+
<li><a href="#">Example link number two</a></li>
50+
<li><a href="#">Example link number three</a></li>
51+
<li><a href="#">Example link number four</a></li>
52+
</ul>
53+
</section>
54+
55+
<section>
56+
<h2>How to get started</h2>
57+
58+
<p>
59+
Every section needs a heading and a paragraph or two. Long content,
60+
such as a very long web address, is wrapped gracefully thanks to the
61+
<code>overflow-wrap</code> rule applied to list items:
62+
</p>
63+
64+
<ul>
65+
<li>
66+
https://www.example.com/this/is/a/very/long/url/with/many/segments/and/characters/that/demonstrates/word/wrapping
67+
</li>
68+
<li>Another list item, nicely spaced from its neighbours.</li>
69+
<li>A third item to show the vertical rhythm.</li>
70+
</ul>
71+
72+
<p>
73+
The two-column zebra striping between sections happens automatically.
74+
Add or remove sections freely and the styling stays in sync.
75+
</p>
76+
</section>
77+
78+
<section>
79+
<h2>An example image</h2>
80+
81+
<p class="lead">Images float right on wider screens.</p>
82+
83+
<p>
84+
<img
85+
class="right"
86+
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 160'%3E%3Crect width='240' height='160' fill='%230dd70d'/%3E%3Ctext x='120' y='85' font-family='monospace' font-size='16' fill='%23001000' text-anchor='middle'%3EPlaceholder%3C/text%3E%3C/svg%3E"
87+
width="240"
88+
height="160"
89+
alt="A green placeholder image"
90+
/>
91+
This image uses the <code>img.right</code> utility. On screens at
92+
least 480&nbsp;px wide it floats to the right with a little padding,
93+
so the text wraps around it. On narrow screens it sits inline, above
94+
this paragraph.
95+
</p>
96+
97+
<ul>
98+
<li>Responsive by default.</li>
99+
<li>No media queries required in your own markup.</li>
100+
<li>
101+
Works with any image — just add <code>class="right"</code>.
102+
</li>
103+
</ul>
104+
</section>
105+
106+
<section>
107+
<h2>Things to remember</h2>
108+
109+
<ul>
110+
<li>Use semantic elements: header, main, section, footer.</li>
111+
<li>Avoid class names wherever an element will do.</li>
112+
<li>
113+
Rebrand by overriding the <code>--ogis-*</code> tokens on
114+
<code>:root</code>.
115+
</li>
116+
<li>British English throughout.</li>
117+
</ul>
118+
119+
<p>
120+
This page has no JavaScript and no build step of its own — the whole
121+
design comes from a single stylesheet.
122+
</p>
123+
</section>
124+
</main>
125+
126+
<footer>
127+
<p>© 2026 Example Organisation</p>
128+
129+
<ul>
130+
<li><a href="#">Privacy</a></li>
131+
<li><a href="#">Terms</a></li>
132+
<li><a href="#">Contact</a></li>
133+
</ul>
134+
</footer>
135+
</body>
136+
</html>

‎index.html‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@
1414
href="https://www.ogis.org/waymark-js/dist/latest/css/waymark-js.min.css"
1515
/>
1616

17-
<style>
18-
li {
19-
overflow-wrap: break-word;
20-
}
21-
</style>
2217
<!-- Scripts -->
2318
<!-- Waymark JS -->
2419
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
2520
<script src="https://www.ogis.org/waymark-js/dist/latest/js/waymark-js.min.js"></script>
2621
<script type="module" src="./src/site.js"></script>
2722
</head>
2823
<body>
29-
<article id="container">
24+
<article>
3025
<header id="header">
3126
<h1 title="Open GIS">
3227
<table class="ogis-logo">

0 commit comments

Comments
 (0)