1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-06-26 10:36:19 +02:00
bitwarden-desktop/src/scss/vault.scss
Patrick H. Lauke 0396d682b1
Change links to buttons, expose aria-pressed for toggles, add aria-expanded to send view's "Options" (#1437)
* Change links to buttons, expose `aria-pressed` for toggles

- also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"`

* Correctly set aria-pressed

now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge

* Change more links to buttons, initial style changes

* Fix layout of <button> elements with .box-content-row

* Update jslib submodule

* Add `aria-expanded` to the send view's "Show options" expand/collapse control

* Fix position of "Edit" pencil when hovering over folders

* Update jslib

* Change sends list links to buttons

* Add `aria-pressed` to vault and send list buttons

Programmatically denote which of the buttons is currently active/shown in the right-most panel

* Fix incorrect "Options" expand/collapse button in add-edit view

Currently, that buttons lacks an accName because the "Options" text is outside of it.

* Add `aria-pressed` to the send left-hand column filters

* Simplify base, list, and vault styles

Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts.

* Remove unnecessary `position:relative`

Fixes issue with cut-off focus outlines, has no other adverse effect

* Fix styling for last child of action buttons

Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00

458 lines
7.5 KiB
SCSS

@import "variables.scss";
app-root {
display: flex;
flex-flow: column;
height: 100%;
}
#container {
height: 100%;
min-height: 0;
}
.vault {
height: 100%;
display: flex;
> .groupings,
> .items,
> .details,
> .logo {
display: flex;
flex-direction: column;
.inner-content {
padding: 10px 15px;
}
}
> .items {
order: 2;
}
> .details {
order: 3;
}
> .logo {
order: 4;
}
> .groupings {
order: 1;
width: 22%;
min-width: 175px;
max-width: 600px;
border-right: 1px solid #000000;
@include themify($themes) {
background-color: themed("backgroundColorAlt");
border-right-color: themed("borderColor");
}
.content {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-between;
.footer {
padding: 0;
}
.inner-content {
padding-bottom: 0;
padding-right: 5px;
user-select: none;
> ul,
> div > ul {
margin: 0 0 15px 0;
}
}
}
h2 {
text-transform: uppercase;
font-size: $font-size-base;
font-weight: normal;
margin-bottom: 5px;
@include themify($themes) {
color: themed("headingColor");
}
}
.heading {
display: flex;
button {
margin-left: auto;
background: none;
border: none;
@include themify($themes) {
color: themed("headingButtonColor");
}
&:hover,
&:focus {
cursor: pointer;
@include themify($themes) {
color: themed("headingButtonHoverColor");
}
}
}
}
ul:not(.bwi-ul) {
li {
margin: 0;
padding: 0;
list-style: none;
}
}
ul.bwi-ul {
li {
word-break: break-all;
.bwi-li {
top: 8px;
width: 1.1em;
}
}
}
// Nested indentions
ul.bwi-ul {
// Level 1
li {
> button {
padding-left: 12px;
}
.bwi-li {
left: -4px;
}
&.active > button .bwi-li {
left: 11px;
}
}
// Level 2
ul li {
> button {
padding-left: 23px;
}
.bwi-li {
left: 7px;
}
&.active > button .bwi-li {
left: 22px;
}
}
// Level 3
ul ul li {
> button {
padding-left: 34px;
}
.bwi-li {
left: 18px;
}
&.active > button .bwi-li {
left: 33px;
}
}
// Level 4
ul ul ul li {
> button {
padding-left: 45px;
}
.bwi-li {
left: 29px;
}
&.active > button .bwi-li {
left: 44px;
}
}
// Level 5
ul ul ul ul li {
> button {
padding-left: 56px;
}
.bwi-li {
left: 40px;
}
&.active > button .bwi-li {
left: 55px;
}
}
// Level 6
ul ul ul ul ul li {
> button {
padding-left: 67px;
}
.bwi-li {
left: 51px;
}
&.active > button .bwi-li {
left: 66px;
}
}
// Level 7
ul ul ul ul ul ul li {
> button {
padding-left: 78px;
}
.bwi-li {
left: 62px;
}
&.active > button .bwi-li {
left: 77px;
}
}
}
ul {
padding: 0;
margin: 0;
li {
button {
padding: 5px 0;
display: flex;
align-items: center;
width: 100%;
@include themify($themes) {
color: themed("textColor");
}
span {
visibility: hidden;
margin-left: auto;
@include themify($themes) {
color: themed("headingButtonColor");
}
&:hover,
&:focus {
@include themify($themes) {
color: themed("headingButtonHoverColor");
}
}
}
&:hover,
&:focus {
span {
visibility: visible;
}
}
}
&.active {
margin-left: -15px;
margin-right: -5px;
padding-left: 15px;
padding-right: 5px;
@include themify($themes) {
background-color: themed("groupingsActiveColor");
}
ul {
@include themify($themes) {
background-color: themed("backgroundColorAlt");
}
margin-left: -15px;
margin-right: -5px;
padding-left: 15px;
padding-right: 5px;
}
}
}
}
}
> .items {
width: 28%;
min-width: 200px;
max-width: 350px;
border-right: 1px solid #000000;
@include themify($themes) {
background-color: themed("backgroundColor");
border-right-color: themed("borderColor");
}
.no-items {
display: flex;
height: 100%;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
padding: 0 10px;
.no-items-image {
@include themify($themes) {
content: url("../images/search-desktop" + themed("svgSuffix"));
}
}
.bwi {
margin-bottom: 10px;
@include themify($themes) {
color: themed("disabledIconColor");
}
}
}
}
> .details {
flex: 1;
min-width: 0;
@include themify($themes) {
background-color: themed("backgroundColorAlt2");
}
.inner-content {
min-width: 400px;
}
.box {
max-width: 550px;
margin: 30px auto 0 auto;
&:first-child {
margin-top: 10px;
}
&:last-child {
margin-bottom: 30px;
}
}
> form {
display: flex;
flex-direction: column;
height: 100%;
}
}
> .logo {
flex: 1;
min-width: 0;
.content {
overflow-y: hidden;
overflow-x: auto;
}
.inner-content {
min-width: 320px;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
img {
width: 284px;
opacity: 0.3;
transition: all 1s ease-in-out;
&:hover {
opacity: 1;
}
}
}
.content {
flex: 1 1 auto;
position: relative;
overflow: auto;
height: 100%;
}
.footer {
height: 55px;
flex: 0 0 auto;
border-top: 1px solid #000000;
display: flex;
align-items: center;
padding: 0 15px;
@include themify($themes) {
background-color: themed("backgroundColorAlt");
border-top-color: themed("borderColor");
}
button {
margin-right: 10px;
&:last-child {
margin-right: 0;
}
}
.right {
margin-left: auto;
display: flex;
}
}
.nav {
height: 100%;
width: 100%;
display: flex;
.btn {
width: 100%;
font-size: $font-size-base * 0.8;
flex: 1;
border: 0;
border-radius: 0;
padding-bottom: 4px;
&:not(.active) {
@include themify($themes) {
background-color: themed("backgroundColorAlt");
}
}
i {
font-size: $font-size-base * 1.5;
display: block;
margin-bottom: 2px;
text-align: center;
}
}
}
}