Skip to content

Commit

Permalink
refactor amp-ad.css (#5992)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx authored Nov 3, 2016
1 parent 1ec92ca commit 2559dde
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
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

0 comments on commit 2559dde

Please sign in to comment.