0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-30 22:52:24 +01:00

Cleanup algolia theming (#29888)

This commit is contained in:
Martijn Cuppens 2019-12-25 21:08:15 +01:00 committed by GitHub
parent 31e69475d8
commit b39f704954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 93 additions and 154 deletions

View File

@ -1,155 +1,99 @@
// stylelint-disable declaration-no-important // Docsearch theming
// Docsearch overrides
//
// `!important` indicates overridden properties.
.algolia-autocomplete { .algolia-autocomplete {
display: block !important;
flex: 1;
// Menu container
.ds-dropdown-menu {
width: 100%; width: 100%;
min-width: 0 !important; }
max-width: none !important;
padding: .75rem 0 !important; .ds-dropdown-menu {
background-color: $white; width: 100%;
background-clip: padding-box; padding: $dropdown-padding-y 0;
border: 1px solid rgba(0, 0, 0, .1); margin: $dropdown-spacer 0 0;
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); @include font-size(.875rem);
background-color: $dropdown-bg;
border: $dropdown-border-width solid $dropdown-border-color;
@include border-radius($dropdown-border-radius);
@include box-shadow($dropdown-box-shadow);
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
width: 175%; // stylelint-disable declaration-no-important
right: 0 !important; // Override inline style
left: auto !important; // Override inline style
// stylelint-enable declaration-no-important
width: 400px;
}
}
.algolia-docsearch-suggestion--category-header {
padding: .125rem 1rem;
font-weight: 600;
color: $bd-purple-bright;
// stylelint-disable-next-line selector-class-pattern
:not(.algolia-docsearch-suggestion__main) > & {
display: none;
} }
// Caret .ds-suggestion:not(:first-child) & {
&::before { padding-top: .75rem;
display: none !important; margin-top: .75rem;
border-top: 1px solid rgba(0, 0, 0, .1);
} }
}
[class^="ds-dataset-"] { .algolia-docsearch-suggestion--content {
padding: 0 !important; padding: .25rem 1rem;
overflow: visible !important;
background-color: transparent !important;
border: 0 !important;
}
.ds-suggestions { .ds-cursor & {
margin-top: 0 !important; background-color: rgba($bd-purple-light, .2);
}
} }
}
.algolia-docsearch-suggestion { .algolia-docsearch-suggestion {
padding: 0 !important; display: block;
overflow: visible !important;
}
.algolia-docsearch-suggestion--category-header { &:hover {
padding: .125rem 1rem !important; text-decoration: none;
margin-top: 0 !important;
@include font-size(.875rem !important);
font-weight: 600 !important;
color: $bd-purple-bright !important;
border-bottom: 0 !important;
} }
}
.algolia-docsearch-suggestion--wrapper { .algolia-docsearch-suggestion--subcategory-column {
float: none !important; display: none;
padding-top: 0 !important; }
}
// Section header .algolia-docsearch-suggestion--subcategory-inline {
.algolia-docsearch-suggestion--subcategory-column { display: inline;
float: none !important;
width: auto !important;
padding: 0 !important;
text-align: left !important;
}
.algolia-docsearch-suggestion--subcategory-inline {
display: block !important;
@include font-size(.875rem);
color: $gray-700; color: $gray-700;
&::after { &::after {
padding: 0 .25rem; padding: 0 .25rem;
content: "/"; content: "/";
} }
} }
.algolia-docsearch-suggestion--content { .algolia-docsearch-suggestion--title {
display: flex; display: inline;
flex-wrap: wrap; font-weight: 500;
float: none !important; color: $gray-800;
width: 100% !important; }
padding: .25rem 1rem !important;
.algolia-docsearch-suggestion--text {
// Vertical divider between column header and content color: $gray-800;
&::before { @include font-size(.75rem);
display: none !important; }
}
} .algolia-docsearch-suggestion--highlight {
color: $purple;
.ds-suggestion { background-color: rgba($purple, .1);
&:not(:first-child) { }
.algolia-docsearch-suggestion--category-header {
padding-top: .75rem !important; .algolia-docsearch-footer {
margin-top: .75rem !important; padding: .5rem 1rem 0;
border-top: 1px solid rgba(0, 0, 0, .1); margin-top: .625rem;
} @include font-size(.75rem);
} color: $gray-600;
border-top: 1px solid rgba(0, 0, 0, .1);
.algolia-docsearch-suggestion--subcategory-column { }
display: none !important;
} .algolia-docsearch-footer--logo {
} color: inherit;
.algolia-docsearch-suggestion--title {
display: block;
margin-bottom: 0 !important;
@include font-size(.875rem !important);
font-weight: 400 !important;
}
.algolia-docsearch-suggestion--text {
flex: 0 0 100%;
max-width: 100%;
padding: .2rem 0;
@include font-size(.8125rem !important);
font-weight: 400;
line-height: 1.25 !important;
color: $gray-600;
}
.algolia-docsearch-footer {
float: none !important;
width: auto !important;
height: auto !important;
padding: .75rem 1rem 0;
@include font-size(.75rem !important);
line-height: 1 !important;
color: $gray-600 !important;
border-top: 1px solid rgba(0, 0, 0, .1);
}
.algolia-docsearch-footer--logo {
display: inline !important;
overflow: visible !important;
color: inherit !important;
text-indent: 0 !important;
background: none !important;
}
.algolia-docsearch-suggestion--highlight {
color: #5f2dab;
background-color: rgba(154, 132, 187, .12);
}
.algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
box-shadow: inset 0 -2px 0 0 rgba(95, 45, 171, .5) !important;
}
.ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {
background-color: rgba(208, 189, 236, .15) !important;
}
} }

View File

@ -5,11 +5,6 @@
<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.css" rel="stylesheet"> <link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.css" rel="stylesheet">
{{- end }} {{- end }}
{{ if (or (eq .Page.Layout "docs") (eq .Page.Layout "single")) -}}
{{- "<!-- Documentation extras -->" | safeHTML }}
<link href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" rel="stylesheet">
{{- end -}}
{{- if (ne .Page.Layout "examples") }} {{- if (ne .Page.Layout "examples") }}
{{- $targetDocsCssPath := printf "/docs/%s/assets/css/docs.css" .Site.Params.docs_version -}} {{- $targetDocsCssPath := printf "/docs/%s/assets/css/docs.css" .Site.Params.docs_version -}}
{{- $sassOptions := dict "targetPath" $targetDocsCssPath "precision" 6 -}} {{- $sassOptions := dict "targetPath" $targetDocsCssPath "precision" 6 -}}