Skip to content

Commit f05bbe7

Browse files
authored
use yivi-web minimal mode, remove QR style overrides (#45)
Use the new minimal: true option from yivi-web which renders only the QR code and animations without the form wrapper. This removes ~80 lines of CSS overrides that were fighting yivi-css styles.
1 parent 1a21aa6 commit f05bbe7

3 files changed

Lines changed: 1 addition & 65 deletions

File tree

src/lib/components/filesharing/YiviQRCode.svelte

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,6 @@
5858
</div>
5959

6060
<style>
61-
/*
62-
* Reset all Yivi plugin CSS, but preserve the styles of Yivi's animation elements.
63-
* Animation elements (phone, checkmark, etc.) rely on their Yivi CSS rules for
64-
* colour, size, and keyframe animations — stripping them would break the visuals.
65-
*/
66-
.yivi-qr-container :global(*:not(
67-
.yivi-web-waiting-for-user-animation,
68-
.yivi-web-checkmark-animation,
69-
.yivi-web-forbidden-animation,
70-
.yivi-web-clock-animation
71-
)) {
72-
all: revert !important;
73-
box-shadow: none !important;
74-
margin: 0 !important;
75-
padding: 0 !important;
76-
border: none !important;
77-
background: transparent !important;
78-
}
79-
80-
.yivi-qr-container :global(.yivi-web-content) {
81-
min-width: 0px !important;
82-
}
83-
8461
.yivi-qr-container {
8562
width: 250px;
8663
height: 250px;
@@ -95,7 +72,6 @@
9572
}
9673
9774
.yivi-qr-container.responsive {
98-
/* width: 100%; */
9975
height: auto;
10076
min-height: 200px;
10177
}
@@ -106,40 +82,6 @@
10682
height: auto !important;
10783
}
10884
109-
/*
110-
* Hide everything except the QR canvas/svg and Yivi's post-scan animation states
111-
* (waiting-for-user, success, cancelled, timeout/error).
112-
* The :has() selectors ensure ancestor divs of visible content are also shown.
113-
*/
114-
.yivi-qr-container :global(:not(
115-
canvas, svg,
116-
div:has(canvas), div:has(svg),
117-
.yivi-web-waiting-for-user-animation,
118-
.yivi-web-checkmark-animation,
119-
.yivi-web-forbidden-animation,
120-
.yivi-web-clock-animation,
121-
div:has(.yivi-web-waiting-for-user-animation),
122-
div:has(.yivi-web-checkmark-animation),
123-
div:has(.yivi-web-forbidden-animation),
124-
div:has(.yivi-web-clock-animation)
125-
)) {
126-
display: none !important;
127-
}
128-
129-
.yivi-qr-container :global(div:has(> canvas)),
130-
.yivi-qr-container :global(div:has(> svg)) {
131-
display: flex !important;
132-
justify-content: center;
133-
align-items: center;
134-
}
135-
136-
.yivi-qr-container :global(canvas),
137-
.yivi-qr-container :global(svg) {
138-
display: block !important;
139-
image-rendering: pixelated !important;
140-
image-rendering: crisp-edges !important;
141-
}
142-
14385
.spinner {
14486
animation: spin 1s linear infinite;
14587
color: var(--pg-text-secondary);

src/lib/global.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,7 @@ h3 {
353353
}
354354
}
355355

356-
.yivi-web-content,
357-
.yivi-web-form {
358-
min-width: 0 !important;
359-
}
360356

361-
#crypt-irma-qr {
362-
min-height: 0;
363-
}
364357

365358

366359
/* ── Utility classes (from shared-styles.css) ───────────────────────── */

src/lib/yivi-tools.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ async function RetrieveSignKeys(pub: AttributeCon, priv?: AttributeCon): Promise
7070
// Always use YiviWeb: it handles QR rendering on desktop
7171
// and deep link generation on mobile.
7272
yiviConfig.element = '#crypt-irma-qr'
73+
yiviConfig.minimal = true
7374

7475
const yivi = new YiviCore(yiviConfig)
7576

0 commit comments

Comments
 (0)