Aller au contenu

« MediaWiki:Common.js » : différence entre les versions

De Wiki de la Pluriversité Africaine des Savoirs
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 50 : Ligne 50 :
     .vector-pinnable-header-toggle-button:hover,
     .vector-pinnable-header-toggle-button:hover,
     .vector-pinnable-header-toggle-button:focus {
     .vector-pinnable-header-toggle-button:focus {
      background: #00ff5a !important;
      color: #000 !important;
      border-color: #00ff5a !important;
    }
  `;
  var style = document.createElement('style');
  style.innerHTML = css;
  document.head.appendChild(style);
});
mw.loader.using('mediawiki.util', function() {
  var css = `
    /* Boutons d'épinglage/désépinglage Vector */
    .vector-pinnable-header-toggle-button {
      display: inline-block !important;
      background: #000 !important;
      border: 1px solid #00ff5a !important;
      color: #00ff5a !important;
      padding: 4px 8px !important;
      font-size: 0.75rem !important;
      border-radius: 2px !important;
      cursor: pointer !important;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .vector-pinnable-header-toggle-button:hover,
    .vector-pinnable-header-toggle-button:focus {
      background: #00ff5a !important;
      color: #000 !important;
      border-color: #00ff5a !important;
    }
    /* Boutons de recherche et boutons Codex */
    .cdx-button,
    .cdx-search-input__end-button {
      background: #000 !important;
      border: 1px solid #00ff5a !important;
      color: #00ff5a !important;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .cdx-button:hover,
    .cdx-button:focus,
    .cdx-search-input__end-button:hover,
    .cdx-search-input__end-button:focus {
       background: #00ff5a !important;
       background: #00ff5a !important;
       color: #000 !important;
       color: #000 !important;

Version du 27 mai 2025 à 17:33

/* Tout JavaScript présent ici sera exécuté par tous les utilisateurs à chaque chargement de page. */
mw.loader.using('mediawiki.util', function() {
  var root = document.documentElement;
  // Fond et texte
  root.style.setProperty('--background-color-base', '#000', 'important');
  root.style.setProperty('--background-color-neutral-subtle', '#111', 'important');
  root.style.setProperty('--background-color-page-container', '#000', 'important');
  root.style.setProperty('--color-base', '#fff', 'important');
  document.body.style.background = '#000';
  document.body.style.color = '#fff';

  // Couleurs d'accent et liens
  root.style.setProperty('--color-progressive', '#00ff5a', 'important');
  root.style.setProperty('--color-link', '#00ff5a', 'important');
  root.style.setProperty('--color-link--visited', '#00ff5a', 'important');
  root.style.setProperty('--color-link--hover', '#fff', 'important');
  root.style.setProperty('--color-link--active', '#00ff5a', 'important');
  root.style.setProperty('--color-interactive', '#00ff5a', 'important');
  root.style.setProperty('--color-interactive--hover', '#fff', 'important');
  root.style.setProperty('--color-interactive--active', '#00ff5a', 'important');
  root.style.setProperty('--color-button', '#00ff5a', 'important');
  root.style.setProperty('--color-button--hover', '#fff', 'important');
  root.style.setProperty('--color-button--active', '#00ff5a', 'important');

  // Boutons radio et checkbox Codex/Codex
  root.style.setProperty('--cdx-color-accent', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--hover', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--active', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--focus', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--selected', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--checked', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--pressed', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--visited', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--disabled', '#00ff5a', 'important');
  root.style.setProperty('--cdx-color-accent--readonly', '#00ff5a', 'important');
});
mw.loader.using('mediawiki.util', function() {
  var css = `
    .vector-pinnable-header-toggle-button {
      display: inline-block !important;
      background: #000 !important;
      border: 2px solid #00ff5a !important;
      color: #00ff5a !important;
      padding: 4px 8px !important;
      font-size: 0.75rem !important;
      border-radius: 2px !important;
      cursor: pointer !important;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .vector-pinnable-header-toggle-button:hover,
    .vector-pinnable-header-toggle-button:focus {
      background: #00ff5a !important;
      color: #000 !important;
      border-color: #00ff5a !important;
    }
  `;
  var style = document.createElement('style');
  style.innerHTML = css;
  document.head.appendChild(style);
});
mw.loader.using('mediawiki.util', function() {
  var css = `
    /* Boutons d'épinglage/désépinglage Vector */
    .vector-pinnable-header-toggle-button {
      display: inline-block !important;
      background: #000 !important;
      border: 1px solid #00ff5a !important;
      color: #00ff5a !important;
      padding: 4px 8px !important;
      font-size: 0.75rem !important;
      border-radius: 2px !important;
      cursor: pointer !important;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .vector-pinnable-header-toggle-button:hover,
    .vector-pinnable-header-toggle-button:focus {
      background: #00ff5a !important;
      color: #000 !important;
      border-color: #00ff5a !important;
    }

    /* Boutons de recherche et boutons Codex */
    .cdx-button,
    .cdx-search-input__end-button {
      background: #000 !important;
      border: 1px solid #00ff5a !important;
      color: #00ff5a !important;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .cdx-button:hover,
    .cdx-button:focus,
    .cdx-search-input__end-button:hover,
    .cdx-search-input__end-button:focus {
      background: #00ff5a !important;
      color: #000 !important;
      border-color: #00ff5a !important;
    }
  `;
  var style = document.createElement('style');
  style.innerHTML = css;
  document.head.appendChild(style);
});