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

Add amp-border-box class for use on html #1508

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

cogell
Copy link
Contributor

@cogell cogell commented Jan 21, 2016

Quick pass at: #1497

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@cogell
Copy link
Contributor Author

cogell commented Jan 21, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@ampsauce
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 1a694315b5e237d9769cb5ceff2b3c277c048224
Build details: https://travis-ci.org/ampsauce/amphtml/builds/103951369

(Please note that this is a fully automated comment.)

html.amp-border-box *,
html.amp-border-box *:before,
html.amp-border-box *:after {
box-sizing: inherit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. By default though box-sizing is not inherited. This could cause some unexpected behavior where someone would override box-sizing just for one element and it'd automatically apply to everything within.

What about if we just explicitly state border-box instead of inherit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great point. My thinking was that html components that are built around a different box-sizing model would only need to set their box-sizing on the parent which would inherit down. Now I'm thinking that that case in an AMP page would be rare and in that edge case the author could assign box-sizing on each element on that component.

Will update.

@ampsauce
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 6ae0bfc3488d64002997620d300f7461e37bd10c
Build details: https://travis-ci.org/ampsauce/amphtml/builds/104164594

(Please note that this is a fully automated comment.)

@dvoytenko
Copy link
Contributor

@cogell sorry, not sure, is this already updated and ready to be reviewed?

@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

@dvoytenko sorry forget to ping. Yes it is updated. looks like the CI tests failed for a connection issue.

@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

Should I add this new css class in the docs/include_features.md docs?

html.amp-border-box {
box-sizing: border-box;
}
html.amp-border-box *,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: new line between declarations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@dvoytenko
Copy link
Contributor

@cogell All looks good. I have two minor comments. And, yes, please do add a section to the docs/inlude_features.md

@dvoytenko dvoytenko self-assigned this Jan 27, 2016
@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

on it...

@cogell cogell force-pushed the Add-amp-border-box-class branch 2 times, most recently from d19e56c to 27b6b9d Compare January 27, 2016 20:46
@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

@dvoytenko updated!

@jridgewell
Copy link
Contributor

Is there a reason to restrict this to html?

@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

hm! sure it seems like this would be fine too:

.amp-border-box,
.amp-border-box *,
.amp-border-box *:before,
.amp-border-box *:after {
  box-sizing: border-box
}

@ampsauce
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 27b6b9d5b29038d70f192dba65c0eccff40d387d
Build details: https://travis-ci.org/ampsauce/amphtml/builds/105272992

(Please note that this is a fully automated comment.)

@cogell
Copy link
Contributor Author

cogell commented Jan 27, 2016

@jridgewell updated

@ampsauce
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: d19e56c46fecb5a50c17f19a50809b672ec2b2bd
Build details: https://travis-ci.org/ampsauce/amphtml/builds/105272873

(Please note that this is a fully automated comment.)

@ampsauce
Copy link

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 18bcd2d
Build details: https://travis-ci.org/ampsauce/amphtml/builds/105278263

(Please note that this is a fully automated comment.)

@@ -241,6 +241,11 @@ if the browser doesn't support HTML5 audio, for example:
<source type="audio/ogg" src="foo.ogg">
</amp-audio>
```
# Add Border Box Sizing

Included in the base amp css is a class of `amp-border-box` that will set `box-sizing: border-box` on all elements
Copy link
Contributor

Choose a reason for hiding this comment

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

"amp css" -> "AMP CSS"

@dvoytenko
Copy link
Contributor

Great! LGTM with one minor comment.

@dvoytenko dvoytenko added the LGTM label Jan 28, 2016
dvoytenko added a commit that referenced this pull request Jan 28, 2016
Add amp-border-box class for use on html
@dvoytenko dvoytenko merged commit 730bda0 into ampproject:master Jan 28, 2016
@dvoytenko
Copy link
Contributor

Merged. Thanks a lot!

@azizhk
Copy link

azizhk commented May 27, 2016

Please guide me with this PR:
#3360

It adds box-sizing to all elements but it can be easily overriden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants