Skip to content
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

fix(dropdown): Visually group suggestions together #72

Merged
merged 1 commit into from
Jan 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
color: #333;
cursor: pointer;
overflow: hidden;
border-bottom: 1px solid $color-border;
}

// Each sub-suggestion
.algolia-docsearch-suggestion__secondary {
border-top: 1px solid $color-border;
}

// Main category headers
.algolia-docsearch-suggestion--category-header {
display: none;
Expand Down Expand Up @@ -62,6 +66,7 @@
// The secondary column is hidden on small screens
.algolia-docsearch-suggestion--subcategory-column {
display: none;
cursor: default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's such a good idea to remove the cursor: pointer on something clickable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to disable the click using pointer-events: none; but didn't work. I guess we'd need to disable in the JS by checking if the parent of the click elements if different from the left column.

For now when a user click it redirect to the page of suggestion that is at the same level as the mouse. And not to the sub-category, like the user could expect.

}
// The text snippet is hidden on small screens
.algolia-docsearch-suggestion--text {
Expand All @@ -70,7 +75,14 @@

.algolia-docsearch-suggestion--content {
padding: 3px 5px;
width: 100%;
border-top: 1px solid lighten($color-border, 60%);
}

.algolia-docsearch-suggestion__main .algolia-docsearch-suggestion--content,
.algolia-docsearch-suggestion__secondary .algolia-docsearch-suggestion--content {
border-top: 0;
}

.algolia-docsearch-suggestion--subcategory-inline {
display: inline-block;
Expand Down Expand Up @@ -128,8 +140,12 @@
.algolia-docsearch-suggestion {
display: table;
width: 100%;
border-bottom: 1px solid $color-border-light;
}

.algolia-docsearch-suggestion__secondary {
border-top: 1px solid $color-border-light;
}

.algolia-docsearch-suggestion--subcategory-column {
border-right: 1px solid $color-border-light;
background: $color-left-column-bg;
Expand Down