-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Together with dani-garcia/bw_web_builds#180 this PR will add support for dynamic CSS changes. For example, we could hide the register link if signups are not allowed. In the future show or hide the SSO button depending on if it is enabled or not. There also is a special `user.vaultwarden.scss` file so that users can add custom CSS without the need to modify the default (static) changes. This will prevent future changes from not being applied and still have the custom user changes to be added. Also added a special redirect when someone goes directly to `/index.html` as that might cause issues with loading other scripts and files. Signed-off-by: BlackDex <[email protected]>
- Loading branch information
Showing
7 changed files
with
269 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
64 changes: 64 additions & 0 deletions
64
src/static/templates/scss/examples/user.vaultwarden.scss.hbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/**** START Custom User Changes ****/ | ||
|
||
/* Hide `Authenticator app` 2FA (First item of the list) */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(1) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide `YubiKey OTP security key` 2FA (Second item of the list) */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(2) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide `Duo` 2FA (Third item of the list) */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(3) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide `FIDO2 WebAuthn` 2FA (Fourth item of the list) */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(4) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide `Email` 2FA (Fifth item of the list) */ | ||
/* Note: This will also be hidden automatically if email is not enabled */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(5) { | ||
@extend %vw-hide; | ||
} | ||
|
||
|
||
/* Use a custom top left logo global */ | ||
bit-icon > svg { | ||
display: none !important; | ||
} | ||
bit-icon::before { | ||
display: block; | ||
content: "" !important; | ||
width: 175px !important; | ||
height: 30px !important; | ||
background-image: url(../images/my-custom-global-logo.png) !important; | ||
background-repeat: no-repeat !important; | ||
background-size: contain; | ||
} | ||
|
||
|
||
/* Use a custom top left logo different per vault/admin */ | ||
bit-icon > svg { | ||
display: none !important; | ||
} | ||
bit-icon::before { | ||
display: block; | ||
content: "" !important; | ||
width: 175px !important; | ||
height: 30px !important; | ||
background-repeat: no-repeat !important; | ||
background-size: contain; | ||
} | ||
app-user-layout bit-icon::before { | ||
background-image: url(../images/my-custom-password-manager-logo.png) !important; | ||
} | ||
app-organization-layout bit-icon::before { | ||
background-image: url(../images/my-custom-admin-console-logo.png) !important; | ||
} | ||
|
||
/**** END Custom User Changes ****/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/**** START Custom User Changes ****/ | ||
bit-icon > svg { | ||
display: none !important; | ||
} | ||
bit-icon::before { | ||
display: block; | ||
content: "" !important; | ||
width: 175px !important; | ||
height: 30px !important; | ||
background-repeat: no-repeat !important; | ||
background-size: contain; | ||
} | ||
|
||
app-user-layout bit-icon::before { | ||
background-image: url(../images/[email protected]) !important; | ||
} | ||
|
||
app-organization-layout bit-icon::before { | ||
background-image: url(../images/[email protected]) !important; | ||
} | ||
|
||
bit-layout .tw-bg-background-alt4, bit-layout .tw-bg-background-alt3 { | ||
background-color: rgb(var(--color-background-alt) / var(--tw-bg-opacity)) !important; | ||
} | ||
|
||
|
||
body, html { | ||
border: 2px solid red !important; | ||
} | ||
/**** END Custom User Changes ****/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/**** START Static Vaultwarden changes ****/ | ||
/* This combines all selectors extending it into one */ | ||
%vw-hide { | ||
display: none !important; | ||
} | ||
|
||
/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */ | ||
.vw-hide, | ||
head { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide the Subscription Page tab */ | ||
bit-nav-item[route="settings/subscription"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide any link pointing to Free Bitwarden Families */ | ||
a[href$="/settings/sponsored-families"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide the `Enterprise Single Sign-On` button on the login page */ | ||
a[routerlink="/sso"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide Two-Factor menu in Organization settings */ | ||
bit-nav-item[route="settings/two-factor"], | ||
a[href$="/settings/two-factor"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide Business Owned checkbox */ | ||
app-org-info > form:nth-child(1) > div:nth-child(3) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide the `This account is owned by a business` checkbox and label */ | ||
#ownedBusiness, | ||
label[for^="ownedBusiness"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide the radio button and label for the `Custom` org user type */ | ||
#userTypeCustom, | ||
label[for^="userTypeCustom"] { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide Business Name */ | ||
app-org-account form div bit-form-field.tw-block:nth-child(3) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide organization plans */ | ||
app-organization-plans > form > bit-section:nth-child(2) { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Hide Device Verification form at the Two Step Login screen */ | ||
app-security > app-two-factor-setup > form { | ||
@extend %vw-hide; | ||
} | ||
|
||
/* Replace the Bitwarden Shield at the top left with a Vaultwarden icon */ | ||
.bwi-shield:before { | ||
content: "" !important; | ||
width: 32px !important; | ||
height: 40px !important; | ||
display: block !important; | ||
background-image: url(../images/icon-white.png) !important; | ||
background-repeat: no-repeat; | ||
background-position-y: bottom; | ||
} | ||
/**** END Static Vaultwarden Changes ****/ | ||
|
||
/**** START Dynamic Vaultwarden Changes ****/ | ||
{{#if signup_disabled}} | ||
/* Hide the register link on the login screen */ | ||
app-frontend-layout > app-login > form > div > div > div > p { | ||
@extend %vw-hide; | ||
} | ||
{{/if}} | ||
|
||
{{#unless mail_enabled}} | ||
/* Hide Email 2FA if mail is not enabled */ | ||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(5) { | ||
@extend %vw-hide; | ||
} | ||
{{/unless}} | ||
/**** End Dynamic Vaultwarden Changes ****/ | ||
|
||
/**** Include a special user stylesheet for custom changes ****/ | ||
{{> scss/user.vaultwarden.scss }} |