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

Move amp-ad CSS to extension #5992

Merged
merged 1 commit into from
Nov 3, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions css/amp.css
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,6 @@ amp-pixel {
visibility: hidden;
}

/**
* Force the layout box of the ad iframe to be exactly as big as the actual
* iframe. The `amp-ad` tag itself can be freely styled.
*/
amp-ad iframe {
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
}

/**
* Instagram wraps the standard image into a fixed size container.
* With these offsets, users can simply specify the the size of the
Expand Down
25 changes: 25 additions & 0 deletions extensions/amp-ad/0.1/amp-ad.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Force the layout box of the ad iframe to be exactly as big as the actual
* iframe. The `amp-ad` tag itself can be freely styled.
*/
amp-ad iframe {
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
}
5 changes: 3 additions & 2 deletions extensions/amp-ad/0.1/amp-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* limitations under the License.
*/

import {CSS} from '../../../build/amp-ad-0.1.css';
import {isLayoutSizeDefined} from '../../../src/layout';
import {AmpAd3PImpl} from './amp-ad-3p-impl';
import {a4aRegistry} from '../../../ads/_a4a-config';
Expand Down Expand Up @@ -91,5 +92,5 @@ export class AmpAd extends AMP.BaseElement {
}
}

AMP.registerElement('amp-ad', AmpAd);
AMP.registerElement('amp-embed', AmpAd);
AMP.registerElement('amp-ad', AmpAd, CSS);
AMP.registerElement('amp-embed', AmpAd, CSS);
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var extensions = {};
declareExtension('amp-access', '0.1', true, 'NO_TYPE_CHECK');
declareExtension('amp-access-laterpay', '0.1', false, 'NO_TYPE_CHECK');
declareExtension('amp-accordion', '0.1', true);
declareExtension('amp-ad', '0.1', false);
declareExtension('amp-ad', '0.1', true);
declareExtension('amp-ad-network-adsense-impl', 0.1, false);
declareExtension('amp-ad-network-doubleclick-impl', 0.1, false);
declareExtension('amp-ad-network-fake-impl', 0.1, false);
Expand Down