MediaWiki:Common.css: различия между версиями

Материал из Набег Wiki
Перейти к навигацииПерейти к поиску
Нет описания правки
Нет описания правки
Строка 11: Строка 11:
   }
   }


/* Основной контейнер: будет подстраиваться под ширину картинки */
/* CloudImage thumb — основной контейнер */
figure.cimg {
figure.cimg {
   display: inline-block;       /* shrink-wrap по контенту */
   display: inline-block;
   clear: both;
   clear: both;
   margin: 0.6em 0.6em;
   margin: 0.6em 0.6em;
   border: 1px solid #c8ccd1;
   border: 1px solid #c8ccd1;
   background-color: #fbfcfd;
   background-color: #fbfcfd;
   font-size: 0.95em;
   padding: 0.25em;
  line-height: 1.2;
  -webkit-box-shadow: 0 0 0 1px rgba(0,0,0,0.02) inset;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02) inset;
   vertical-align: top;
   vertical-align: top;
  padding: 0.25em;
}
}


/* Картинка — адаптивна внутри контейнера */
/* Убедимся, что картинка растягивается правильно внутри контейнера */
figure.cimg img {
figure.cimg img {
   display: block;
   display: block;
Строка 34: Строка 30:


/* Подпись */
/* Подпись */
figcaption.cimgcaption,
figure.cimg figcaption.cimgcaption {
figcaption.cimgcaption p {
   padding: 0.25em 0.35em 0.35em;
   padding: 0.25em 0.35em 0.35em;
  margin: 0;
  font-size: 0.92em;
  color: #222;
   text-align: left;
   text-align: left;
  color: #222;
  font-size: 0.92em;
  margin: 0;
}
}


/* Плавающие выравнивания — используем простые классы, похожие на MW */
/* --- Выравнивание: применяем float/центрирование к фигуре (высокая специфичность) --- */
figure.cimg.tright {
figure.cimg.tright {
   float: right;
   float: right !important;
   margin-left: 1em;
   margin-left: 1em !important;
   margin-bottom: 0.6em;
   margin-bottom: 0.6em !important;
}
}


figure.cimg.tleft {
figure.cimg.tleft {
   float: left;
   float: left !important;
   margin-right: 1em;
   margin-right: 1em !important;
   margin-bottom: 0.6em;
   margin-bottom: 0.6em !important;
}
}


/* Центрирование: блок по центру с подписью по центру */
figure.cimg.tcenter {
figure.cimg.tcenter {
   display: block;           /* центрируем как блочный элемент */
   display: block !important;
   margin-left: auto;
   margin-left: auto !important;
   margin-right: auto;
   margin-right: auto !important;
   text-align: center;
   text-align: center !important;
}
}


/* Отключить float (встроенный) */
/* none */
figure.cimg.tnone {
figure.cimg.tnone {
   float: none;
   float: none !important;
   display: block;
   display: block !important;
   margin-left: 0;
   margin-left: 0 !important;
   margin-right: 0;
   margin-right: 0 !important;
}
 
/* Небольшая адаптивная логика: при узком экране картинка занимает максимум ширины */
@media (max-width: 560px) {
  figure.cimg, figure.cimg.tcenter, figure.cimg.tnone {
    display: block;
    width: auto !important;
    max-width: 100%;
    margin-left: 0.25em;
    margin-right: 0.25em;
  }
}
}


/* --- Небольшой fallback: если по каким-то причинам класс остался на <img> --- */
figure.cimg img.tcenter {
figure.cimg img.tcenter {
   display: block;
   display: block;
Строка 89: Строка 73:
}
}


/* float-fallback — когда класс на img, плавающий эффект всё равно применяется */
figure.cimg img.tright {
figure.cimg img.tright {
   float: right;
   float: right;
Строка 102: Строка 85:
}
}


/* если вы захотите, чтобы при наличии tcenter на img и узком экране фигура вела себя как block */
/* Адаптив: на узком экране делаем thumb блочным и полушироким */
@media (max-width: 560px) {
@media (max-width: 560px) {
   figure.cimg img.tcenter { max-width: 100%; }
   figure.cimg, figure.cimg.tcenter, figure.cimg.tnone {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0.25em !important;
    margin-right: 0.25em !important;
  }
}
}

Версия от 01:18, 22 сентября 2025

/* Размещённый здесь CSS будет применяться ко всем темам оформления */
  .spoiler {
    background-color: D3D3D3; /* Or any other color to obscure the text */
    color: transparent;
    user-select: none; /* Prevents text selection while hidden */
  }

  .spoiler:hover {
    background-color: inherit; /* Reverts to parent background */
    color: inherit; /* Reveals the text color */
  }

/* CloudImage thumb — основной контейнер */
figure.cimg {
  display: inline-block;
  clear: both;
  margin: 0.6em 0.6em;
  border: 1px solid #c8ccd1;
  background-color: #fbfcfd;
  padding: 0.25em;
  vertical-align: top;
}

/* Убедимся, что картинка растягивается правильно внутри контейнера */
figure.cimg img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Подпись */
figure.cimg figcaption.cimgcaption {
  padding: 0.25em 0.35em 0.35em;
  margin: 0;
  font-size: 0.92em;
  color: #222;
  text-align: left;
}

/* --- Выравнивание: применяем float/центрирование к фигуре (высокая специфичность) --- */
figure.cimg.tright {
  float: right !important;
  margin-left: 1em !important;
  margin-bottom: 0.6em !important;
}

figure.cimg.tleft {
  float: left !important;
  margin-right: 1em !important;
  margin-bottom: 0.6em !important;
}

figure.cimg.tcenter {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

/* none */
figure.cimg.tnone {
  float: none !important;
  display: block !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* --- Небольшой fallback: если по каким-то причинам класс остался на <img> --- */
figure.cimg img.tcenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

figure.cimg img.tright {
  float: right;
  margin-left: 1em;
  margin-bottom: 0.6em;
}

figure.cimg img.tleft {
  float: left;
  margin-right: 1em;
  margin-bottom: 0.6em;
}

/* Адаптив: на узком экране делаем thumb блочным и полушироким */
@media (max-width: 560px) {
  figure.cimg, figure.cimg.tcenter, figure.cimg.tnone {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0.25em !important;
    margin-right: 0.25em !important;
  }
}