ply-css 1.3.0

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 (75) hide show
  1. package/CLAUDE.md +176 -0
  2. package/LICENSE +22 -0
  3. package/PLY.md +646 -0
  4. package/README.md +170 -0
  5. package/dist/css/ply-core.css +6175 -0
  6. package/dist/css/ply-core.min.css +1 -0
  7. package/dist/css/ply-essentials.min.css +1 -0
  8. package/dist/css/ply-helpers.min.css +1 -0
  9. package/dist/css/ply.css +7429 -0
  10. package/dist/css/ply.min.css +1 -0
  11. package/dist/css/styles.css +7432 -0
  12. package/dist/css/styles.min.css +1 -0
  13. package/llms-full.txt +834 -0
  14. package/llms.txt +34 -0
  15. package/package.json +70 -0
  16. package/ply-classes.json +2625 -0
  17. package/snippets/accessible-drag-and-drop.html +122 -0
  18. package/snippets/card.html +58 -0
  19. package/snippets/contact-form.html +49 -0
  20. package/snippets/custom-theme.html +280 -0
  21. package/snippets/dashboard.html +77 -0
  22. package/snippets/data-table.html +64 -0
  23. package/snippets/login-page.html +45 -0
  24. package/snippets/navbar-page.html +39 -0
  25. package/snippets/notifications.html +63 -0
  26. package/snippets/pricing-cards.html +95 -0
  27. package/snippets/responsive-header.html +98 -0
  28. package/snippets/starter-page.html +782 -0
  29. package/snippets/two-column-layout.html +40 -0
  30. package/src/scss/_ply-core-components.scss +32 -0
  31. package/src/scss/_ply.scss +47 -0
  32. package/src/scss/components/_accordion.scss +73 -0
  33. package/src/scss/components/_alignments.scss +64 -0
  34. package/src/scss/components/_autocomplete.scss +28 -0
  35. package/src/scss/components/_blocks-responsive.scss +30 -0
  36. package/src/scss/components/_blocks.scss +39 -0
  37. package/src/scss/components/_buttons.scss +452 -0
  38. package/src/scss/components/_colors.scss +447 -0
  39. package/src/scss/components/_container-queries.scss +35 -0
  40. package/src/scss/components/_cursors.scss +24 -0
  41. package/src/scss/components/_dialog-patterns.scss +176 -0
  42. package/src/scss/components/_dropdown.scss +68 -0
  43. package/src/scss/components/_filterbox.scss +57 -0
  44. package/src/scss/components/_flexible-embed.scss +19 -0
  45. package/src/scss/components/_forms.scss +450 -0
  46. package/src/scss/components/_grid.scss +210 -0
  47. package/src/scss/components/_helpers-core.scss +357 -0
  48. package/src/scss/components/_helpers.scss +466 -0
  49. package/src/scss/components/_labels.scss +105 -0
  50. package/src/scss/components/_livesearch.scss +233 -0
  51. package/src/scss/components/_loader.scss +24 -0
  52. package/src/scss/components/_media-queries.scss +9 -0
  53. package/src/scss/components/_mixins.scss +387 -0
  54. package/src/scss/components/_modal.scss +73 -0
  55. package/src/scss/components/_multi-step-form.scss +190 -0
  56. package/src/scss/components/_navigation-responsive.scss +63 -0
  57. package/src/scss/components/_navigation.scss +592 -0
  58. package/src/scss/components/_notifications.scss +185 -0
  59. package/src/scss/components/_prettyprint.scss +86 -0
  60. package/src/scss/components/_print.scss +74 -0
  61. package/src/scss/components/_progress.scss +32 -0
  62. package/src/scss/components/_reset.scss +365 -0
  63. package/src/scss/components/_rtl.scss +213 -0
  64. package/src/scss/components/_table-interactive.scss +110 -0
  65. package/src/scss/components/_tables.scss +52 -0
  66. package/src/scss/components/_themes.scss +6 -0
  67. package/src/scss/components/_tooltip.scss +35 -0
  68. package/src/scss/components/_typography.scss +565 -0
  69. package/src/scss/components/_upload.scss +19 -0
  70. package/src/scss/components/_variables.scss +129 -0
  71. package/src/scss/ply-core.scss +1 -0
  72. package/src/scss/ply-essentials.scss +15 -0
  73. package/src/scss/ply-helpers.scss +11 -0
  74. package/src/scss/ply-iso.scss +1 -0
  75. package/src/scss/styles.scss +9 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,176 @@
