feat: add shared utility classes to livetemplate.css#54
Conversation
Add layout (640px container), utility classes (.compact, .visually-hidden, .inline), and chat message styles (.messages, .message, .message.mine) to the shared CSS. Include livetemplate.css in package.json files array so it ships with the npm package. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ReviewTwo issues worth addressing before merge: 1.
|
There was a problem hiding this comment.
Pull request overview
Adds shared, Pico-themed CSS utility classes to livetemplate.css and ensures the stylesheet is published with the npm package so LiveTemplate example apps can depend on it via CDN/package install.
Changes:
- Publish
livetemplate.cssin the npm package by adding it topackage.jsonfiles. - Add shared utility/layout/chat styling classes to
livetemplate.css(.container,.compact,.visually-hidden,.inline,.messages/.message).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| package.json | Includes livetemplate.css in the published package artifacts. |
| livetemplate.css | Adds reusable layout/utility/chat CSS classes using Pico custom properties. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* === Layout === */ | ||
|
|
||
| /* Narrow container for focused, single-purpose apps. | ||
| Overrides Pico's breakpoint-based max-width values. */ | ||
| .container { | ||
| max-width: 640px; |
There was a problem hiding this comment.
The top-of-file docstring describes this stylesheet as only providing “CSS Custom Property Defaults” for lvt-fx:* directives, but the file now also defines general-purpose layout/utility/chat classes. Please update the file-level documentation (or add a short note near these new sections) so consumers understand this file includes opinionated utility selectors, not just directive variables.
| Overrides Pico's breakpoint-based max-width values. */ | ||
| .container { | ||
| max-width: 640px; |
There was a problem hiding this comment.
The comment says this .container rule “Overrides Pico's breakpoint-based max-width values”, but that’s only true if livetemplate.css is loaded after Pico (or if the rule wins specificity). Consider either documenting the required load order here, or making the override resilient (e.g., via higher specificity or !important) so the intended behavior is reliable.
| Overrides Pico's breakpoint-based max-width values. */ | |
| .container { | |
| max-width: 640px; | |
| Reliably overrides Pico's breakpoint-based max-width values, | |
| regardless of stylesheet load order. */ | |
| .container { | |
| max-width: 640px !important; |
| .container { | ||
| max-width: 640px; | ||
| } | ||
|
|
||
| /* === Utility Classes === */ | ||
|
|
||
| /* Compact buttons/inputs for inline use in tables and toolbars */ | ||
| .compact { |
There was a problem hiding this comment.
These new selectors introduce very generic class names (.container, .compact, .inline, .messages, .message) into a published package stylesheet. Since most of the library’s public-facing surface is namespaced with lvt-* (e.g., lvt-fx:* in dom/directives.ts), these unprefixed utilities are more likely to collide with app/framework styles. Consider prefixing (e.g., .lvt-container, .lvt-compact, etc.) or scoping them under a LiveTemplate root selector to avoid unintended global overrides.
Summary
livetemplate.cssthat all example apps now depend on (see feat: comprehensive E2E test coverage, visual validation, and template fixes examples#55).container— narrow 640px container for focused single-purpose apps.compact— compact buttons/inputs for inline use in tables and toolbars.visually-hidden— accessible screen-reader-only utility.inline— zero-margin form for table/toolbar embedding.messages/.message/.message.mine— chat message list stylingThese classes use Pico CSS variables (
--pico-*) for consistent theming and are designed as reusable patterns across LiveTemplate apps.Test plan
livetemplate.css.containeroverrides Pico's breakpoint-based max-width.compactreduces button/input padding appropriately.messagescontainer scrolls and.message.minehighlights🤖 Generated with Claude Code