unigrid.css 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +101 -101
  2. package/dist/dropdown.js +36 -36
  3. package/dist/scrollspy.js +57 -57
  4. package/dist/tabs.js +30 -30
  5. package/dist/unigrid.css +4608 -4501
  6. package/dist/unigrid.js +173 -124
  7. package/dist/unigrid.min.css +1 -1
  8. package/dist/unigrid.min.js +1 -1
  9. package/package.json +70 -41
  10. package/src/js/dropdown.js +49 -49
  11. package/src/js/index.js +20 -19
  12. package/src/js/modal.js +81 -0
  13. package/src/js/scrollspy.js +87 -87
  14. package/src/js/tabs.js +58 -58
  15. package/src/scss/_accordion.scss +123 -123
  16. package/src/scss/_broadside.scss +125 -125
  17. package/src/scss/_buttons.scss +241 -241
  18. package/src/scss/_card.scss +168 -168
  19. package/src/scss/_components.scss +140 -140
  20. package/src/scss/_container.scss +53 -53
  21. package/src/scss/_dropdown.scss +178 -178
  22. package/src/scss/_footer.scss +147 -147
  23. package/src/scss/_formats.scss +64 -64
  24. package/src/scss/_forms.scss +192 -192
  25. package/src/scss/_grid.scss +114 -114
  26. package/src/scss/_header.scss +169 -169
  27. package/src/scss/_hero.scss +262 -262
  28. package/src/scss/_mixins.scss +120 -120
  29. package/src/scss/_modal.scss +158 -0
  30. package/src/scss/_modules.scss +238 -238
  31. package/src/scss/_navbar.scss +341 -341
  32. package/src/scss/_pagination.scss +160 -160
  33. package/src/scss/_prose.scss +393 -393
  34. package/src/scss/_reset.scss +82 -82
  35. package/src/scss/_scrollspy.scss +62 -62
  36. package/src/scss/_section.scss +91 -91
  37. package/src/scss/_sidebar.scss +147 -147
  38. package/src/scss/_table.scss +122 -122
  39. package/src/scss/_tabs.scss +178 -178
  40. package/src/scss/_typography.scss +105 -105
  41. package/src/scss/_utilities.scss +79 -79
  42. package/src/scss/_variables.scss +183 -183
  43. package/src/scss/unigrid.scss +50 -49
  44. package/dist/index.js +0 -5