1
+ # ply CSS Framework — AI Instructions
2
+
3
+ This is the ply CSS framework repository. See **PLY.md** for the complete class reference, usage rules, and copy-paste snippets.
4
+
5
+ ## Before Writing Custom CSS — Search ply-classes.json
6
+
7
+ **`ply-classes.json`** is the complete searchable reference. Before writing any custom CSS, search it first:
8
+
9
+ - **`classes`** — Every ply class with category, description, and examples. Search here before inventing a class name.
10
+ - **`customProperties`** — All 60+ `--ply-*` CSS variables organized by category (typography, background, text, borders, interactive, elevation, brand, palette) with light/dark values. Use these instead of hardcoding colors or font stacks.
11
+ - **`semanticElements`** — Every HTML element ply auto-styles (`<dialog>`, `<details>`, `<table>`, `<code>`, `<kbd>`, `<mark>`, `<progress>`, `<meter>`, etc.) with tips on usage. Check here before building a custom component — ply may already style the native element.
12
+
13
+ **Rule: If you're about to write custom CSS, search `ply-classes.json` first.** If a class, variable, or semantic element already does what you need, use it.
14
+
15
+ ## Start Semantic, Then Customize
16
+
17
+ ply automatically styles semantic HTML elements — `<nav>`, `<table>`, `<code>`, `<blockquote>`, `<details>`, `<dialog>`, `<progress>`, `<meter>`, headings, forms, and more. Start with semantic elements before reaching for `<div>` wrappers or custom classes. Custom styling is fine when you need it, but use what HTML and ply give you for free first.
18
+
19
+ ## Key Rules for Generating ply Markup
20
+
21
+ 1. **ply is standalone** — Do NOT use Tailwind, Bootstrap, or other CSS frameworks alongside ply. Remove them first.
22
+ 2. **Always wrap `unit-*` classes inside `units-row`** — they are flex children and won't work alone
23
+ 3. **Use `units-container`** for page-width centering (1200px max)
24
+ 4. **Wrap forms in `.form`** to enable styled inputs
25
+ 5. **Use `<button class="btn">` for buttons** — not `<a>` tags. Use `btn-primary` for primary actions, `btn-secondary` (or plain `btn`) for secondary actions. Color buttons (`btn-blue`, `btn-red`, etc.) are static and immune to theming — use them for color-coded actions, not as primary/secondary.
26
+ 6. **`units-row` can be nested** inside units for complex layouts
27
+ 7. **Add responsive classes** — at minimum `tablet-unit-100` to stack columns on mobile
28
+ 8. **Use semantic HTML first** — ply auto-styles `<code>`, `<pre>`, `<kbd>`, `<blockquote>`, `<mark>`, `<table>`, `<details>`, `<dialog>`, `<nav>`, etc. Use native elements before creating custom classes.
29
+ 9. **Only use documented ply classes** — Do NOT invent class names. Search `ply-classes.json` to find the right class. See PLY.md for the full prose reference.
30
+ 10. **Dark mode is automatic** — Auto dark mode activates only when no `data-theme` attribute is set on `<html>`. Use `data-theme="dark"` for explicit dark mode, `data-theme="light"` for explicit light mode, or any custom value (e.g., `data-theme="warm"`) for a custom theme without dark-mode interference. Use `var(--ply-*)` custom properties for colors (see `customProperties` in the JSON), never hard-code values that break dark mode.
31
+ 11. **Icons** — Use [Feather Icons](https://feathericons.com) as the preferred icon library. Any icon library works, but Feather pairs well with ply's aesthetic.
32
+ 12. **Container queries** — Use `container-query` on a parent element and `container-tablet-unit-*`, `container-phone-unit-*`, etc. for component-level responsive behavior (responds to parent width, not viewport). See PLY.md for details.
33
+
34
+ ## Custom Themes
35
+
36
+ Create a custom theme by defining a `data-theme` value and overriding `--ply-*` custom properties. Every ply component respects these variables, so one block themes the entire app.
37
+
38
+ ```css
39
+ [data-theme="brand"] {
40
+ /* Colors */
41
+ --ply-bg-body: #fefce8;
42
+ --ply-bg-surface: #fef9c3;
43
+ --ply-bg-muted: #fef08a;
44
+ --ply-color-body: #1a1a1a;
45
+ --ply-color-headings: #78350f;
46
+ --ply-border-color: #fbbf24;
47
+ --ply-color-accent: #b45309;
48
+ --ply-btn-default-bg: #b45309; /* Controls btn-primary + links */
49
+ --ply-btn-default-bg-hover: #92400e;
50
+ --ply-btn-default-bg-active: #7c2d12;
51
+ --ply-btn-secondary-bg: #78350f;
52
+ --ply-btn-border-radius: 0.5rem;
53
+ --ply-nav-bg: #fef3c7;
54
+ --ply-nav-border: #f59e0b;
55
+
56
+ /* Typography (optional) */
57
+ --ply-font-body: "Palatino Linotype", Palatino, Georgia, serif;
58
+ --ply-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
59
+ --ply-font-mono: "Fira Code", "Source Code Pro", monospace;
60
+ }
61
+ ```
62
+
63
+ ```html
64
+ <html data-theme="brand">
65
+ ```
66
+
67
+ Setting a custom `data-theme` value prevents auto dark mode from interfering with the theme. The `--ply-font-body`, `--ply-font-heading`, and `--ply-font-mono` properties let you override typography alongside colors.
68
+
69
+ See `customProperties` in `ply-classes.json` for the full list of overridable variables. Use the `themeTemplate` key in `ply-classes.json` for a complete copy-paste CSS block with every overridable variable grouped by category.
70
+
71
+ ## Common Patterns
72
+
73
+ - **Equal-height cards** — Add `equal-height` to `units-row` so all children stretch to the tallest
74
+ - **Gap between flex/grid children** — Use `gap-xs`, `gap-sm`, `gap`, `gap-lg`, `gap-xl` instead of margin hacks
75
+ - **Prevent orphaned words** — Use `no-orphan` on paragraphs, `text-balance` on headings
76
+ - **Card-style links** — Use `no-link-style` on a container to suppress link color/underline on all `<a>` inside
77
+ - **Navbar variants** — Default is a thin border. Use `navbar-thick`, `navbar-borderless`, or `navbar-border-blue/green/red/yellow`
78
+ - **Text color hierarchy** — `text-primary`, `text-secondary`, `text-tertiary` (all theme-aware)
79
+
80
+ ## Class Naming
81
+
82
+ ply follows `{property}-{direction}-{modifier}` — mirrors CSS property names:
83
+
84
+ - `margin-top`, `padding-left-extra`, `border-top-thick`
85
+ - `padding-top-xs`, `margin-bottom-xxl`
86
+ - `btn-lg`, `btn-sm`, `btn-xs`, `input-lg`, `input-sm`, `input-xs`
87
+ - `bg-white`, `bg-black`, `navbar-centered`, `display-flex`
88
+ - **Size scale:** `xs`, `sm`, `lg`, `xl`, `xxl`
89
+
90
+ ## Accessibility (WCAG 2.1 AA)
91
+
92
+ ply targets Section 508 / WCAG 2.1 AA compliance:
93
+ - `:focus-visible` outlines on all interactive elements (buttons, links, inputs, nav items, dropdowns)
94
+ - `prefers-contrast: more` support for high contrast mode
95
+ - `prefers-reduced-motion: reduce` disables animations
96
+ - `prefers-color-scheme: dark` automatic dark mode with WCAG AA contrast (only when no `data-theme` is set)
97
+ - `.skip-link` — Add as the first focusable element inside `<body>` for keyboard navigation
98
+ - `.sr-only` — Visually hidden, accessible to screen readers
99
+
100
+ ## Title II / WCAG 2.1 AA Compliance
101
+
102
+ ply targets ADA Title II compliance (28 CFR Part 35) by meeting WCAG 2.1 AA success criteria at the framework level. State and local government web content must conform to WCAG 2.1 AA as of June 2024.
103
+
104
+ ### What ply handles at the framework level
105
+
106
+ - **Focus management** — `:focus-visible` outlines on all interactive elements (1.4.11 Non-Text Contrast, 2.4.7 Focus Visible)
107
+ - **Reduced motion** — `prefers-reduced-motion: reduce` disables animations (2.3.3 Animation from Interactions)
108
+ - **High contrast** — `prefers-contrast: more` strengthens text and link colors (1.4.3 Contrast Minimum, 1.4.6 Contrast Enhanced)
109
+ - **Dark mode with AA contrast** — `prefers-color-scheme: dark` auto-adjusts colors to maintain 4.5:1 contrast (1.4.3 Contrast Minimum)
110
+ - **Semantic HTML auto-styling** — Encourages correct landmarks (`<nav>`, `<main>`, `<aside>`) and heading hierarchy (1.3.1 Info and Relationships, 2.4.6 Headings and Labels)
111
+ - **`.skip-link`** — Keyboard skip navigation (2.4.1 Bypass Blocks)
112
+ - **`.sr-only`** — Screen-reader-only content (1.3.1 Info and Relationships)
113
+ - **Zero JavaScript** — No ARIA state management failures from framework code (4.1.2 Name, Role, Value)
114
+
115
+ ### What needs application-level attention
116
+
117
+ - **Alt text on images** — Add `alt` to every `<img>`; use `alt=""` for decorative images (1.1.1 Non-text Content)
118
+ - **ARIA attributes on custom widgets** — Custom dropdowns, modals triggered by JS, and interactive components need `aria-expanded`, `aria-controls`, `role`, etc. (4.1.2 Name, Role, Value)
119
+ - **Heading hierarchy** — ply styles h1-h6 but does not enforce order. Use one `<h1>` per page, then h2-h6 in sequence (1.3.1 Info and Relationships)
120
+ - **Color contrast on custom colors** — If you override `--ply-*` variables or add custom colors, verify 4.5:1 contrast for text, 3:1 for large text and UI components (1.4.3 Contrast Minimum)
121
+ - **Keyboard operability** — Custom JavaScript components (tabs, accordions, drag-and-drop) must be fully operable with keyboard alone (2.1.1 Keyboard)
122
+
123
+ ### AI agent guidance
124
+
125
+ When generating markup with ply, always:
126
+ - Use semantic HTML elements (`<nav>`, `<main>`, `<aside>`, `<section>`, `<article>`) for correct landmarks
127
+ - Add `aria-label` to custom interactive widgets that lack visible text labels
128
+ - Use `<form role="search">` for search forms
129
+ - Include `.skip-link` as the first focusable element in page templates
130
+ - Add `alt` text to all `<img>` elements
131
+ - Maintain heading hierarchy (h1 > h2 > h3, no skipping levels)
132
+
133
+ ## Custom Widget Accessibility
134
+
135
+ When building tabs, dropdowns, drag-and-drop, or other custom JS widgets with ply, see the **"Focus Management & Keyboard Patterns"** and **"Custom Widget Accessibility Patterns"** sections in PLY.md for complete ARIA attribute examples, roving tabindex patterns, `aria-live` region usage, and keyboard navigation code.
136
+
137
+ ## Responsive Headers
138
+
139
+ For CSS-only collapsible navigation (hamburger menu on mobile, inline nav on desktop), see **"Responsive Collapsible Header"** in PLY.md's Navigation section and `snippets/responsive-header.html` for a full working example using `<details>`/`<summary>` — no JavaScript required.
140
+
141
+ ## Installation
142
+
143
+ ### npm + Sass (recommended)
144
+ For real projects, install ply and import the SCSS source. This gives access to the full color palette, spacing variables, mixins, and Sass-level customization.
145
+
146
+ ```sh
147
+ npm install ply-css
148
+ ```
149
+
150
+ ```scss
151
+ @use "ply-css/src/scss/components/colors" as colors;
152
+ @use "ply-css/src/scss/components/variables" as variables;
153
+ @use "ply-css/src/scss/components/mixins" as mixins;
154
+
155
+ .custom {
156
+ color: colors.$color-blue;
157
+ background: colors.$color-blue-pastel;
158
+ }
159
+ ```
160
+
161
+ ### CDN (prototyping only)
162
+ For quick demos — gives you ply's classes and dark mode, but no Sass variables, color palette, or mixins.
163
+ ```html
164
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ply-css@1/dist/css/ply.min.css">
165
+ ```
166
+
167
+ ## File Structure
168
+
169
+ - `src/scss/` — SCSS source (modern `@use`/`@forward` modules). **Use this when the project has a build step.**
170
+ - `components/_colors.scss` — Full color palette, brand colors, dark/light/pastel variants, neutral scale
171
+ - `components/_variables.scss` — Spacing, font sizes, breakpoints, border radius
172
+ - `components/_mixins.scss` — Button generator, clearfix, gradients, arrows, animations
173
+ - `dist/css/` — Compiled CSS bundles (for CDN or direct linking)
174
+ - `PLY.md` — Complete AI instruction file with class reference
175
+ - `ply-classes.json` — Machine-readable class reference
176
+ - `snippets/` — Copy-paste HTML examples
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 John Gibby
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+