MediaWiki:Common.css: Difference between revisions

From Mechabellum Wiki
(add infobox-nav)
(add breaking tables)
Line 43: Line 43:
   .infobox {
   .infobox {
     width:100%;
     width:100%;
    margin: 1em 0;
   }
   }
   .infobox-image {
   .infobox-image {
Line 48: Line 49:
   }
   }
}
}
@media (max-width:479px) {
@media (max-width:550px) {
   .infobox-image {
   .infobox-image {
     float: none;
     float: none;
Line 117: Line 118:
.note {
.note {
   color: #7a8288;
   color: #7a8288;
   transition: color .1s 2s;
   transition: color .3s 2s;
}
}


.note:hover {
.note:hover {
   color: inherit;
   color: inherit;
   transition: color .2s 0s;
   transition: color .1s 0s;
}
}


Line 131: Line 132:
   display: block;
   display: block;
   margin: .5em auto 0;
   margin: .5em auto 0;
}
/* table break */
@media (max-width:767px) {
  .table-block-last tr {
    display: block;
  }
  .table-block-last td {
    display: inline-block;
    color:#7a8288;
    font-weight: normal;
  }
  .table-block-last td {
    display: inline-block;
    border: none;
    vertical-align: middle;
    font-size: 1.3em;
  }
  .table-block-last td:last-child {
    display: block;
    border-bottom: 2px solid var(--dark);
    font-size: 1em;
  }
}
}

Revision as of 12:09, 12 June 2023

/* CSS placed here will be applied to all skins */

/* override defaults */
.mw-body .catlinks {
  background: none;
  border: none;
  border-top: 1px solid #a2a9b1;
}

/* Unit Infobox */
.infobox {
  float: right;
  margin: 0 0 1em 1em;
  padding: 1em;
  width: 280px;
  max-width: 100%;
}
.infobox-nav {
  width: 100%;
}
.infobox-nav a {
  opacity: .2;
  transition: opacity .2s;
}
.infobox-nav a:hover {
  opacity: 1;
}
.infobox-title {
  font-size: 2em;
  text-align: center;
}
.infobox-image {
  text-align: center;
}
.infobox-table th {
  vertical-align: top;
  width: 120px;
}
.infobox-table td {
  vertical-align: top;
}
@media (max-width:767px) {
  .infobox {
    width:100%;
    margin: 1em 0;
  }
  .infobox-image {
    float: right;
  }
}
@media (max-width:550px) {
  .infobox-image {
    float: none;
    width:100%;
  }
}


/* icon template */
.icon {
  position: relative;
  display: inline-block;
}

/* cost badge */
.icon .cost {
  position: absolute;
  right: 0;
  bottom: 0;
  background: #f99500;
  color: #222;
  font-weight: bold;
  line-height: 1em;
  padding: .1em .25em .2em 1.2em;
  box-shadow: -2px -2px 3px #0006;
  font-size: .9em;
}

.cost::before {
  --bg: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 40 47"><path id="half" d="M0 12 l20 -12 20 12 0 11 -20 12 -8 -4.8 20 -12 0 -2.4 -12 -7.2 -20 12" fill="currentcolor"/><use href="%23half" transform="rotate(180 20 23.5)" /></svg>');
  content: "";
  background: currentcolor;
  mask-image: var(--bg);
  -webkit-mask-image: var(--bg);
  position: absolute;
  width: .8em;
  height: .94em;
  top: .15em;
  left: .25em;
}

/* shadow as boder */
.icon-border img {
  box-sizing: content-box;
  padding: 6px;
  border-radius: 6px 1px;
  box-shadow: 0 0 3px 3px #eee6 inset;
}

/* colorize cyan */
.icon-Tech img {
  filter: sepia(100%) saturate(750%) hue-rotate(110deg);
  -webkit-filter:: sepia(100%) saturate(750%) hue-rotate(110deg);
  -moz-filter: sepia(100%) saturate(750%) hue-rotate(110deg);
}

/* override cost badge */
.icon-Tech .cost {
  right: 2px;
  bottom: 2px;
  background: #fff6;
  color: #222;
  padding: 0px 10px 1px;
  border-radius: 0 0 4px;
  box-shadow: none;
}

.note {
  color: #7a8288;
  transition: color .3s 2s;
}

.note:hover {
  color: inherit;
  transition: color .1s 0s;
}

.table .note::before {
  content: '';
  border-top: 1px solid #0002;
  width: 90%;
  display: block;
  margin: .5em auto 0;
}

/* table break */
@media (max-width:767px) {
  .table-block-last tr {
    display: block;
  }
  .table-block-last td {
    display: inline-block;
    color:#7a8288;
    font-weight: normal;
  }
  .table-block-last td {
    display: inline-block;
    border: none;
    vertical-align: middle;
    font-size: 1.3em;
  }
  .table-block-last td:last-child {
    display: block;
    border-bottom: 2px solid var(--dark);
    font-size: 1em;
  }
}