Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.css: Difference between revisions

MediaWiki interface page
Created page with "CSS placed here will be applied to all skins: .carousel-container { overflow-x: auto; white-space: nowrap; padding: 10px; } .card { display: inline-block; vertical-align: top; width: 200px; margin-right: 12px; border: 1px solid #ccc; border-radius: 8px; padding: 8px; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); } .card-image { text-align: center; margin-bottom: 8px; } .card-title { font-weight: bold; font-size: 1.1em;..."
 
No edit summary
 
(136 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* CSS placed here will be applied to all skins */
/* CSS placed here will be applied to all skins */


.carousel-container {
html.skin-citizen-light {
  --card-bg: rgb(221, 229, 242);
  --card-text: #222222;
  --card-link: #007acc;
}
 
html.skin-citizen-dark {
  --card-bg: rgb(7, 10, 15);
  --card-text: #dddddd;
  --card-link: #66c0ff;
}
 
.card-carousel {
  display: flex;
   overflow-x: auto;
   overflow-x: auto;
  gap: 1rem;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  cursor: grab;
  user-select: auto;
   white-space: nowrap;
   white-space: nowrap;
   padding: 10px;
}
 
.card-carousel.dragging {
   cursor: grabbing;
  user-select: none;
}
}


.card {
.card {
   display: inline-block;
  flex: 0 0 200px;
   vertical-align: top;
   display: flex;
   width: 200px;
   flex-direction: column;
   margin-right: 12px;
   background: var(--card-bg);
   border: 1px solid #ccc;
   color: var(--card-text);
   border-radius: 8px;
   border: 1px solid var(--border-color-base);
   padding: 8px;
   border-radius: 10px;
   background: #fff;
   overflow: hidden;
   box-shadow: 0 2px 5px rgba(0,0,0,0.1);
   box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
  transition: box-shadow 0.25s ease-in-out, transform 0.2s ease-in-out, border-color 0.2s ease;
}
 
.tiny-card {
  height: 65px;
}
 
.short-card {
  height: 200px;
}
 
.tall-card {
  height: 360px;
}
 
.card:hover {
  transform: translateY(-3px);
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-color: var(--card-link);
}
}


.card-image {
.image-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
   text-align: center;
   text-align: center;
   margin-bottom: 8px;
}
 
.image-wrapper * {
   margin: 0 auto;
}
 
.image-wrapper img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
 
.card:hover .image-wrapper img {
  transform: scale(1.05);
}
 
.image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
  pointer-events: none;
}
 
.card:hover .image-wrapper::after {
  background-color: rgba(0, 0, 0, 0.05);
}
 
.card-content {
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
  gap: 0.5rem;
  flex: 1; /* Take up remaining space below image */
}
}


.card-title {
.card-title {
  font-size: 1rem;
   font-weight: bold;
   font-weight: bold;
   font-size: 1.1em;
  color: var(--card-text);
   margin-bottom: 4px;
  line-height: 1.3;
   text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  overflow: hidden;
  max-height: calc(1.3em * 2); /* Clamp to 2 lines */
  flex-shrink: 0;
}
 
.card-description {
   font-size: 0.85rem;
  color: var(--card-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  flex-grow: 1;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
 
.card:hover .card-description {
  opacity: 1;
}
 
.card-readmore {
  text-align: right;
   margin-top: auto; /* ← pins it to the bottom */
  font-size: 0.85rem;
}
 
.card-readmore a {
  font-size: 0.85rem;
  color: var(--card-link);
   text-decoration: none;
  transition: color 0.2s ease;
}
 
.card-readmore a span {
  display: inline-block;
  transition: transform 0.2s ease;
}
 
.card-readmore a:hover span {
  transform: translateX(4px);
}
}


.card-snippet {
.no-display {
   font-size: 0.9em;
   display: none;
  color: #444;
}
}

Latest revision as of 18:09, 31 May 2025

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

html.skin-citizen-light {
  --card-bg: rgb(221, 229, 242);
  --card-text: #222222;
  --card-link: #007acc;
}

html.skin-citizen-dark {
  --card-bg: rgb(7, 10, 15);
  --card-text: #dddddd;
  --card-link: #66c0ff;
}

.card-carousel {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  cursor: grab;
  user-select: auto;
  white-space: nowrap;
}

.card-carousel.dragging {
  cursor: grabbing;
  user-select: none;
}

.card {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--border-color-base);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
  transition: box-shadow 0.25s ease-in-out, transform 0.2s ease-in-out, border-color 0.2s ease;
}

.tiny-card {
  height: 65px;
}

.short-card {
  height: 200px;
}

.tall-card {
  height: 360px;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border-color: var(--card-link);
}

.image-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  text-align: center;
}

.image-wrapper * {
  margin: 0 auto;
}

.image-wrapper img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.card:hover .image-wrapper img {
  transform: scale(1.05);
}

.image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
  pointer-events: none;
}

.card:hover .image-wrapper::after {
  background-color: rgba(0, 0, 0, 0.05);
}

.card-content {
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
  gap: 0.5rem;
  flex: 1; /* Take up remaining space below image */
}

.card-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--card-text);
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  overflow: hidden;
  max-height: calc(1.3em * 2); /* Clamp to 2 lines */
  flex-shrink: 0;
}

.card-description {
  font-size: 0.85rem;
  color: var(--card-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  flex-grow: 1;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.card:hover .card-description {
  opacity: 1;
}

.card-readmore {
  text-align: right;
  margin-top: auto; /* ← pins it to the bottom */
  font-size: 0.85rem;
}

.card-readmore a {
  font-size: 0.85rem;
  color: var(--card-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-readmore a span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.card-readmore a:hover span {
  transform: translateX(4px);
}

.no-display {
  display: none;
}