package/README.md CHANGED
@@ -1,101 +1,101 @@
1
- # Unigrid.css
2
-
3
- A CSS grid framework inspired by [Massimo Vignelli's Unigrid system](https://en.wikipedia.org/wiki/Unigrids) for the National Park Service.
4
-
5
- Built with **SCSS**, native **CSS Grid**, and **BEM** naming — no dependencies.
6
-
7
- ## Concept
8
-
9
- The Unigrid is a standardized graphic and production system developed for NPS site folders:
10
-
11
- - **12-column base grid** with responsive breakpoints
12
- - **10 basic formats** — A-series (1 panel wide: A1–A4, A6) and B-series (2 panels wide: B1–B4, B6)
13
- - **Broadside approach** — layouts as flat sheets divided into foldable panels
14
- - **DIN proportions** (1:√2) — panel unit: 99 × 210 mm, folded size always constant
15
- - **Helvetica typography** with strict hierarchy
16
- - **Signature black header band**
17
-
18
- ## Quick Start
19
-
20
- ```html
21
- <link rel="stylesheet" href="dist/unigrid.css">
22
-
23
- <header class="ug-header">
24
- <div class="ug-header__title">
25
- <h1>Park Name</h1>
26
- <p class="ug-header__subtitle">National Park / State</p>
27
- </div>
28
- </header>
29
-
30
- <div class="ug-grid">
31
- <div class="ug-col--4">One third</div>
32
- <div class="ug-col--8">Two thirds</div>
33
- </div>
34
-
35
- <div class="ug-format ug-format--a4">
36
- <div class="ug-broadside ug-broadside--stack">
37
- <section class="ug-panel">Panel 1</section>
38
- <section class="ug-panel">Panel 2</section>
39
- <section class="ug-panel">Panel 3</section>
40
- <section class="ug-panel">Panel 4</section>
41
- </div>
42
- </div>
43
- ```
44
-
45
- ## Formats
46
-
47
- | Format | Wide × Long | Panel Size | Description |
48
- |--------|-------------|------------|-------------|
49
- | A1 | 1 × 1 | 99 × 210 mm | Single panel |
50
- | A2 | 1 × 2 | 198 × 210 mm | Letter-fold |
51
- | A3 | 1 × 3 | 297 × 210 mm | Tri-fold |
52
- | A4 | 1 × 4 | 396 × 210 mm | Most common NPS format |
53
- | A6 | 1 × 6 | 594 × 210 mm | Extended folder |
54
- | B1 | 2 × 1 | 99 × 420 mm | Double-height single |
55
- | B2 | 2 × 2 | 198 × 420 mm | Double-height bifold |
56
- | B3 | 2 × 3 | 297 × 420 mm | Double-height trifold |
57
- | B4 | 2 × 4 | 396 × 420 mm | Double-height quad |
58
- | B6 | 2 × 6 | 594 × 420 mm | DIN A2 — largest format |
59
-
60
- ## Development
61
-
62
- ```bash
63
- npm install
64
- npm run dev # Start Vite dev server with hot reload
65
- npm run build # Build dist/unigrid.css + dist/unigrid.min.css
66
- ```
67
-
68
- The dev server provides pages for testing each component:
69
- - **Overview** — color palette, quick demo
70
- - **Grid** — column spans, responsive, alignment
71
- - **Formats** — all 10 formats with broadside examples
72
- - **Typography** — headings, body, captions, labels
73
- - **Components** — header, infobox, map, divider, panels
74
- - **Cheatsheet** — all CSS classes at a glance
75
-
76
- ## SCSS Customization
77
-
78
- Override variables before importing:
79
-
80
- ```scss
81
- $ug-font-family: "Frutiger", sans-serif;
82
- $ug-black: #222;
83
- $ug-gap: 1rem;
84
- @import "unigrid";
85
- ```
86
-
87
- Key variables: `$ug-columns`, `$ug-gap`, `$ug-breakpoints`, `$ug-colors`, `$ug-font-sizes`, `$ug-formats`.
88
-
89
- ## BEM Naming
90
-
91
- All classes follow BEM (Block__Element--Modifier):
92
-
93
- ```
94
- .ug-header → Block
95
- .ug-header__logo → Element
96
- .ug-header--compact → Modifier
97
- ```
98
-
99
- ## License
100
-
101
- MIT
1
+ # Unigrid.css
2
+
3
+ A CSS grid framework inspired by [Massimo Vignelli's Unigrid system](https://en.wikipedia.org/wiki/Unigrids) for the National Park Service.
4
+
5
+ Built with **SCSS**, native **CSS Grid**, and **BEM** naming — no dependencies.
6
+
7
+ ## Concept
8
+
9
+ The Unigrid is a standardized graphic and production system developed for NPS site folders:
10
+
11
+ - **12-column base grid** with responsive breakpoints
12
+ - **10 basic formats** — A-series (1 panel wide: A1–A4, A6) and B-series (2 panels wide: B1–B4, B6)
13
+ - **Broadside approach** — layouts as flat sheets divided into foldable panels
14
+ - **DIN proportions** (1:√2) — panel unit: 99 × 210 mm, folded size always constant
15
+ - **Helvetica typography** with strict hierarchy
16
+ - **Signature black header band**
17
+
18
+ ## Quick Start
19
+
20
+ ```html
21
+ <link rel="stylesheet" href="dist/unigrid.css">
22
+
23
+ <header class="ug-header">
24
+ <div class="ug-header__title">
25
+ <h1>Park Name</h1>
26
+ <p class="ug-header__subtitle">National Park / State</p>
27
+ </div>
28
+ </header>
29
+
30
+ <div class="ug-grid">
31
+ <div class="ug-col--4">One third</div>
32
+ <div class="ug-col--8">Two thirds</div>
33
+ </div>
34
+
35
+ <div class="ug-format ug-format--a4">
36
+ <div class="ug-broadside ug-broadside--stack">
37
+ <section class="ug-panel">Panel 1</section>
38
+ <section class="ug-panel">Panel 2</section>
39
+ <section class="ug-panel">Panel 3</section>
40
+ <section class="ug-panel">Panel 4</section>
41
+ </div>
42
+ </div>
43
+ ```
44
+
45
+ ## Formats
46
+
47
+ | Format | Wide × Long | Panel Size | Description |
48
+ |--------|-------------|------------|-------------|
49
+ | A1 | 1 × 1 | 99 × 210 mm | Single panel |
50
+ | A2 | 1 × 2 | 198 × 210 mm | Letter-fold |
51
+ | A3 | 1 × 3 | 297 × 210 mm | Tri-fold |
52
+ | A4 | 1 × 4 | 396 × 210 mm | Most common NPS format |
53
+ | A6 | 1 × 6 | 594 × 210 mm | Extended folder |
54
+ | B1 | 2 × 1 | 99 × 420 mm | Double-height single |
55
+ | B2 | 2 × 2 | 198 × 420 mm | Double-height bifold |
56
+ | B3 | 2 × 3 | 297 × 420 mm | Double-height trifold |
57
+ | B4 | 2 × 4 | 396 × 420 mm | Double-height quad |
58
+ | B6 | 2 × 6 | 594 × 420 mm | DIN A2 — largest format |
59
+
60
+ ## Development
61
+
62
+ ```bash
63
+ npm install
64
+ npm run dev # Start Vite dev server with hot reload
65
+ npm run build # Build dist/unigrid.css + dist/unigrid.min.css
66
+ ```
67
+
68
+ The dev server provides pages for testing each component:
69
+ - **Overview** — color palette, quick demo
70
+ - **Grid** — column spans, responsive, alignment
71
+ - **Formats** — all 10 formats with broadside examples
72
+ - **Typography** — headings, body, captions, labels
73
+ - **Components** — header, infobox, map, divider, panels
74
+ - **Cheatsheet** — all CSS classes at a glance
75
+
76
+ ## SCSS Customization
77
+
78
+ Override variables before importing:
79
+
80
+ ```scss
81
+ $ug-font-family: "Frutiger", sans-serif;
82
+ $ug-black: #222;
83
+ $ug-gap: 1rem;
84
+ @import "unigrid";
85
+ ```
86
+
87
+ Key variables: `$ug-columns`, `$ug-gap`, `$ug-breakpoints`, `$ug-colors`, `$ug-font-sizes`, `$ug-formats`.
88
+
89
+ ## BEM Naming
90
+
91
+ All classes follow BEM (Block__Element--Modifier):
92
+
93
+ ```
94
+ .ug-header → Block
95
+ .ug-header__logo → Element
96
+ .ug-header--compact → Modifier
97
+ ```
98
+
99
+ ## License
100
+
101
+ MIT
package/dist/dropdown.js CHANGED
@@ -1,36 +1,36 @@
1
- (() => {
2
- (function() {
3
- function init() {
4
- document.addEventListener("click", function(e) {
5
- var trigger = e.target.closest(".ug-dropdown__trigger");
6
- if (trigger) {
7
- e.preventDefault();
8
- }
9
- document.querySelectorAll(".ug-dropdown--open").forEach(function(dd) {
10
- if (dd.closest(".docs-example__preview")) return;
11
- if (!trigger || dd !== trigger.closest(".ug-dropdown")) {
12
- dd.classList.remove("ug-dropdown--open");
13
- }
14
- });
15
- if (trigger) {
16
- var dropdown = trigger.closest(".ug-dropdown");
17
- if (dropdown) {
18
- dropdown.classList.toggle("ug-dropdown--open");
19
- }
20
- }
21
- });
22
- document.addEventListener("keydown", function(e) {
23
- if (e.key === "Escape") {
24
- document.querySelectorAll(".ug-dropdown--open").forEach(function(dd) {
25
- dd.classList.remove("ug-dropdown--open");
26
- });
27
- }
28
- });
29
- }
30
- if (document.readyState === "loading") {
31
- document.addEventListener("DOMContentLoaded", init);
32
- } else {
33
- init();
34
- }
35
- })();
36
- })();
1
+ (() => {
2
+ (function() {
3
+ function init() {
4
+ document.addEventListener("click", function(e) {
5
+ var trigger = e.target.closest(".ug-dropdown__trigger");
6
+ if (trigger) {
7
+ e.preventDefault();
8
+ }
9
+ document.querySelectorAll(".ug-dropdown--open").forEach(function(dd) {
10
+ if (dd.closest(".docs-example__preview")) return;
11
+ if (!trigger || dd !== trigger.closest(".ug-dropdown")) {
12
+ dd.classList.remove("ug-dropdown--open");
13
+ }
14
+ });
15
+ if (trigger) {
16
+ var dropdown = trigger.closest(".ug-dropdown");
17
+ if (dropdown) {
18
+ dropdown.classList.toggle("ug-dropdown--open");
19
+ }
20
+ }
21
+ });
22
+ document.addEventListener("keydown", function(e) {
23
+ if (e.key === "Escape") {
24
+ document.querySelectorAll(".ug-dropdown--open").forEach(function(dd) {
25
+ dd.classList.remove("ug-dropdown--open");
26
+ });
27
+ }
28
+ });
29
+ }
30
+ if (document.readyState === "loading") {
31
+ document.addEventListener("DOMContentLoaded", init);
32
+ } else {
33
+ init();
34
+ }
35
+ })();
36
+ })();
package/dist/scrollspy.js CHANGED
@@ -1,57 +1,57 @@
1
- (() => {
2
- (function() {
3
- function init() {
4
- document.querySelectorAll("[data-ug-scrollspy]").forEach(function(nav) {
5
- var links = nav.querySelectorAll(".ug-scrollspy__link, [data-ug-spy]");
6
- if (!links.length) return;
7
- var offset = parseInt(nav.getAttribute("data-ug-scrollspy-offset") || "100", 10);
8
- var activeClass = nav.getAttribute("data-ug-scrollspy-class") || "ug-scrollspy__link--active";
9
- var targets = [];
10
- links.forEach(function(link) {
11
- var href = link.getAttribute("href");
12
- if (!href || href.charAt(0) !== "#") return;
13
- var target = document.querySelector(href);
14
- if (target) {
15
- targets.push({ link, target });
16
- }
17
- });
18
- if (!targets.length) return;
19
- var visibleSections = /* @__PURE__ */ new Set();
20
- var observer = new IntersectionObserver(function(entries) {
21
- entries.forEach(function(entry) {
22
- if (entry.isIntersecting) {
23
- visibleSections.add(entry.target.id);
24
- } else {
25
- visibleSections.delete(entry.target.id);
26
- }
27
- });
28
- var activeId = null;
29
- for (var i = 0; i < targets.length; i++) {
30
- if (visibleSections.has(targets[i].target.id)) {
31
- activeId = targets[i].target.id;
32
- break;
33
- }
34
- }
35
- targets.forEach(function(item) {
36
- if (item.target.id === activeId) {
37
- item.link.classList.add(activeClass);
38
- } else {
39
- item.link.classList.remove(activeClass);
40
- }
41
- });
42
- }, {
43
- rootMargin: "-" + offset + "px 0px -50% 0px",
44
- threshold: 0
45
- });
46
- targets.forEach(function(item) {
47
- observer.observe(item.target);
48
- });
49
- });
50
- }
51
- if (document.readyState === "loading") {
52
- document.addEventListener("DOMContentLoaded", init);
53
- } else {
54
- init();
55
- }
56
- })();
57
- })();
1
+ (() => {
2
+ (function() {
3
+ function init() {
4
+ document.querySelectorAll("[data-ug-scrollspy]").forEach(function(nav) {
5
+ var links = nav.querySelectorAll(".ug-scrollspy__link, [data-ug-spy]");
6
+ if (!links.length) return;
7
+ var offset = parseInt(nav.getAttribute("data-ug-scrollspy-offset") || "100", 10);
8
+ var activeClass = nav.getAttribute("data-ug-scrollspy-class") || "ug-scrollspy__link--active";
9
+ var targets = [];
10
+ links.forEach(function(link) {
11
+ var href = link.getAttribute("href");
12
+ if (!href || href.charAt(0) !== "#") return;
13
+ var target = document.querySelector(href);
14
+ if (target) {
15
+ targets.push({ link, target });
16
+ }
17
+ });
18
+ if (!targets.length) return;
19
+ var visibleSections = /* @__PURE__ */ new Set();
20
+ var observer = new IntersectionObserver(function(entries) {
21
+ entries.forEach(function(entry) {
22
+ if (entry.isIntersecting) {
23
+ visibleSections.add(entry.target.id);
24
+ } else {
25
+ visibleSections.delete(entry.target.id);
26
+ }
27
+ });
28
+ var activeId = null;
29
+ for (var i = 0; i < targets.length; i++) {
30
+ if (visibleSections.has(targets[i].target.id)) {
31
+ activeId = targets[i].target.id;
32
+ break;
33
+ }
34
+ }
35
+ targets.forEach(function(item) {
36
+ if (item.target.id === activeId) {
37
+ item.link.classList.add(activeClass);
38
+ } else {
39
+ item.link.classList.remove(activeClass);
40
+ }
41
+ });
42
+ }, {
43
+ rootMargin: "-" + offset + "px 0px -50% 0px",
44
+ threshold: 0
45
+ });
46
+ targets.forEach(function(item) {
47
+ observer.observe(item.target);
48
+ });
49
+ });
50
+ }
51
+ if (document.readyState === "loading") {
52
+ document.addEventListener("DOMContentLoaded", init);
53
+ } else {
54
+ init();
55
+ }
56
+ })();
57
+ })();
package/dist/tabs.js CHANGED
@@ -1,30 +1,30 @@
1
- (() => {
2
- (function() {
3
- function init() {
4
- document.addEventListener("click", function(e) {
5
- var link = e.target.closest("[data-ug-tab]");
6
- if (!link) return;
7
- e.preventDefault();
8
- var tabs = link.closest(".ug-tabs");
9
- if (!tabs) return;
10
- var target = link.getAttribute("data-ug-tab");
11
- tabs.querySelectorAll(".ug-tabs__link").forEach(function(l) {
12
- l.classList.remove("ug-tabs__link--active");
13
- });
14
- tabs.querySelectorAll(".ug-tabs__panel").forEach(function(p) {
15
- p.classList.remove("ug-tabs__panel--active");
16
- });
17
- link.classList.add("ug-tabs__link--active");
18
- var panel = tabs.querySelector('[data-ug-panel="' + target + '"]');
19
- if (panel) {
20
- panel.classList.add("ug-tabs__panel--active");
21
- }
22
- });
23
- }
24
- if (document.readyState === "loading") {
25
- document.addEventListener("DOMContentLoaded", init);
26
- } else {
27
- init();
28
- }
29
- })();
30
- })();
1
+ (() => {
2
+ (function() {
3
+ function init() {
4
+ document.addEventListener("click", function(e) {
5
+ var link = e.target.closest("[data-ug-tab]");
6
+ if (!link) return;
7
+ e.preventDefault();
8
+ var tabs = link.closest(".ug-tabs");
9
+ if (!tabs) return;
10
+ var target = link.getAttribute("data-ug-tab");
11
+ tabs.querySelectorAll(".ug-tabs__link").forEach(function(l) {
12
+ l.classList.remove("ug-tabs__link--active");
13
+ });
14
+ tabs.querySelectorAll(".ug-tabs__panel").forEach(function(p) {
15
+ p.classList.remove("ug-tabs__panel--active");
16
+ });
17
+ link.classList.add("ug-tabs__link--active");
18
+ var panel = tabs.querySelector('[data-ug-panel="' + target + '"]');
19
+ if (panel) {
20
+ panel.classList.add("ug-tabs__panel--active");
21
+ }
22
+ });
23
+ }
24
+ if (document.readyState === "loading") {
25
+ document.addEventListener("DOMContentLoaded", init);
26
+ } else {
27
+ init();
28
+ }
29
+ })();
30
+ })();