From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../mozilla/add-ons/th\303\250mes/fond/index.html" | 79 ------- .../fr/mozilla/add-ons/th\303\250mes/index.html" | 45 ---- .../th\303\250mes/theme_concepts/index.html" | 231 --------------------- 3 files changed, 355 deletions(-) delete mode 100644 "files/fr/mozilla/add-ons/th\303\250mes/fond/index.html" delete mode 100644 "files/fr/mozilla/add-ons/th\303\250mes/index.html" delete mode 100644 "files/fr/mozilla/add-ons/th\303\250mes/theme_concepts/index.html" (limited to 'files/fr/mozilla/add-ons/thèmes') diff --git "a/files/fr/mozilla/add-ons/th\303\250mes/fond/index.html" "b/files/fr/mozilla/add-ons/th\303\250mes/fond/index.html" deleted file mode 100644 index 2af0b0031c..0000000000 --- "a/files/fr/mozilla/add-ons/th\303\250mes/fond/index.html" +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Thème de fond -slug: Mozilla/Add-ons/Thèmes/Fond -translation_of: Mozilla/Add-ons/Themes/Lightweight_themes ---- -

{{AddonSidebar}}

- -

Comment créer votre propre thème

- -
-

Les thèmes sont fait d'une image "header" qui va remplacer le fond de base de Firefox.

- -

Vous avez fini votre thème ? Mettez-le en ligne maintenant !

- -

Création de l'image "header" du thème

- -

L'image header est affichée en fond en haut de la fenêtre du navigateur, on la voit aussi derrière les barres d'outils, la barre d'adresse, la barre "Rehercher" et la ligne d'onglets. Elle sera ancrée au coin supérieur-droit de la fenêtre.

- -

- - - -

Image Requise

- - - -

Petites aides

- - - -

Ressources : édition d'images en ligne

- - - -

Envoyer votre thème personnalisé

- -

Pour commencer à envoyer vos images, allez sur la page Soumettre un thème.

- -
    -
  1. Nommez votre thème — choisissez un nom unique pour votre thème. 2 thèmes avec le même nom ne sont pas autorisés, alors vus devriez peut-être essayer plusieurs fois pour trouver un nom unique.
  2. -
  3. Choisissez une catégorie et des tags — sélectionnez une catégorie et entrez des tags (mots clés) qui décrivent le mieux votre thème. Rappelez-vous qu'un utilisateur pourrait rejeter votre thème si sa catégorie et ses tags ne sont pas fidèles à votre thème.
  4. -
  5. Décrivez votre thème — écrivez une courte description de votre thème. Rappelez-vous qu'un utilisateur pourrait rejeter votre thème si sa description n'est pas fidèle à votre thème.
  6. -
  7. Sélectionnez une license pour votre thème — décidez une license de droits d'auteurs pour votre travail. Lire plus à propos des types de licences Creative Common. -
      -
    • Important: Soyez sur d'avoir les droits d'utiliser cette image dans votre thème !
    • -
    -
  8. -
  9. Envoyez votre image — soyez sur qu'elle fait moins de 300 KB et qu'elle soit au formant JPG ou PNG !
  10. -
  11. Sélectionnez la couleur des textes et des onglets — vous pouvez choisir la couleur de "fond" des onglets et celle des textes qui colle le mieux avec votre image header.
  12. -
  13. Prévisualisez votre thème — vous êtes prêts à prévisualiser votre thème ! Passez simplement votre souris sur le bouton "Soumettre le thème", et vous verrez à quoi il ressemble.
  14. -
  15. Soumettre votre thème — si tout à l'air bon, cliquez sur le bouton "Soumettre le thème" et vous avez fini ! Vous pouvez voir tous les thèmes que vous avez créé sur votre page de profil. -
      -
    • Info: pour vous assurer que votre thème est approuvé pour la galerie, soyez sur qu'il n'enfreint aucune règles des Conditions d'Utilisation !
    • -
    -
  16. -
- -

soumettre votre thème ici

- -

Plus de tutoriels

- -

Mozilla Themes Focal Point on Sizing - A tutorial on theming with a focus on sizing, by VanillaOrchids.
-
-
- Traduit par Tocram2 ;)

