-
Notifications
You must be signed in to change notification settings - Fork 4
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
Formalize location of Bootstrap variables and settings #32
Comments
@cscheid I hope you don't mind; I implemented the above behavior in quarto-dev/quarto-cli#11108 |
I don't mind at all. It's a longer PR so the review will take me a bit of time to think it through. |
@cscheid I alluded to this in the quarto PR, but this was part of the design documentation here: https://connect.posit.it/brand-yml/brand/color.html#additional-color-features. I'm working on cleaning up the docs now and this part will be clearer when we trim down to "just the implementation" and remove some of the design exploration.
|
Great, thank you! |
We talked about this internally, but E.g. instead of defaults:
bootstrap:
enable-rounded: false
link-decoration: none this would work defaults:
bootstrap:
defaults:
enable-rounded: false
link-decoration: none
rules: |
h2 { color: pink } |
Currently, Quarto passes
color.palette
directly to Sass as Sass variables. This is certainly helpful; it means that users can do things like thisHowever, it's problematic for a few reasons:
I don't like the blending of concerns; this opens the door for
color.palette
to hold information that isn't about the actual color palette, which will be confusing to people using brand via the Python or R packages.I anticipate some changes to behavior for
color
in the Python and R packages that will specifically assume these values are colors. The biggest is that we plan to turn values incolor.palette
into$brand-{name}: {color}
Sass (and CSS variables).I can also see adding utilities that will make a strong assumption that these values point to colors, e.g. using libraries to manipulate colors in R or Python.
Finally, a smaller issue is that the type checking of
color.palette
requires values be strings, which means we needenable-rounded: "false"
instead ofenable-rounded: false
.I propose that we consolidate on a common place to pass variables to Bootstrap that can be picked up by both Shiny and Quarto:
default.bootstrap
. (This would also be useful for pkgdown, rmarkdown and more.) We'd reservedefault.bootstrap.version
to track required version (as a major version value, i.e. currently defaulting to 5). All other variables would be passed into the defaults layer.The above example would become
Notice that a general principle of
defaults
is that once you're adding settings there, you're clearly targeting a specific output. So we can directly use Sass variables rather than relying on the color substitution we do incolor
andtypography
. Having a consistent pattern for accessing the brand color palette meansdefaults.bootstrap.navbar-bg
can directly use$brand-charcoal-black
.The text was updated successfully, but these errors were encountered: