fix(widget): bump @deepgram/ui to ^0.1.1 for scoped tailwind preflight#48
Merged
lukeocodes merged 1 commit intomainfrom May 6, 2026
Merged
fix(widget): bump @deepgram/ui to ^0.1.1 for scoped tailwind preflight#48lukeocodes merged 1 commit intomainfrom
lukeocodes merged 1 commit intomainfrom
Conversation
@deepgram/ui@0.1.1 (deepgram/ui#27, deepgram/ui#30) ships preflight scoped to [data-dg-agent] via tailwindcss-scoped-preflight. Bumping the widget's @deepgram/ui dep brings the scoping into the published widget UMD bundle and the CDN copy at cdn.deepgram.com/widgets/. Verified locally by rebuilding the widget against 0.1.1: before (against 0.1.0): 0 :where([data-dg-agent]) rules in bundle after (against 0.1.1): 76 :where([data-dg-agent]) rules in bundle Bundle size grew 384.30 KB -> 387.53 KB (+3.23 KB) from the added scope selectors. Customer impact: any host page embedding the widget UMD no longer has its box model, list styling, heading margins, or button appearance overridden by Tailwind preflight. Widget components keep working because the scoped preflight still applies inside [data-dg-agent]. Refs: - deepgram/ui#27 (the fix itself) - deepgram/ui#30 (release-please unpin to actually publish 0.1.1) - deepgram/dx-stack#4 (gotchas + recipe doc)
lukeocodes
pushed a commit
that referenced
this pull request
May 6, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.4](agents-widget-v0.1.3...agents-widget-v0.1.4) (2026-05-06) ### Bug Fixes * **widget:** bump @deepgram/ui to ^0.1.1 for scoped tailwind preflight ([#48](#48)) ([0584d19](0584d19)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
lukeocodes
added a commit
to deepgram/ui
that referenced
this pull request
May 7, 2026
…age collisions (#32) The 0.1.1 release scoped Tailwind preflight to [data-dg-agent] via tailwindcss-scoped-preflight, but utility classes (.flex, .prose, .container, .max-w-none, .gap-2, .px-3, .text-sm, .border, etc) and component classes from the typography plugin (.prose) still ship unprefixed. When the bundle loads on a host page that also uses Tailwind, the bundle's class rules win on source order and visibly break host layout. The most common symptom is .prose snapping content to max-width: 65ch the moment the widget mounts. Switching to `@import "tailwindcss" prefix(dg)` namespaces every generated class under a dg: variant, so .flex becomes .dg\:flex, .prose becomes .dg\:prose, .max-w-none becomes .dg\:max-w-none, and so on. Class names in this package's components are updated to match (class="dg:flex dg:items-center" rather than class="flex items-center"). The scoped preflight plugin keeps doing its job for the universal selector reset. After this change the bundle ships: - 0 unprefixed Tailwind utility class rules (was 42 collisions with Fern docs alone, more with arbitrary host pages) - 353 prefixed .dg\: utility rules - 76 scoped :where([data-dg-agent], …) preflight rules - 33 .dg-* custom component classes (unchanged) Bundle size: 167.5 KB -> 188.9 KB (+21 KB) from the additional generated CSS now that Tailwind sees the prefixed class usages and emits rules for them. Previously these classes were silently dropped because they weren't matching the prefix-less convention. Refs: - https://tailwindcss.com/docs/styling-with-utility-classes#using-a-prefix - deepgram/agent#48 (the scoped preflight 0.1.1 work that this completes) - deepgram/dx-stack#4 (will gain a "scoping utilities, not just preflight" gotcha)
lukeocodes
added a commit
that referenced
this pull request
May 7, 2026
…ies (#50) ## Why [`@deepgram/ui@0.1.2`](https://www.npmjs.com/package/@deepgram/ui/v/0.1.2) (just published from [deepgram/ui#32](deepgram/ui#32)) namespaces every Tailwind utility class under a `dg:` prefix. The previous 0.1.1 release scoped Tailwind preflight to `[data-dg-agent]` but left utility classes (`.prose`, `.flex`, `.container`, `.max-w-none`, `.gap-2`, `.px-3`, `.text-sm`, etc) unprefixed. When the widget loads on a host page that also uses Tailwind, source order makes the bundle's class rules win and hijack host layout. The visible symptom is `.prose { max-width: 65ch }` snapping content narrow the moment the widget mounts. Until the widget bumps its dependency, the published UMD on `cdn.deepgram.com/widgets/` still ships unprefixed Tailwind utilities that bleed onto every host site embedding the widget. ## What changed - `packages/widget/package.json`: `@deepgram/ui` `^0.1.1` -> `^0.1.2` - `bun.lock` regenerated ## Verification Rebuilt the widget locally against `@deepgram/ui@0.1.2`: | | before (0.1.1) | after (0.1.2) | |---|---|---| | Unprefixed `.prose`, `.flex`, `.container`, `.max-w-none` rules | many (42 collisions vs Fern) | **0** | | Prefixed `.dg\:*` utility refs | 0 | **353** | | Scoped `:where([data-dg-agent], …)` preflight rules | 76 | **76** (unchanged) | | Bundle size | 387.5 KB | **393.5 KB** (+6 KB) | The +6 KB is real generated CSS that 0.1.1 was silently dropping because Tailwind couldn't see prefix-less class usages with prefix mode on. ## Expected after merge 1. release-please opens `chore(main): release agents-widget 0.1.5`. 2. Merging that PR bumps `packages/widget/package.json` to 0.1.5 and tags `agents-widget-v0.1.5`. 3. The npm publish workflow pushes `@deepgram/agents-widget@0.1.5` to npm. 4. The CDN publish job uploads the new UMD bundle to: - `https://cdn.deepgram.com/widgets/v0.1.5/widget.umd.js` (immutable, 365-day TTL) - `https://cdn.deepgram.com/widgets/latest/widget.umd.js` (5-min TTL plus invalidation) 5. Anyone loading either URL gets the prefixed bundle with no Tailwind utility leaks. ## Refs - [deepgram/ui#32](deepgram/ui#32) - the prefix(dg) fix - [#48](#48) - the scoped preflight 0.1.1 work that this completes - [deepgram/deepgram-docs#777](deepgram/deepgram-docs#777) - where the .prose narrowing was first observed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
@deepgram/ui@0.1.1(just published from deepgram/ui#27 + deepgram/ui#30) ships preflight scoped to[data-dg-agent]viatailwindcss-scoped-preflight. Until the widget bumps its dependency, the published UMD oncdn.deepgram.com/widgets/still ships unscoped Tailwind preflight that bleeds into host pages.Symptoms reported in deepgram/deepgram-docs#777: content width collapsed on every non-demo page on the docs site after the widget bundle finished loading. Same regression hits any customer embedding the widget on their own site.
What changed
packages/widget/package.json:@deepgram/ui^0.1.0→^0.1.1bun.lockregeneratedVerification
Rebuilt the widget locally against
@deepgram/ui@0.1.1:@layer base{*,:after,…}rules in widget UMD:where([data-dg-agent], …)scoped rules[data-dg-agent]occurrencesBundle size: 384.30 KB → 387.53 KB (+3.23 KB) from the added scope selectors. Acceptable trade.
Expected after merge
chore(main): release agents-widget 0.1.4.packages/widget/package.jsonto 0.1.4 and tagsagents-widget-v0.1.4.@deepgram/agents-widget@0.1.4to npm.https://cdn.deepgram.com/widgets/v0.1.4/widget.umd.js(immutable, 365-day TTL)https://cdn.deepgram.com/widgets/latest/widget.umd.js(5-min TTL plus invalidation)Refs