-
diff --git "a/files/fr/mozilla/add-ons/th\303\250mes/index.html" "b/files/fr/mozilla/add-ons/th\303\250mes/index.html" deleted file mode 100644 index b0b2cd163a..0000000000 --- "a/files/fr/mozilla/add-ons/th\303\250mes/index.html" +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Thèmes -slug: Mozilla/Add-ons/Thèmes -tags: - - Apparences - - Extensions - - Theme -translation_of: Mozilla/Add-ons/Themes ---- -

{{AddonSidebar}}

- -

Les thèmes vous permettent de modifier l'apparence de l'interface utilisateur et de la personnaliser selon vos goûts. Apprenez comment créer et partager des thèmes !

- -
-
-

Documentation

- -
-
Créer un thème de navigateur
-
Introduction pour la création de thèmes pour les dernières versions de Firefox.
-
-

Thèmes légers

-
-
Thèmes légers
-
La création de thèmes utilisant peu d'espaces pour Firefox.
-
FAQ des thèmes légers
-
Donne les réponses aux questions les plus courantes.
-
-
- - -
- -

 

diff --git "a/files/fr/mozilla/add-ons/th\303\250mes/theme_concepts/index.html" "b/files/fr/mozilla/add-ons/th\303\250mes/theme_concepts/index.html" deleted file mode 100644 index 8856f4e38f..0000000000 --- "a/files/fr/mozilla/add-ons/th\303\250mes/theme_concepts/index.html" +++ /dev/null @@ -1,231 +0,0 @@ ---- -title: Theme concepts -slug: Mozilla/Add-ons/Thèmes/Theme_concepts -translation_of: Mozilla/Add-ons/Themes/Theme_concepts ---- -
{{AddonSidebar()}}
- -

Dans Firefox, les thèmes développés par la bibliothèque WebExtensions API vous permet de modifier le rendu du navigateur. Le cas se présente en ajoutant des images à la région de l'en-tête du navigateur Firefox : il s'agit de la partie, en arrière-plan, des barres de menu, d'outils, d'hyperliens, de recherche et de l'ensemble des onglets d'une même fenêtre.

- -

These theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension.

- -
-

If you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. You do not need to port your theme. However, please feel free to update your themes to use any of the new features described here.

-
- -

Static themes

- -
-

Note that you can't yet submit static WebExtension-based themes to addons.mozilla.org. The work to support this is tracked in https://github.com/mozilla/addons/issues/501. If you want to share a theme with other users, you'll need to make it either a lightweight theme or a dynamic theme.

-
- -

Static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder. These resources are then packed in a zip for publication on addons.mozilla.org (AMO).

- -
-

A theme and browser extension functionality cannot be defined in one package, such as including a theme to complement an extension. You can, however, programmatically include a theme in an extension using the Theme API. See Dynamic themes.

-
- -

Defining a theme

- -

To create a theme (in this example a simple, single image theme):

- - - -

Static theme approaches

- -

There are two approaches you can take to theming the header area of Firefox: using a single image or using multiple images. You could combine the two, but it’s easier to treat them separately.

- -

Single image themes

- -

This is the basic or minimal theming option, where you define:

- - - -

The area your header image needs to fill is a maximum of 200 pixels high. The maximum image width is determined by the resolution of the monitor Firefox is displaying on and how much of the monitor Firefox is using. Practically, this means you would need to allow for a width of up to 5120 pixels wide (for the next generation of 5k monitors). However, rather than creating a very wide image, a better approach is to use a narrower image with a transparent left edge so that it fades to the background color. For example, we could use this image
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the left edge fading to total transparency.
- combined with a complementary background color, to create this effect in the header
- A single image theme using the weta.png image

- -

See details about this theme in the themes example weta_fade.

- -

Obviously, you can still provide a single wide image if you prefer.

- -

Multiple image themes

- -

As an alternative to creating a single image theme, you have the option to use multiple images. These images can be individually anchored to locations within the header, with the option to apply tiling to each image.

- -

Depending on the effect you want to create you may need to suppress the mandatory "headerURL": image with an empty or transparent image. You would use an empty or transparent image if, for example, you wanted to tile a centrally justified image, such as
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the left and right edges fading to total transparency.
- to create this effect
- A single image theme using the additional images option to align an image to the center of the heading and tile it.
- Here you specify the weta image like this:

