debian-mirror-gitlab/app/assets/stylesheets/page_bundles/search.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

365 lines
7.4 KiB
SCSS
Raw Normal View History

2023-03-04 22:38:38 +05:30
@import 'mixins_and_variables_and_functions';
2018-11-18 11:00:15 +05:30
$search-dropdown-max-height: 400px;
$search-avatar-size: 16px;
2021-02-22 17:27:13 +05:30
$search-sidebar-min-width: 240px;
$search-sidebar-max-width: 300px;
2022-08-13 15:12:31 +05:30
$search-keyboard-shortcut: '/';
2023-04-23 21:23:45 +05:30
$language-filter-max-height: 20rem;
2022-07-16 23:28:13 +05:30
$border-radius-medium: 3px;
2018-11-18 11:00:15 +05:30
2015-04-26 12:48:37 +05:30
.search-results {
.search-result-row {
2023-03-04 22:38:38 +05:30
border-bottom: 1px solid var(--border-color, $border-color);
2016-06-02 11:05:42 +05:30
padding-bottom: $gl-padding;
margin-bottom: $gl-padding;
&:last-child {
2018-03-17 18:26:18 +05:30
border-bottom: 0;
2016-06-02 11:05:42 +05:30
}
}
2017-08-17 22:00:37 +05:30
}
2021-02-22 17:27:13 +05:30
.search-sidebar {
@include media-breakpoint-up(md) {
min-width: $search-sidebar-min-width;
max-width: $search-sidebar-max-width;
}
2023-04-23 21:23:45 +05:30
.language-filter-checkbox {
.custom-control-label {
flex-grow: 1;
}
}
.language-filter-max-height {
max-height: $language-filter-max-height;
}
}
.search-max-w-inherit {
max-width: inherit;
}
.search-wrap-f-md-down {
@include gl-media-breakpoint-down(md) {
white-space: normal !important;
}
2021-02-22 17:27:13 +05:30
}
2016-06-02 11:05:42 +05:30
.search {
2018-11-08 19:23:39 +05:30
margin: 0 8px;
2016-06-02 11:05:42 +05:30
form {
2021-09-04 01:27:46 +05:30
display: block;
2016-06-02 11:05:42 +05:30
margin: 0;
padding: 4px;
width: $search-input-width;
line-height: 24px;
2018-03-17 18:26:18 +05:30
height: 32px;
border: 0;
border-radius: $border-radius-default;
2018-11-18 11:00:15 +05:30
transition: border-color ease-in-out $default-transition-duration,
2019-12-04 20:38:33 +05:30
background-color ease-in-out $default-transition-duration;
@include media-breakpoint-up(xl) {
width: $search-input-xl-width;
}
2017-08-17 22:00:37 +05:30
&:hover {
2018-03-17 18:26:18 +05:30
box-shadow: none;
2017-08-17 22:00:37 +05:30
}
2016-06-02 11:05:42 +05:30
}
.search-input {
2018-03-17 18:26:18 +05:30
border: 0;
2016-06-02 11:05:42 +05:30
font-size: 14px;
2017-08-17 22:00:37 +05:30
padding: 0 20px 0 0;
2016-06-02 11:05:42 +05:30
margin-left: 5px;
line-height: 25px;
width: 98%;
2020-04-22 19:07:51 +05:30
color: $white;
2018-03-17 18:26:18 +05:30
background: none;
transition: color ease-in-out $default-transition-duration;
2016-06-02 11:05:42 +05:30
}
2018-03-17 18:26:18 +05:30
.search-input::placeholder {
transition: color ease-in-out $default-transition-duration;
2016-06-02 11:05:42 +05:30
}
.search-input-container {
display: flex;
position: relative;
}
.search-input-wrap {
2019-07-07 11:18:12 +05:30
width: 100%;
2017-08-17 22:00:37 +05:30
.search-icon,
.clear-icon {
2016-06-02 11:05:42 +05:30
position: absolute;
right: 5px;
2018-03-17 18:26:18 +05:30
top: 4px;
2016-06-02 11:05:42 +05:30
}
.search-icon {
2018-03-17 18:26:18 +05:30
transition: color $default-transition-duration;
2016-06-02 11:05:42 +05:30
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
2019-07-07 11:18:12 +05:30
user-select: none;
2016-06-02 11:05:42 +05:30
}
.clear-icon {
display: none;
}
// Rewrite position. Dropdown menu should be relative to .search-input-container
.dropdown {
position: static;
}
.dropdown-header {
2020-11-24 15:15:51 +05:30
// Necessary because deprecatedJQueryDropdown doesn't support a second style of headers
2018-11-18 11:00:15 +05:30
font-weight: $gl-font-weight-bold;
2023-03-04 22:38:38 +05:30
color: var(--gl-text-color, $gl-text-color);
2018-11-18 11:00:15 +05:30
font-size: $gl-font-size;
line-height: 16px;
2016-06-02 11:05:42 +05:30
}
// Custom dropdown positioning
.dropdown-menu {
left: -5px;
2018-11-18 11:00:15 +05:30
max-height: $search-dropdown-max-height;
overflow: auto;
@include media-breakpoint-up(xl) {
2019-12-04 20:38:33 +05:30
width: $search-input-xl-width;
2018-11-18 11:00:15 +05:30
}
2016-06-02 11:05:42 +05:30
}
.dropdown-content {
2018-11-18 11:00:15 +05:30
max-height: $search-dropdown-max-height - 18px;
2016-06-02 11:05:42 +05:30
}
}
&.search-active {
form {
2023-03-04 22:38:38 +05:30
border-color: var(--blue-300, $blue-300);
2018-03-17 18:26:18 +05:30
box-shadow: none;
.search-input-wrap {
.search-icon,
.clear-icon {
2023-03-04 22:38:38 +05:30
color: var(--gray-400, $gl-text-color-tertiary);
2018-03-17 18:26:18 +05:30
transition: color ease-in-out $default-transition-duration;
}
}
2016-06-02 11:05:42 +05:30
2018-03-17 18:26:18 +05:30
.search-input {
2023-03-04 22:38:38 +05:30
color: var(--gl-text-color, $gl-text-color);
2018-03-17 18:26:18 +05:30
transition: color ease-in-out $default-transition-duration;
}
2016-06-02 11:05:42 +05:30
2018-03-17 18:26:18 +05:30
.search-input::placeholder {
2023-03-04 22:38:38 +05:30
color: var(--gray-400, $gl-text-color-tertiary);
2016-06-02 11:05:42 +05:30
}
}
}
&.has-value {
.search-icon {
display: none;
}
.clear-icon {
cursor: pointer;
display: block;
}
}
2018-11-18 11:00:15 +05:30
.inline-search-icon {
position: relative;
margin-right: 4px;
2023-03-04 22:38:38 +05:30
color: var(--gray-500, $gl-text-color-secondary);
2018-11-18 11:00:15 +05:30
}
.identicon,
.search-item-avatar {
flex-basis: $search-avatar-size;
flex-shrink: 0;
margin-right: 4px;
}
.search-item-avatar {
width: $search-avatar-size;
height: $search-avatar-size;
border-radius: 50%;
2023-03-04 22:38:38 +05:30
border: 1px solid var(--gray-50, $gray-normal);
2015-04-26 12:48:37 +05:30
}
}
2015-09-25 12:07:36 +05:30
2019-10-12 21:52:04 +05:30
.search-field-holder,
.project-filter-form {
flex: 1 0 auto;
position: relative;
2016-06-02 11:05:42 +05:30
2019-10-12 21:52:04 +05:30
.search-holder & {
2016-06-02 11:05:42 +05:30
margin-right: 0;
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2016-06-02 11:05:42 +05:30
margin-right: 5px;
}
}
2015-09-25 12:07:36 +05:30
2016-06-02 11:05:42 +05:30
.search-icon {
position: absolute;
left: 10px;
2021-01-03 14:25:43 +05:30
top: 9px;
2023-03-04 22:38:38 +05:30
color: var(--gray-700, $gray-darkest);
2016-06-02 11:05:42 +05:30
pointer-events: none;
}
2019-12-04 20:38:33 +05:30
.search-text-input {
2016-06-02 11:05:42 +05:30
padding-left: $gl-padding + 15px;
padding-right: $gl-padding + 15px;
}
2019-10-12 21:52:04 +05:30
}
.search-holder {
@include media-breakpoint-up(sm) {
display: flex;
}
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
.btn-search,
2019-10-12 21:52:04 +05:30
.btn-success,
2022-05-07 20:08:51 +05:30
.dropdown-menu-toggle,
2023-03-04 22:38:38 +05:30
.gl-dropdown {
2016-06-02 11:05:42 +05:30
width: 100%;
margin-top: 5px;
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2016-06-02 11:05:42 +05:30
width: auto;
margin-top: 0;
margin-left: 5px;
}
}
.dropdown {
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2016-06-02 11:05:42 +05:30
margin-left: 5px;
margin-right: 5px;
}
}
2022-05-07 20:08:51 +05:30
.dropdown-menu-toggle,
2023-03-04 22:38:38 +05:30
.gl-dropdown {
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(sm) {
2016-08-24 12:49:21 +05:30
width: 180px;
2016-06-02 11:05:42 +05:30
margin-top: 0;
}
2015-09-25 12:07:36 +05:30
}
}
2019-10-12 21:52:04 +05:30
.search-page-form {
.dropdown-menu-toggle,
.btn-search {
width: 100%;
}
2021-01-29 00:20:46 +05:30
.dropdown-menu-toggle,
2023-03-04 22:38:38 +05:30
.gl-dropdown {
2019-10-12 21:52:04 +05:30
@include media-breakpoint-up(lg) {
width: 240px;
}
}
.btn-search {
@include media-breakpoint-up(lg) {
width: auto;
}
}
}
2021-01-03 14:25:43 +05:30
.ref-truncated {
@include str-truncated(10em);
}
2021-09-04 01:27:46 +05:30
.global-search-dropdown-menu {
width: 100% !important;
max-width: 400px;
@include media-breakpoint-up(md) {
// This is larger than the container so width: 100% doesn't work.
width: 400px !important;
}
}
2022-01-26 12:08:38 +05:30
// This overrides parts of the Project File View CSS
// We leverage most of the styling but broke off
// from how we were doing it in `shared/file_highlight`
#search-blob-content {
.line_holder {
pre {
padding: 0; // This overrides the existing style that will add space between each line.
2022-10-11 01:57:18 +05:30
.line {
@include gl-word-break-word;
white-space: break-spaces;
}
2022-01-26 12:08:38 +05:30
}
svg {
float: none; // We have more than one icon on this implementation and don't want to float them.
margin: 0; // We will manage the margin with GitLab UI utility classes
}
.line-numbers {
padding: 0; // This overrides the existing style that will add space between each line.
min-width: 6.5rem; // Ensure our numbers fit
.diff-line-num {
a {
transition: none; // There will be a hover transition from theme, blue, darkened
}
}
}
&:hover {
svg {
visibility: visible; // We want to show the icons when the any part of the line is hovered
}
}
// The icons only appear on hover
// So on mobile we can hide them and retake the space for the code blob
@include media-breakpoint-down(sm) {
svg {
display: none;
}
.line-numbers {
min-width: 4rem;
}
}
}
}
2023-04-23 21:23:45 +05:30
/**
* When form input type is search, browsers add a clear input button inside
* the input field. This overlaps with the input field we have already added.
*/
/* stylelint-disable property-no-vendor-prefix */
2022-05-07 20:08:51 +05:30
input[type='search'] {
-webkit-appearance: textfield;
2023-04-23 21:23:45 +05:30
-moz-appearance: textfield;
appearance: textfield;
2022-05-07 20:08:51 +05:30
&::-webkit-search-cancel-button,
&::-webkit-search-results-button {
@include gl-display-none;
}
2019-09-04 21:01:54 +05:30
}
2023-04-23 21:23:45 +05:30
/* stylelint-enable property-no-vendor-prefix */