-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(preset-shiny): Style updates and nudges #998
Conversation
To align R and Python implementation a bit more
Should update again after rstudio/bslib#998 is merged
|
||
:root { | ||
// Controls default spacing in layout containers (e.g, layout_columns()) | ||
--bslib-spacer: #{$spacer}; | ||
--bslib-spacer: #{$bslib-spacer}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm tempted to rename this --bslib-gap-spacer
but that's definitely too big of a change for right now. In general, though, I think we should be careful moving forward to use this variable for adjusting spacing between elements.
I know I used it in some sidebar CSS (that I've adjusted in this PR) for something other than inner-item spacing. I don't think there are remaining places where this happens, but I did want to call it out for future reference.
inst/builtin/bs5/shiny/_rules.scss
Outdated
@@ -104,6 +108,10 @@ $bslib-checkbox-radio-margin-right: 0.35em !default; | |||
.bslib-card-box-shadow-none { | |||
--bslib-card-box-shadow: none; | |||
} | |||
|
|||
.popover { | |||
box-shadow: var(--#{$prefix}box-shadow-sm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should inherit from card shadow box?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good thought, but we want popovers to always use the small shadow box. Also the --bslib-card-box-shadow
is unset at nested levels and we'd want to keep shadows on popovers in all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you about always using the small shadow box, @gadenbuie. I did a little test to see what the other shadows would look like, and a nice thing is that it didn't bother me as much as I thought it would:
Small:
Medium:
Large:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...Nice that it isn't an aesthetically breaking change if someone accidentally does that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like the larger shadow for the popover, since popovers appear on top of all other UI elements, so they're sort of "closer" to the viewer than the rest of the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly concerned that this decision will look weird/inconsistent in practice since a somewhat arbitrary set of things will have 1rem vs 1.5rem spacing. Is the motivation for increasing mainly just for spacing in the main content area of a |
Agreed, which is why I mentioned that There is one place I should check, which is in the
Yes that but also in |
Should update again after rstudio/bslib#998 is merged
I looked into this enough to determine that it's the fault of the |
…and no borders that are restored for nested cards/value boxes
@gregswinehart and I talked and decided to use the lower-key shadows and take away borders on top-level cards and value boxes, adding them back for nested cards/value boxes or under the |
I'll fill out this description with screenshots Monday, in the mean time, here's a tl;dr. These mostly affect only the
preset="shiny"
theme:$box-shadow-sm
$box-shadow-sm
to popovers (previously unshadowed)$bslib-spacer
that defaults to$spacer
, so that we can change--bslib-spacer
without affecting Bootstrap spacing.$bslib-spacer
for the shiny preset to1.5rem
. This lets most things breathe a bit more and ensures that spacing between elements in a sidebar layout match the padding in the main and sidebar areas. This did require separating one or two things from--bslib-spacer
that were using it as a stand-in for1rem
.page_sidebar()
now matchespage_navbar()
exactly by using similar markup and.navbar
classes to wrap thetitle
element.Sidebar Page
Navbar Page