Widget Components

Widget Components

Reusable widget atoms are defined in tryvio-theme.css (shopify-app/extensions/tryvio-theme/assets/tryvio-theme.css).

Reuse rule: always use the existing class. If you copy a style a second time, extract a shared class instead. See CLAUDE.md “Reuse, don’t reinvent”.

Related: Widget States · Try-On Pipeline.


Glass panel — .tryvio-modal__panel

Two visual modes depending on context.

ModeStatesBackgroundBackdropWidthPadding
A — frosted glassconsent / limit / upload / camera / previewrgba(255,255,255,.92)blur(36px) saturate(1.4)min(500px, 100%)1rem
B — full-bleed media (“premium”)result / mediatransparentnonemin(560px, …)0

Box shadow (mode A): 0 2px 0 0 rgba(255,255,255,.5) inset, 0 24px 80px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04). Border-radius: 24px. Entrance animation: ttn-panel-in.

⚠️

Duplication.tryvio-modal__panel has two top-level definitions in tryvio-theme.css (lines ~179 and ~1756). Mode B overrides mode A for result/media states.


Close (X) — .tryvio-modal__close

Circle button, 2 rem × 2 rem. Positioned absolute top: .72rem; right: .72rem.

PropertyDefaultResult-state override
Backgroundrgba(0,0,0,.05)Solid high-contrast (visible over result images)
Colorrgba(0,0,0,.45)High-contrast
Hover scale1.08same

The email-capture panel has its own size override (34px × 34px, top: 14px; right: 14px).

⚠️

Duplication.tryvio-modal__close has three top-level definitions (~206, ~1413, ~1811) plus the email-capture override (~246). Top candidate for unification into a single shared class (e.g. .tryvio-x-btn as the CLAUDE.md guideline suggests).


Buttons — .tryvio-modal__btn

Base class shared by all action buttons.

PropertyValue
Border-radius14px
Padding.72rem 1rem
Font size / weight.84rem / 600
Min-height48px
Hover transformtranslateY(-.5px)
Disabled opacity0.4

Variants

ClassBackgroundColorNotes
--primary#111827whiteShadow: 0 8px 24px rgba(0,0,0,.18)
--ghostrgba(255,255,255,.72)rgba(15,23,42,.68)Used for secondary actions
--cart#111827whiteLighter shadow than --primary
⚠️

Duplication.tryvio-modal__btn base is defined twice (~1122, ~2067). --cart is nearly identical to --primary; merge is safe.


Tabs — .tryvio-modal__tabs / .tryvio-modal__tab

Used on the capture screen (Upload / Camera).

ElementKey values
.tryvio-modal__tabs trackbackground: rgba(15,23,42,.05); border-radius: 14px; padding: .2rem; padding-right: 2.9rem
.tryvio-modal__tabborder-radius: 11px; color: rgba(15,23,42,.42); font-size: .84rem; font-weight: 600; min-height: 38px
.tryvio-modal__tab--activebackground: #ffffff; color: #111827; box-shadow: 0 8px 18px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.04)
⚠️

Duplication.tryvio-modal__tabs has two top-level definitions (~288, ~1767).


Camera controls

ClassSizeColor / styleNotes
.tryvio-modal__capture52px#ff3b30 fill; 3.5px white ringShutter button, iOS-style
.tryvio-modal__switch40pxrgba(0,0,0,.06)Switch front/back camera
.tryvio-modal__mirror-toggle34pxActive: rgba(0,122,255,.16) bg / #007aff iconMirror toggle

Logo chip — .tryvio-modal__media-brand

Positioned absolute top: 26px; left: 22px. Size: 38px × 38px. border-radius: 14px. Glass background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.16)), rgba(255,255,255,.12). backdrop-filter: blur(20px) saturate(1.18). Inset highlight: inset 0 1px 0 rgba(255,255,255,.42). pointer-events: none.

Asset: tryvio-logo-icon.png (icon only). Full wordmark: tryvio-logo.svg.


Dropzone — .tryvio-modal__dropzone

ClassState / use
.tryvio-modal__dropzoneDefault empty upload area; dashed border
.tryvio-modal__dropzone-label”Drop photo here or click to browse”
.tryvio-modal__dropzone-hint”JPG, PNG, WebP or iPhone photos · Max 25MB”
.tryvio-modal__dropzone--dragoverApplied while a file is dragged over the zone
.tryvio-modal__dropzone--loadingApplied while the selected file is being read

Loading bar — .tryvio-modal__loading

ClassRole
.tryvio-modal__loadingWrapper (absolute overlay on the panel)
.tryvio-modal__loading-trackFull-width progress track
.tryvio-modal__loading-fillAnimated fill; width driven by percent
.tryvio-modal__loading-text”Analyzing your photo…”
.tryvio-modal__loading-estimate”Usually takes 30 to 90 seconds.”
.tryvio-modal__loading-percentNumeric percent value

Known duplications (cleanup targets)

🚫

The following classes have multiple conflicting top-level definitions in tryvio-theme.css. Consolidating them will reduce specificity surprises and simplify future changes.

ClassCountRecommended action
.tryvio-modal__close3 top-level + email-capture overrideUnify into one rule; use data-attribute or modifier for size variants
.tryvio-modal__panel2Keep one base definition; use a modifier (e.g. --media) for mode B
.tryvio-modal__tabs2Merge into one definition
.tryvio-modal__btn2Merge base into one; keep variants as-is
.tryvio-modal__btn--cartDuplicates --primaryExtend --primary or alias

A live visual reference of the components (links the real CSS without a deploy) exists at shopify-app/playwright-debug/mockups/component-guidelines.html — dev artifact only.