refactor search css into scss for clearer organization, plus do some fixes to the typeahead css

This commit is contained in:
Devin Howard 2015-11-28 20:39:11 +08:00
parent 98e11c0a7d
commit 9afc8bc7c4

View file

@ -1,9 +1,3 @@
.sidebarSearch {
float:left;
height: 32px;
position: relative;
}
#searchLoading { #searchLoading {
height: 24px; height: 24px;
width: 24px; width: 24px;
@ -13,28 +7,18 @@
display: none; display: none;
} }
.unauthenticated .homePage .sidebarSearchIcon { .unauthenticated {
.homePage .sidebarSearchIcon {
border-radius: 2px; border-radius: 2px;
} }
.sidebarSearchIcon {
float: left;
width: 72px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
height: 32px;
background: #4fb5c0 url(<%= asset_data_uri('search.png') %>) no-repeat center center;
background-size: 32px 32px;
cursor: pointer;
}
.sidebarSearch .twitter-typeahead, .sidebarSearch .sidebarSearchField {
float: left;
}
.unauthenticated .homePage .sidebarSearchField, .homePage .sidebarSearchField,
.unauthenticated .homePage .sidebarSearch .tt-hint { .homePage .sidebarSearch .tt-hint {
border-top-left-radius: 2px; border-top-left-radius: 2px;
border-bottom-left-radius: 2px; border-bottom-left-radius: 2px;
} }
}
.explorePage .sidebarSearchField, .explorePage .sidebarSearchField,
.explorePage .sidebarSearch .tt-hint { .explorePage .sidebarSearch .tt-hint {
width: 380px; width: 380px;
@ -44,32 +28,16 @@
.sidebarSearchField { .sidebarSearchField {
color: #424242; color: #424242;
} }
.sidebarSearch .tt-hint {
color: transparent; .sidebarSearchIcon {
} float: left;
.sidebarSearchField, width: 72px;
.sidebarSearch .tt-hint { border-top-right-radius: 2px;
height: 20px; border-bottom-right-radius: 2px;
border-top: 1px solid #BDBDBD; height: 32px;
border-bottom: 1px solid #BDBDBD; background: #4fb5c0 url(<%= asset_data_uri('search.png') %>) no-repeat center center;
border-left: none; background-size: 32px 32px;
border-right: none; cursor: pointer;
padding: 5px 0 5px 0;
width: 0px;
margin: 0;
outline: none;
font-size: 14px;
line-height: 14px;
background: #F5F5F5;
font-family: 'din-medium', helvetica, sans-serif;
}
.sidebarSearch .tt-dropdown-menu {
top: 40px !important;
background: #F5F5F5;
width: 472px;
overflow-y: auto;
overflow-x: visible;
box-shadow: 0 10px 10px rgba(0,0,0,0.19), 0 6px 3px rgba(0,0,0,0.23);
} }
.autoOptions #mapContribs { .autoOptions #mapContribs {
@ -88,7 +56,6 @@
margin-left: 10px; margin-left: 10px;
} }
.searchHeader { .searchHeader {
height: 42px; height: 42px;
width: 100%; width: 100%;
@ -103,7 +70,77 @@
.searchMappersHeader { .searchMappersHeader {
background: #c04f4f; background: #c04f4f;
} }
.sidebarSearch .tt-dropdown-menu h3 {
.resultmap, .resulttopic, .resultmapper, .resultnoresult {
min-height: 48px;
display: table;
}
.canEditMap button.addToMap {
display: block;
}
.tipUserImage {
position: absolute;
top: 0px;
left: 7px;
border-radius: 14px;
}
.sidebarSearchField {
height: 20px;
border-top: 1px solid #BDBDBD;
border-bottom: 1px solid #BDBDBD;
border-left: none;
border-right: none;
padding: 5px 0 5px 0;
width: 0px;
margin: 0;
outline: none;
font-size: 14px;
line-height: 14px;
background: #F5F5F5;
font-family: 'din-medium', helvetica, sans-serif;
}
/* main search selector */
.sidebarSearch {
float:left;
height: 32px;
position: relative;
.twitter-typeahead,
.sidebarSearchField {
float: left;
}
.tt-hint {
color: transparent;
height: 20px;
border-top: 1px solid #BDBDBD;
border-bottom: 1px solid #BDBDBD;
border-left: none;
border-right: none;
padding: 5px 0 5px 0;
width: 0px;
margin: 0;
outline: none;
font-size: 14px;
line-height: 14px;
background: #F5F5F5;
font-family: 'din-medium', helvetica, sans-serif;
}
.tt-dropdown-menu {
top: 40px !important;
background: #F5F5F5;
width: 472px;
overflow-y: auto;
overflow-x: visible;
box-shadow: 0 10px 10px rgba(0,0,0,0.19), 0 6px 3px rgba(0,0,0,0.23);
h3 {
text-transform: uppercase; text-transform: uppercase;
color: #F5F5F5; color: #F5F5F5;
font-size: 18px; font-size: 18px;
@ -111,7 +148,8 @@
margin: 12px 0 3px 16px; margin: 12px 0 3px 16px;
float: left; float: left;
} }
.sidebarSearch .tt-dropdown-menu .limitToMe {
.limitToMe {
float: left; float: left;
width: 12px; width: 12px;
height: 12px; height: 12px;
@ -121,7 +159,8 @@
top: 15px; top: 15px;
left: 136px; left: 136px;
} }
.sidebarSearch .tt-dropdown-menu .limitToMeLabel {
.limitToMeLabel {
float: left; float: left;
font-family: 'din-medium', helvetica, sans-serif; font-family: 'din-medium', helvetica, sans-serif;
font-size: 12px; font-size: 12px;
@ -131,7 +170,9 @@
top: 15px; top: 15px;
left: 156px; left: 156px;
} }
.sidebarSearch .tt-dropdown-menu .minimizeResults, .sidebarSearch .tt-dropdown-menu .maximizeResults {
.minimizeResults,
.maximizeResults {
width: 32px; width: 32px;
height: 32px; height: 32px;
background-image: url(<%= asset_data_uri('arrowpermswhite_sprite.png') %>); background-image: url(<%= asset_data_uri('arrowpermswhite_sprite.png') %>);
@ -141,63 +182,57 @@
top: 5px; top: 5px;
left: 410px; left: 410px;
} }
.sidebarSearch .tt-dropdown-menu .minimizeResults { .minimizeResults {
background-position: 0 0; background-position: 0 0;
} }
.sidebarSearch .tt-dropdown-menu .maximizeResults { .maximizeResults {
background-position: -32px 0; background-position: -32px 0;
} }
.sidebarSearch .tt-dataset { }/* tt-dropdown-menu */
overflow: visible;
} .tt-suggestion {
.sidebarSearch .tt-suggestion {
position: relative; position: relative;
background: #FFF; background: #FFF;
padding: 8px 0; padding: 8px 0;
}
.sidebarSearch .tt-is-under-cursor, &:hover {
.sidebarSearch .tt-suggestion:hover {
background: #E0E0E0; background: #E0E0E0;
} }
.searchResIconWrapper {
.resultmap, .resulttopic, .resultmapper, .resultnoresult {
min-height: 48px;
display: table;
}
/*.sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap,
.sidebarSearch .tt-dataset-maps .tt-is-under-mouse-cursor .resultmap,
.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .resulttopic,
.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .resulttopic {
min-height: 48px;
}*/
.sidebarSearch .tt-suggestion .searchResIconWrapper {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
height: 32px; height: 32px;
padding: 0 18px 0 28px; padding: 0 18px 0 28px;
} }
.sidebarSearch .tt-suggestion .icon { .icon {
width: 32px; width: 32px;
height: 32px; height: 32px;
border-radius:16px; border-radius:16px;
} }
.sidebarSearch .topicMetacode { }/* tt-suggestion */
display: table-cell;
vertical-align: middle; .tt-dataset {
padding: 0 0 0 8px; overflow: visible;
width: 70px;
} }
.sidebarSearch .tt-dataset-topics .topicIcon {
.tt-dataset-maps {
.autoOptions {
width: 84px;
}
}/* .tt-dataset-maps */
.tt-dataset-topics {
.topicIcon {
width: 32px; width: 32px;
height: 32px; height: 32px;
margin: 0 auto; margin: 0 auto;
} }
.sidebarSearch .tt-dataset-topics .metacodeTip { .metacodeTip {
display: none; display: none;
margin: 0 auto; margin: 0 auto;
} }
.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip, .tt-cursor .metacodeTip,
.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .metacodeTip { .tt-suggestion:hover .metacodeTip {
display: block; display: block;
font-family: 'vinyl'; font-family: 'vinyl';
text-transform: uppercase; text-transform: uppercase;
@ -206,68 +241,89 @@
margin: 0 5px 0 2px; margin: 0 5px 0 2px;
text-align: center; text-align: center;
} }
.sidebarSearch .tt-dataset-mappers .tt-suggestion .icon { }/* tt-dataset-topics */
.tt-dataset-mappers {
.icon {
margin: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;
} }
.sidebarSearch .tt-dataset-mappers .resultText { .mappers .resultText {
width: 150px; width: 150px;
} }
.autoOptions {
width: 235px;
}
.mapCount {
top: 8px;
left: 170px;
}
.mapperCreated {
left: 0px;
padding-left: 0px;
font-size: 12px;
font-family: 'din-medium', helvetica, sans-serif;
line-height: 24px;
}
.mapperGeneration {
top: 20px;
left: 0px;
padding-left: 0px;
font-size: 12px;
font-family: 'din-medium', helvetica, sans-serif;
line-height: 24px;
}
}/* tt-dataset-mappers */
.sidebarSearch .resultText { .resultText {
width: 260px; width: 260px;
display: table-cell; display: table-cell;
padding-left: 8px; padding-left: 8px;
vertical-align: middle; vertical-align: middle;
word-wrap: break-word; word-wrap: break-word;
} }
.sidebarSearch .resultTitle { .resultTitle {
font-weight: normal; font-weight: normal;
font-size: 16px; font-size: 16px;
line-height: 20px; line-height: 20px;
width: 100%; width: 100%;
font-family: 'din-regular', helvetica, sans-serif; font-family: 'din-regular', helvetica, sans-serif;
} }
.sidebarSearch .resultDesc { .resultDesc {
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
width: 100%; width: 100%;
font-style: italic; font-style: italic;
font-family: helvetica, sans-serif; font-family: helvetica, sans-serif;
} }
.sidebarSearch .tip {
display: none; .autoOptions {
}
.sidebarSearch div.autoOptions {
width: 114px; width: 114px;
height: 48px; height: 48px;
position: absolute; position: absolute;
display: none; display: none;
top: 8px; top: 8px;
right: 0; right: 0;
}
.tt-dataset-maps div.autoOptions { a,
width: 84px; div,
} button {
.sidebarSearch .tt-dataset-mappers .autoOptions {
width: 235px;
}
.sidebarSearch .tt-is-under-cursor .autoOptions,
.sidebarSearch .tt-is-under-mouse-cursor .autoOptions {
display: block;
}
.sidebarSearch .tt-suggestion .resultnoresult .autoOptions {
display: none;
}
.sidebarSearch .autoOptions button,
.sidebarSearch .autoOptions a,
.sidebarSearch .autoOptions div {
position: absolute; position: absolute;
padding: 0; padding: 0;
margin: 0; margin: 0;
border: none; border: none;
outline: none; outline: none;
} }
.sidebarSearch button.addToMap { }/* .autoOptions */
.tt-cursor .autoOptions,
.tt-suggestion:hover .autoOptions {
display: block;
}
.tt-suggestion .resultnoresult .autoOptions {
display: none;
}
.addToMap {
display:none; display:none;
width: 24px; width: 24px;
height: 24px; height: 24px;
@ -277,15 +333,13 @@
top: 12px; top: 12px;
left: 80px; left: 80px;
cursor: pointer; cursor: pointer;
}
.canEditMap button.addToMap { &:hover {
display: block;
}
.sidebarSearch button.addToMap:hover {
background-position: -24px; background-position: -24px;
} }
}/* .addToMap */
.sidebarSearch div.topicCount { .topicCount {
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url(<%= asset_data_uri('topic16.png') %>); background: url(<%= asset_data_uri('topic16.png') %>);
@ -298,7 +352,7 @@
line-height: 24px; line-height: 24px;
} }
.sidebarSearch div.mapCount { .mapCount {
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url(<%= asset_data_uri('metamap16.png') %>); background: url(<%= asset_data_uri('metamap16.png') %>);
@ -309,7 +363,8 @@
font-size: 12px; font-size: 12px;
line-height: 24px; line-height: 24px;
} }
.sidebarSearch div.synapseCount {
.synapseCount {
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url(<%= asset_data_uri('synapse16.png') %>); background: url(<%= asset_data_uri('synapse16.png') %>);
@ -321,22 +376,16 @@
font-size: 12px; font-size: 12px;
line-height: 24px; line-height: 24px;
} }
.sidebarSearch div.topicOriginatorIcon {
width: 18px; .topicMetacode {
height: 18px; display: table-cell;
padding: 3px; vertical-align: middle;
top: 0; padding: 0 0 0 8px;
left: 44px; width: 70px;
}
.sidebarSearch .topicOriginatorIcon img {
border-radius: 9px;
} }
.sidebarSearch .topicOriginatorIcon .tip { .tip {
right: 30px; display: none;
top: 1px;
}
.sidebarSearch .tip {
position: absolute; position: absolute;
background: #424242; background: #424242;
width: auto; width: auto;
@ -351,30 +400,47 @@
padding: 4px 4px 4px; padding: 4px 4px 4px;
z-index: 100; z-index: 100;
} }
.sidebarSearch .hoverForTip:hover .tip {
display: block; .topicOriginatorIcon {
width: 18px;
height: 18px;
padding: 3px;
top: 0;
left: 44px;
img {
border-radius: 9px;
} }
.sidebarSearch .mapContributorsIcon .tip { .tip {
right: 30px;
top: 1px;
}
.tip:before {
top: 5px;
right: -4px;
}
}/* .topicOriginatorIcon */
.mapContributorsIcon .tip {
right: 40px; right: 40px;
top: -5px; top: -5px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.sidebarSearch .hoverForTip .tip li { .hoverForTip{
&:hover .tip {
display: block;
}
.tip li {
padding-left: 28px; padding-left: 28px;
padding-top: 4px; padding-top: 4px;
} }
.tipUserImage { .tip:before {
position: absolute;
top: 0px;
left: 7px;
border-radius: 14px;
}
.sidebarSearch .hoverForTip .tip:before {
content: ''; content: '';
position: absolute; position: absolute;
width: 0; width: 0;
@ -384,39 +450,37 @@
border-bottom: 5px solid transparent; border-bottom: 5px solid transparent;
} }
.sidebarSearch .hoverForTip.addToMap .tip { .tip {
right: 30px; right: 30px;
} }
.sidebarSearch .hoverForTip.addToMap .tip:before { .tip:before {
right: -4px; right: -4px;
} }
}/* .hoverForTip */
.sidebarSearch .mapContributorsIcon .tip:before { .mapContributorsIcon {
height: 24px;
top: 0;
left: 44px;
font-size: 12px;
line-height: 24px;
.tip:before {
top: 12px; top: 12px;
right: -4px; right: -4px;
} }
.sidebarSearch .topicOriginatorIcon .tip:before { .mapContributors {
top: 5px;
right: -4px;
}
.sidebarSearch .mapContributorsIcon .mapContributors {
top: auto; top: auto;
right: 0; right: 0;
bottom: 21px; bottom: 21px;
white-space: normal; white-space: normal;
width: 200px; width: 200px;
} }
.sidebarSearch div.mapContributorsIcon { }/* .mapContributorsIcon */
height: 24px;
top: 0; .topicPermission,
left: 44px; .mapPermission {
font-size: 12px;
line-height: 24px;
}
.sidebarSearch div.topicPermission,
.sidebarSearch div.mapPermission {
width: 24px; width: 24px;
height: 24px; height: 24px;
background-image: url(<%= asset_data_uri('permissions32_sprite.png') %>); background-image: url(<%= asset_data_uri('permissions32_sprite.png') %>);
@ -424,36 +488,18 @@
background-size: 72px 48px !important; background-size: 72px 48px !important;
top: 24px; top: 24px;
left: 44px; left: 44px;
}
.sidebarSearch div.topicPermission.commons, .commons,
.sidebarSearch div.mapPermission.commons { .commons {
background-position: 0 0; background-position: 0 0;
} }
.sidebarSearch div.topicPermission.public, .public,
.sidebarSearch div.mapPermission.public { .public {
background-position: -48px 0; background-position: -48px 0;
} }
.sidebarSearch div.topicPermission.private, .private,
.sidebarSearch div.mapPermission.private { .private {
background-position: -24px 0; background-position: -24px 0;
} }
}/* .topicPermission, .mapPermission */
.sidebarSearch .tt-dataset-mappers div.mapCount { }/* .sidebarSearch */
top: 8px;
left: 170px;
}
.sidebarSearch .tt-dataset-mappers div.mapperCreated {
left: 0px;
padding-left: 0px;
font-size: 12px;
font-family: 'din-medium', helvetica, sans-serif;
line-height: 24px;
}
.sidebarSearch .tt-dataset-mappers div.mapperGeneration {
top: 20px;
left: 0px;
padding-left: 0px;
font-size: 12px;
font-family: 'din-medium', helvetica, sans-serif;
line-height: 24px;
}