warden-worker/public/css/vaultwarden.css
qaz741wsd856 929dadbb08 fix: restructure frontend asset handling and add UI overrides
- Updated `.gitignore` to reflect new directory structure for frontend assets under `public/web-vault/`.
- Modified `README.md` to include instructions for applying UI overrides and updated deployment notes.
- Adjusted `wrangler.toml` to point to the new asset directory.
- Updated GitHub workflows to remove large source maps to satisfy Cloudflare static asset per-file limits.
- Introduced `vaultwarden.css` for lightweight UI tweaks and added a script to apply these overrides during deployment.
- Updated deployment documentation to reflect changes in asset management and optional UI customization.
2025-12-28 16:51:25 +00:00

75 lines
2.8 KiB
CSS

/*
Vaultwarden compatibility stylesheet for Bitwarden Web Vault.
Design goals:
- Only perform UI hiding/patching needed for "lightweight self-use" projects to avoid confusion from unsupported features.
- Not dynamically generated during Worker runtime (saves Cloudflare Worker CPU/request quotas).
Usage:
- After CI/CD or local download of bw_web_builds and extraction, keep `public/web-vault/` as the static resource root directory.
- Run: `bash scripts/apply-web-vault-overrides.sh public/web-vault`
which will copy this file (public/css/vaultwarden.css) to `public/web-vault/css/vaultwarden.css`.
Switch description (build-time):
- Registration button hiding: The script decides whether to append CSS hiding registration entries based on the environment variable `DISABLE_USER_REGISTRATION`
(hidden by default; only not hidden when "false"),
consistent with backend `src/handlers/config.rs` logic.
*/
/* Hide unsupported UI elements */
.vw-hide,
bit-nav-item[route="settings/subscription"],
a[href$="/settings/sponsored-families"],
/* SSO UI (newer builds, if present) */
.vw-email-sso,
.vw-sso-login,
.vw-or-text,
.vw-other-login,
/* Passkey/WebAuthn login UI (newer builds, if present) */
.vw-passkey-login,
/* Legacy selectors for older web vault builds (< 2025.5.1) */
app-root ng-component > form > div:nth-child(1) > div > button[buttontype="secondary"].\!tw-text-primary-600:nth-child(4),
app-root ng-component > form > div:nth-child(1) > div > button[buttontype="secondary"].\!tw-text-primary-600:nth-child(3),
app-root ng-component > form > div:nth-child(1) > div:nth-child(3) > div:nth-child(2),
/* Org-related / enterprise UI */
app-organization-plans > form > bit-section:nth-child(2),
app-org-account form.ng-untouched:nth-child(5),
app-org-reports-home > app-report-list > div.tw-inline-grid > div:nth-child(6),
bit-dialog div.tw-ml-4:has(bit-form-control input),
bit-dialog div.tw-col-span-4:has(input[formcontrolname*="access"], input[formcontrolname*="manage"]),
/* Device verification / protection UI (not supported) */
app-security > app-two-factor-setup > form,
app-user-layout app-danger-zone button:nth-child(1),
/* Two-factor providers (hide unsupported ones; keep authenticator/TOTP visible) */
.providers-2fa-1,
.providers-2fa-3,
.providers-2fa-7,
/* Emergency access & Sends (not supported) */
bit-nav-item[route="settings/emergency-access"],
bit-nav-item[route="sends"],
/* Passkey settings (not supported) */
app-user-layout app-password-settings app-webauthn-login-settings {
display: none !important;
}
/* Change collapsed menu icon to Vaultwarden */
bit-nav-logo bit-nav-item a:before {
content: "";
background-image: url("../images/icon-white.svg");
background-repeat: no-repeat;
background-position: center center;
height: 32px;
display: block;
}
bit-nav-logo bit-nav-item .bwi-shield {
display: none !important;
}