Skip to content

Commit b56ebbd

Browse files
Migrate /base to use @use (#10896) (#15973)
* Migrate /base to use @use (#10896) NOTE: when a module is already loaded, it can not later be loaded with configuration * Removed outdated and used banner base includes * Remove Monitor Plus banner The original usage was removed almost a year ago in PR #14552. We kept the banner code around in case it needed to be re-used but it seems safe to clean at this time * Fix docs link * Remove unused basic banner includes * Update banner docs
1 parent f3495d9 commit b56ebbd

File tree

14 files changed

+11
-582
lines changed

14 files changed

+11
-582
lines changed

bedrock/base/templates/includes/banners/base.html

-22
This file was deleted.

bedrock/base/templates/includes/banners/monitor-plus.html

-20
This file was deleted.

bedrock/mozorg/templates/mozorg/home/includes/monitor-mid-banner.html

-37
This file was deleted.

docs/abtest.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Traffic Cop
7171

7272
Create a .js file where you initialize Traffic Cop and include that in the
7373
experiments block in the template that will be doing the redirection. Wrap the
74-
extra js include in a `switch <http://bedrock.readthedocs.io/en/latest/install.html#feature-flipping-aka-switches>`_.
74+
extra js include in a `switch <http://bedrock.readthedocs.io/en/latest/install.html#feature-flipping-aka-switches-or-waffle-switches>`_.
7575

7676
.. code-block:: jinja
7777

docs/banners.rst

+8-10
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@ block. Banners can also be toggled on and off using a switch:
2626
{% endif %}
2727
{% endblock %}
2828
29-
Banner templates should extend the *base banner template*, and content can
30-
then be inserted using ``banner_title`` and ``banner_content`` blocks:
29+
Banner templates should extend the *basic banner template*, which provides very
30+
unopinionated structure but includes several helpful features such as a close
31+
button with localized text and exclusion of banner content from search result
32+
snippets.
33+
34+
Custom banner content can then be inserted using ``banner_title`` and ``banner_content``
35+
blocks:
3136

3237
.. code-block:: jinja
3338
34-
{% extends 'includes/banners/base.html' %}
39+
{% extends 'includes/banners/basic.html' %}
3540
3641
{% block banner_title %}We all love the web. Join Mozilla in defending it.{% endblock %}
3742
3843
{% block banner_content %}
3944
<!-- insert custom HTML here -->
4045
{% endblock %}
4146
42-
CSS styles for banners should be located in ``media/css/base/banners/``, and
43-
should extend common base banner styles:
44-
45-
.. code-block:: css
46-
47-
@import 'includes/base';
48-
4947
To initiate a banner on a page, include ``js/base/banners/mozilla-banner.js`` in
5048
your page bundle and then initiate the banner using a unique ID. The ID will
5149
be used as a cookie identifier should someone dismiss a banner and not wish to

media/css/base/banners/firefox-app-store.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
$font-path: '/media/protocol/fonts';
6-
$image-path: '/media/protocol/img';
7-
8-
@import '~@mozilla-protocol/core/protocol/css/includes/lib';
5+
@use '~@mozilla-protocol/core/protocol/css/includes/lib' as * with ($font-path: '/media/protocol/fonts', $image-path: '/media/protocol/img');
96

107
#firefox-app-store-banner {
118
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';

media/css/base/banners/includes/_base.scss

-120
This file was deleted.

media/css/base/banners/includes/_basic.scss

-72
This file was deleted.

media/css/base/page-not-found.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
@import '~@mozilla-protocol/core/protocol/css/includes/lib';
6-
7-
$font-path: '/media/protocol/fonts';
8-
$image-path: '/media/protocol/img';
5+
@use '~@mozilla-protocol/core/protocol/css/includes/lib' as *;
96

107
.page-header {
118
.mzp-l-content {

0 commit comments

Comments
 (0)