Skip to content

Commit

Permalink
Break messageBar class out
Browse files Browse the repository at this point in the history
Move .messageBar out of .dialog into its own standalone class in order to reuse as much of it for the upcoming feature for an undo message for annotations.
  • Loading branch information
ryzokuken committed Oct 8, 2024
1 parent e25832c commit 0f0ecaa
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 94 deletions.
94 changes: 0 additions & 94 deletions web/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@
}

.messageBar {
--message-bar-warning-icon: url(images/messageBar_warning.svg);
--closing-button-icon: url(images/messageBar_closingButton.svg);

--message-bar-bg-color: #ffebcd;
--message-bar-fg-color: #15141a;
--message-bar-border-color: rgb(0 0 0 / 0.08);
Expand Down Expand Up @@ -308,98 +305,7 @@
--message-bar-close-button-color-hover: HighlightText;
}

display: flex;
position: relative;
padding: 12px 8px 12px 0;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 8px;
align-self: stretch;

border-radius: 4px;
border: 1px solid var(--message-bar-border-color);
background: var(--message-bar-bg-color);
color: var(--message-bar-fg-color);

> div {
display: flex;
padding-inline-start: 16px;
align-items: flex-start;
gap: 8px;
align-self: stretch;

&::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
mask-image: var(--message-bar-warning-icon);
mask-size: cover;
background-color: var(--message-bar-icon-color);
}

> div {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
flex: 1 0 0;

.title {
font-size: 13px;
font-weight: 590;
}

.description {
font-size: 13px;
}
}
}

.closeButton {
position: absolute;
width: 32px;
height: 32px;
inset-inline-end: 8px;
inset-block-start: 8px;
background: none;
border-radius: var(--message-bar-close-button-border-radius);
border: var(--message-bar-close-button-border);

&::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
mask-image: var(--closing-button-icon);
mask-size: cover;
background-color: var(--message-bar-close-button-color);
}

&:is(:hover, :active, :focus)::before {
background-color: var(--message-bar-close-button-color-hover);
}

&:hover {
background-color: var(--message-bar-close-button-hover-bg-color);
}

&:active {
background-color: var(--message-bar-close-button-active-bg-color);
}

&:focus {
background-color: var(--message-bar-close-button-focus-bg-color);
}

> span {
display: inline-block;
width: 0;
height: 0;
overflow: hidden;
}
}
}

.toggler {
Expand Down
119 changes: 119 additions & 0 deletions web/message_bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.messageBar {
--message-bar-warning-icon: url(images/messageBar_warning.svg);
--closing-button-icon: url(images/messageBar_closingButton.svg);

display: flex;
position: relative;
padding: 12px 8px 12px 0;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 8px;
align-self: stretch;

border-radius: 4px;

border: 1px solid var(--message-bar-border-color);
background: var(--message-bar-bg-color);
color: var(--message-bar-fg-color);

> div {
display: flex;
padding-inline-start: 16px;
align-items: flex-start;
gap: 8px;
align-self: stretch;

&::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
mask-image: var(--message-bar-warning-icon);
mask-size: cover;
background-color: var(--message-bar-icon-color);
}

> div {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
flex: 1 0 0;

.title {
font-size: 13px;
font-weight: 590;
}

.description {
font-size: 13px;
}
}
}

.closeButton {
position: absolute;
width: 32px;
height: 32px;
inset-inline-end: 8px;
inset-block-start: 8px;
background: none;
border-radius: var(--message-bar-close-button-border-radius);
border: var(--message-bar-close-button-border);

&::before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
mask-image: var(--closing-button-icon);
mask-size: cover;
background-color: var(--message-bar-close-button-color);
}

&:is(:hover, :active, :focus)::before {
background-color: var(--message-bar-close-button-color-hover);
}

&:hover {
background-color: var(--message-bar-close-button-hover-bg-color);
}

&:active {
background-color: var(--message-bar-close-button-active-bg-color);
}

&:focus {
background-color: var(--message-bar-close-button-focus-bg-color);
}

> span {
display: inline-block;
width: 0;
height: 0;
overflow: hidden;
}
}
}

#undoAnnotationDeleteMessage {
--message-bar-bg-color: #DEEAFC;
--message-bar-fg-color: #15141a;
--message-bar-border-color: rgb(0 0 0 / 0.08);
--message-bar-icon-color: #cd411e;
--message-bar-close-button-border-radius: 4px;
--message-bar-close-button-border: none;
--message-bar-close-button-color: var(--text-primary-color);
--message-bar-close-button-hover-bg-color: rgb(21 20 26 / 0.14);
--message-bar-close-button-active-bg-color: rgb(21 20 26 / 0.21);
--message-bar-close-button-focus-bg-color: rgb(21 20 26 / 0.07);
--message-bar-close-button-color-hover: var(--text-primary-color);

/* hacks */
position: fixed;
bottom: 100px;
width: 400px;
left: 50%;
transform: translateX(-50%);
}
1 change: 1 addition & 0 deletions web/pdf_viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import url(text_layer_builder.css);
@import url(annotation_layer_builder.css);
@import url(xfa_layer_builder.css);
@import url(message_bar.css);
/* Ignored in GECKOVIEW builds: */
@import url(annotation_editor_layer_builder.css);

Expand Down

0 comments on commit 0f0ecaa

Please sign in to comment.