- -
"images": {
-  "headerURL": "empty.png",
-  "additional_backgrounds": [ "weta_for_tiling.png"]
-},
- -

and the images tiling with:

- -
"properties": {
-  "additional_backgrounds_alignment": [ "top" ],
-  "additional_backgrounds_tiling": [ "repeat"  ]
-},
- -

Full details of how to setup this theme can be found in the themes example weta_tiled. Full detais of the alignment and tiling options can be found in the "theme" key description.

- -

Alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the right edge fading to total transparency.
- to create this effect
- A theme using the additional images option to place two mirrored image to the left and right of the browser header.

- -

Where the images are specified with:

- -
"images": {
-  "headerURL": "empty.png",
-  "additional_backgrounds": [ "weta.png", "weta-left.png"]
-},
- -

and their alignment by:

- -
"properties": {
-  "additional_backgrounds_alignment": [ "right top" , "left top" ]
-},
- -

Full details of how to setup this theme can be found in the themes example weta_mirror. Full detais of the alignment options can be found in the "theme" key description.

- -

Static animated themes

- -

It is possible to create an animated theme using an APNG format image, as in the themes example animated. However, remember that rapid animations, such as the one in the example might be too distracting for a practical theme.

- -

You can also animate themes programmatically, which we discuss in Dynamic themes.

- -

Dynamic themes

- -

As an alternative to defining a static theme, you can use the {{WebExtAPIRef("theme")}} API to control the theme used in Firefox from within a browser extension. There are a couple of use cases for this option:

- - - -

And, obviously, you can combine the two and bundle a programmatically controlled theme with your extension.

- -

Using the {{WebExtAPIRef("theme")}} API is straightforward. First, request "theme" permission in the extension's manifest.json file. Next, you build a JSON object containing the same information you would use in a static theme’s manifest.json, Finally, pass the JSON object in a {{WebExtAPIRef("theme.update()")}} call.

- -

For example, the following code, from the dynamic theme example defines the content for the day and night elements of the dynamic theme:

- -
const themes = {
-  'day': {
-    images: {
-     headerURL: 'sun.jpg',
-    },
-    colors: {
-     accentcolor: '#CF723F',
-     textcolor: '#111',
-    }
-  },
-  'night': {
-    images: {
-     headerURL: 'moon.jpg',
-    },
-    colors: {
-     accentcolor: '#000',
-     textcolor: '#fff',
-    }
-  }
-};
- -

The theme.Theme object is then passed to {{WebExtAPIRef("theme.update()")}} to change the header theme, as in this code snippet from the same example:

- -
function setTheme(theme) {
-  if (currentTheme === theme) {
-    // No point in changing the theme if it has already been set.
-    return;
-  }
-  currentTheme = theme;
-  browser.theme.update(themes[theme]);
-}
- -

Learn more about dynamic themes and see an additional example in the following video:

- -

{{EmbedYouTube("ycckyrUN0AY")}}

- -

 

- -

If you have not built a browser extension before, check out Your first extension for a step-by-step guide.

- -

Cross browser compatibility

- -

There is currently limited compatibility between themes in the major browsers. Opera takes an entirely different approach, and Microsoft Edge themes are not yet open to developers.

- -

There is some compatibility between Firefox static themes and Chrome themes, providing the ability to port a single header image theme from Firefox to Chrome. This would be done by amending the manifest.json keys as follows:

- - - -

Noting that "frame": and "tab_text": support RGB color definition only.

- -

So, in the single image theme example (weta_fade) could be supported in Chrome using the following manifest.json file:

- -
{
-  "manifest_version": 2,
-  "version": "1.0",
-  "name": "<your_theme_name>",
-  "theme": {
-    "images": {
-      "theme_frame": "weta.png"
-    },
-    "colors": {
-      "frame": [ 173 , 176 , 159 ],
-      "tab_text": [ 0 , 0 , 0 ]
-    }
-  }
-}
- -

However, there will be a couple of differences:

- - - -

The basic theme example using the Chrome compatible manifest.json keys, showing the differences in how those keys are implemented.

- -

For more information, see the notes on Chrome compatibility.

-- cgit v1.2.3-54-g00ecf