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
Force set amp-lightbox-gallery buttons to content-box sizing #15080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our build has an svg optimizer pass, and it does this conversion automatically:
// build/amp-lightbox-gallery-0.1.css.js
export const CSS = "/*...*/url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.295 5.705a.997.997 0 0 0-1.41 0L12 10.59 7.115 5.705a.997.997 0 1 0-1.41 1.41L10.59 12l-4.885 4.885a.997.997 0 0 0 1.41 1.41L12 13.41l4.885 4.885a.997.997 0 0 0 1.41-1.41L13.41 12l4.885-4.885a.997.997 0 0 0 0-1.41z' fill='%23fff' fill-rule='nonzero'/%3E%3C/svg%3E\"/*...*/";
…parsing" This reverts commit ade746c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Side note: I noticed that the button with this classname is a div
tag. button
tags do have some default styles to override (like background image and border), but they also default to box-sizing: border-box
.
@@ -87,6 +87,7 @@ amp-lightbox-gallery .amp-carousel-button { | |||
width: 24px; | |||
height: 24px; | |||
padding: 16px; | |||
box-sizing: content-box; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put !important
? to protect when we actually make this public in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about this, since the intention here is to allow them to edit the dimensions of the button. There seemed to be an argument to allow them to style this however they please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point. LGTM
…ect#15080) * Replace double quotes with single quotes for firefox windows parsing * Set box sizing to content box * Revert "Replace double quotes with single quotes for firefox windows parsing" This reverts commit ade746c.
Force buttons to be
content-size
, since sometimes people will doAs a pattern.