Skip to content

Commit c4ef423

Browse files
gadenbuiecpsievert
andauthored
feat: Improve notification styles (#3913)
Co-authored-by: gadenbuie <[email protected]> Co-authored-by: Carson <[email protected]> Co-authored-by: cpsievert <[email protected]>
1 parent ce78d0d commit c4ef423

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
* Updated `selectizeInput()`'s selectize.js dependency from v0.12.4 to v0.15.2. In addition to many bug fixes and improvements, this update also adds several new [plugin options](https://selectize.dev/docs/demos/plugins). (#3875)
66

7-
* Shiny's CSS styling for things like `showNotification()`, `withProgress()`, `inputPanel()`, etc., now looks better with `{bslib}`'s upcoming CSS-only dark mode. (#3882)
7+
* Shiny's CSS styling (for things like `showNotification()`, `withProgress()`, `inputPanel()`, etc.), has been updated with `{bslib}`'s upcoming CSS-only dark mode feature in mind. (#3882, #3914)
88

9-
* Shiny's Sass variables are now set specifically for major versions of Bootstrap. Bootstrap versions 3 and 4 are unaffected by this change, and the Bootstrap 5 variables now target Bootstrap 5.3 to take advantage of Bootstrap's dark mode and client-side theming via CSS variables. (#3914)
9+
* Default styles for `showNotification()` were tweaked slightly to improve accessibility, sizing, and padding. (#3913)
1010

1111
## Bug fixes
1212

inst/www/shared/shiny.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny_scss/shiny.scss

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $notification-bg-color: #e8e8e8 !default;
1313
$notification-color: #333 !default;
1414
$notification-border: 1px solid #ccc !default;
1515
$notification-border-radius: 3px !default;
16-
$notification-padding: 10px 8px 10px 10px !default;
16+
$notification-padding: 10px 2rem 10px 10px !default;
1717
$notification-message-bg: #d9edf7 !default;
1818
$notification-message-color: #31708f !default;
1919
$notification-message-border: 1px solid #bce8f1 !default;
@@ -390,18 +390,19 @@ html.autoreload-enabled #shiny-disconnected-overlay.reloading {
390390
right: 0;
391391
background-color: rgba(0,0,0,0);
392392
padding: 2px;
393-
width: 250px;
393+
width: 300px;
394394
z-index: 99999;
395395
}
396396

397397
.shiny-notification {
398+
position: relative;
398399
background-color: $notification-bg-color;
399400
color: $notification-color;
400401
border: $notification-border;
401402
@include border-radius-shim($notification-border-radius);
402403
opacity: 0.85;
403404
padding: $notification-padding;
404-
margin: 2px;
405+
margin: 5px;
405406
&-message {
406407
color: $notification-message-color;
407408
background-color: $notification-message-bg;
@@ -418,17 +419,23 @@ html.autoreload-enabled #shiny-disconnected-overlay.reloading {
418419
border: $notification-error-border;
419420
}
420421
&-close {
421-
float: right;
422-
font-weight: bold;
423-
font-size: 18px;
424-
bottom: 9px;
425-
position: relative;
426-
padding-left: 4px;
422+
position: absolute;
423+
width: 2rem;
424+
height: 2rem;
425+
top: 0;
426+
right: 0;
427+
display: flex;
428+
align-items: center;
429+
justify-content: center;
430+
font-weight: normal;
431+
font-size: 1.125em;
432+
padding: 0.25rem;
427433
color: $notification-close-color;
428-
cursor: default;
434+
cursor: pointer;
429435
}
430436
&-close:hover {
431437
color: $notification-close-hover-color;
438+
font-weight: bold;
432439
}
433440
&-content-action a {
434441
color: $notification-content-action-color;

0 commit comments

Comments
 (0)