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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃枍 Add preliminary styles for amp-autocomplete #21479

Merged
merged 8 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion css/Z_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ amp-story-page-attachment
.i-amphtml-story-spinner | 10 | extensions/amp-story/1.0/amp-story.css
amp-date-picker[mode="overlay"] .i-amphtml-date-picker-container | 10 | extensions/amp-date-picker/0.1/amp-date-picker.css
.amp-carousel-button | 10 | extensions/amp-carousel/0.1/amp-carousel.css
.amp-autocomplete-results | 10 | extensions/amp-autocomplete/0.1/amp-autocomplete.css
amp-sticky-ad | 11 | extensions/amp-sticky-ad/1.0/amp-sticky-ad.css
amp-sticky-ad-top-padding | 12 | extensions/amp-sticky-ad/1.0/amp-sticky-ad.css
amp-app-banner | 13 | extensions/amp-app-banner/0.1/amp-app-banner.css
Expand Down Expand Up @@ -137,4 +138,4 @@ amp-consent
.i-amphtml-sidebar-mask | 2147483646 | extensions/amp-sidebar/0.1/amp-sidebar.css
.amp-apester-fullscreen | 2147483646 | extensions/amp-apester-media/0.1/amp-apester-media.css
.amp-access-scroll-bar | 2147483647 | extensions/amp-access-scroll/0.1/amp-access-scroll.css
amp-sidebar | 2147483647 | extensions/amp-sidebar/0.1/amp-sidebar.css
amp-sidebar | 2147483647 | extensions/amp-sidebar/0.1/amp-sidebar.css
9 changes: 8 additions & 1 deletion css/amp.css
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,14 @@ amp-autocomplete {
}

amp-autocomplete > input {
padding: 4px !important;
padding: .5rem; /* default-ui-space-large */
border: 1px solid rgba(0,0,0,.33) /* default-ui-med-gray */
}

amp-autocomplete > input,
.i-amphtml-autocomplete-results {
font-size: 1rem; /* default-ui-font-size */
line-height: 1.5rem; /* default-ui-space-large */
}

/**
Expand Down
38 changes: 31 additions & 7 deletions extensions/amp-autocomplete/0.1/amp-autocomplete.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,48 @@
* limitations under the License.
*/

/* NOTE: styles that affect sizing are in amp.css to avoid FOUC */
amp-autocomplete,
amp-autocomplete > input {
font-family: sans-serif; /* default-ui-font-stack */
}

amp-autocomplete > input {
border-radius: 4px; /* default-ui-border-radius */
box-sizing: border-box;
}

.i-amphtml-autocomplete-results {
position: absolute;
top: 100%;
width: 100%;
margin-top: 4px;
width: calc(100% + 16px);
margin-top: .5rem; /* default-ui-space-small */
margin-left: -.5rem; /* default-ui-space-small */
border-radius: 4px; /* default-ui-border-radius */

background-color: white; /* default-ui-background-color */
box-shadow: 0px 2px 4px 0px rgba(0,0,0,.5); /* default-ui-box-shadow */
z-index: 10;
}

.i-amphtml-autocomplete-item {
background-color: white;
border: 1px solid black;
padding: 4px;
position: relative;
padding: .5rem 1rem; /* default-ui-space-small default-ui-space-medium */
cursor: pointer;
}

.i-amphtml-autocomplete-item:first-child {
border-radius: 4px 4px 0px 0px; /* default-ui-border-radiuss */
}

.i-amphtml-autocomplete-item:nth-last-child(2) {
border-radius: 0px 0px 4px 4px; /* default-ui-border-radius */
}

.i-amphtml-autocomplete-item:hover {
background-color: #d3d3d3;
background-color: rgba(0,0,0,.15); /* default-ui-light-gray */
}

.i-amphtml-autocomplete-item-active {
background-color: #d3d3d3;
background-color: rgba(0,0,0,.15); /* default-ui-light-gray */
}