MediaWiki:Common.css

From Ironclad Wiki
Revision as of 20:36, 11 August 2025 by X5f4k4 (talk | contribs) (Created page with "CSS placed here will be applied to all skins: Ironclad pressable buttons: .ic-btn { --press-depth: 8px; how far it moves down on press: --squash: 0.94; vertical squish on press: position: relative; display: inline-block; border-radius: 10px; match your tile corners: transition: transform 120ms ease, filter 120ms ease; } Make the image fill the button area cleanly: .ic-btn > img { display: block; width: 100%;...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* CSS placed here will be applied to all skins */
 /* Ironclad pressable buttons */
.ic-btn {
  --press-depth: 8px;     /* how far it moves down on press */
  --squash: 0.94;         /* vertical squish on press */
  position: relative;
  display: inline-block;
  border-radius: 10px;    /* match your tile corners */
  transition: transform 120ms ease, filter 120ms ease;
}

/* Make the image fill the button area cleanly */
.ic-btn > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  pointer-events: none; /* so clicks hit the anchor */
}

/* Bottom “shadow bar” that can slide down out of view */
.ic-btn::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  height: 12px;
  bottom: -8px;                 /* sits just below the tile */
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  filter: blur(0.5px);
  transition: transform 120ms ease, opacity 120ms ease;
}

/* Press state: move down, squish, and slide the shadow away */
.ic-btn:active,
.ic-btn.is-pressed {
  transform: translateY(var(--press-depth)) scaleY(var(--squash));
  transform-origin: top center; /* makes the top “scrunch” */
}

.ic-btn:active::after,
.ic-btn.is-pressed::after {
  transform: translateY(18px);  /* slides shadow out of view */
  opacity: 0;
}

/* Optional: hover lift for mouse users */
.ic-btn:hover { transform: translateY(-1px); }
.ic-btn:hover::after { opacity: 0.55; }