0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-02 14:24:19 +01:00
Bootstrap/site/assets/scss/_masthead.scss
Patrick H. Lauke d5f4532b3e
Docs: fix overflow:auto horizontal scrollbars covering last line of code blocks (#37694)
* Add dirty hack for Firefox

* Disable stylelint check for function-url-quotes

to make the hack go through unchallenged

* Make the fix across all browsers

It's not just Firefox - same issue can be seen (though slightly less horrible looking) on macOS / Chrome etc

* Tweak padding, move clipboard button down slightly

* Further CSS tweaks

Forcing `overflow: overlay` should normalise behaviour between Chrome/Win and other implementations. While visually the Chrome/Win scrollbar still looks big and ugly, its height/spacing is now taken into account as being part of the content, so styles can be applied consistently with extra padding at the bottom

* Linting fixes

* Linting fixes

* Apply suggestions from code review

---------

Co-authored-by: Mark Otto <markd.otto@gmail.com>
2023-03-04 12:05:54 -08:00

117 lines
2.6 KiB
SCSS

.bd-masthead {
--bd-pink-rgb: #{to-rgb($pink)};
padding: 3rem 0;
// stylelint-disable
background-image: linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), .01), rgba(var(--bs-body-bg-rgb), 1) 85%),
radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), .5), transparent 50%),
radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), .5), transparent 50%),
radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), .5), transparent 50%),
radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), .5), transparent 50%);
// stylelint-enable
h1 {
@include font-size(4rem);
}
.lead {
@include font-size(1rem);
font-weight: 400;
color: var(--bs-secondary-color);
}
.bd-code-snippet {
margin: 0;
@include border-radius(.5rem);
}
.highlight {
width: 100%;
padding: .5rem 1rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: rgba(var(--bs-body-color-rgb), .075);
@include border-radius(.5rem);
@include media-breakpoint-up(lg) {
padding-right: 4rem;
}
pre {
padding: 0;
margin-top: .625rem;
margin-right: 1.875rem;
margin-bottom: .625rem;
overflow: hidden;
}
}
.btn-clipboard {
position: absolute;
top: -.625rem;
right: 0;
background-color: transparent;
}
#carbonads { // stylelint-disable-line selector-max-id
margin-inline: auto;
}
@include media-breakpoint-up(md) {
.lead {
@include font-size(1.5rem);
}
}
}
.masthead-followup {
.lead {
@include font-size(1rem);
}
.highlight {
@include border-radius(.5rem);
}
@include media-breakpoint-up(md) {
.lead {
@include font-size(1.25rem);
}
}
}
.masthead-followup-icon {
padding: 1rem;
color: rgba(var(--bg-rgb), 1);
background-color: rgba(var(--bg-rgb), .1);
background-blend-mode: multiple;
@include border-radius(1rem);
mix-blend-mode: darken;
svg {
filter: drop-shadow(0 1px 1px var(--bs-body-bg));
}
}
.masthead-notice {
background-color: var(--bd-accent);
box-shadow: inset 0 -1px 1px rgba(var(--bs-body-color-rgb), .15), 0 .25rem 1.5rem rgba(var(--bs-body-bg-rgb), .75);
}
.animate-img {
> img {
transition: .2s ease-in-out transform; // stylelint-disable-line property-disallowed-list
}
&:hover > img {
transform: scale(1.1);
}
}
@if $enable-dark-mode {
[data-bs-theme="dark"] {
.masthead-followup-icon {
mix-blend-mode: lighten;
}
}
}