MediaWiki:Common.css: Difference between revisions

MediaWiki interface page
(Added hlist items to Common CSS)
(Added unbulleted lists and vgregion preview warning CSS)
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:


kbd:hover, kbd:focus {
kbd:hover, kbd:focus {
    box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 4px 0 #C0C0C0, 0 2px 35px rgba(#444, 0.3), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 7px 4px rgba(#444, 0.1);
  box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 4px 0 #C0C0C0, 0 2px 35px rgba(#444, 0.3), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 7px 4px rgba(#444, 0.1);
    transform: translateY(2px);
  transform: translateY(2px);
}
}


kbd:active {
kbd:active {
    box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 0 0 #C0C0C0, 0 0px 30px rgba(#444, 0.15), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 0px 4px rgba(#444, 0.25);
  box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 0 0 #C0C0C0, 0 0px 30px rgba(#444, 0.15), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 0px 4px rgba(#444, 0.25);
    transform: translateY(4px);  
  transform: translateY(4px);  
}
}


Line 40: Line 40:
.hlist ol,
.hlist ol,
.hlist ul {
.hlist ul {
margin: 0;
  margin: 0;
padding: 0;
  padding: 0;
}
}


Line 48: Line 48:
.hlist dt,
.hlist dt,
.hlist li {
.hlist li {
/* don't trust the note that says margin doesn't work with inline
  /* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again */
  * removing margin: 0 makes dds have margins again */
margin: 0;
  margin: 0;
display: inline;
  display: inline;
}
}


Line 68: Line 68:
.hlist ul ol,
.hlist ul ol,
.hlist ul ul {
.hlist ul ul {
display: inline;
  display: inline;
}
}


Line 74: Line 74:
.hlist .mw-empty-li,
.hlist .mw-empty-li,
.hlist .mw-empty-elt {
.hlist .mw-empty-elt {
display: none;
  display: none;
}
}


/* Generate interpuncts */
/* Generate interpuncts */
.hlist dt:after {
.hlist dt:after {
content: ": ";
  content: ": ";
}
}


.hlist dd:after,
.hlist dd:after,
.hlist li:after {
.hlist li:after {
content: " · ";
  content: " · ";
font-weight: bold;
  font-weight: bold;
}
}


Line 91: Line 91:
.hlist dt:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
.hlist li:last-child:after {
content: none;
  content: none;
}
}


Line 104: Line 104:
.hlist li dt:first-child:before,
.hlist li dt:first-child:before,
.hlist li li:first-child:before {
.hlist li li:first-child:before {
content: " (";
  content: " (";
font-weight: normal;
  font-weight: normal;
}
}


Line 117: Line 117:
.hlist li dt:last-child:after,
.hlist li dt:last-child:after,
.hlist li li:last-child:after {
.hlist li li:last-child:after {
content: ")";
  content: ")";
font-weight: normal;
  font-weight: normal;
}
}


/* Put ordinals in front of ordered list items */
/* Put ordinals in front of ordered list items */
.hlist ol {
.hlist ol {
counter-reset: listitem;
  counter-reset: listitem;
}
}


.hlist ol > li {
.hlist ol > li {
counter-increment: listitem;
  counter-increment: listitem;
}
}


.hlist ol > li:before {
.hlist ol > li:before {
content: " " counter(listitem) "\a0";
  content: " " counter(listitem) "\a0";
}
}


Line 137: Line 137:
.hlist dt ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
.hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
  content: " (" counter(listitem) "\a0";
}
 
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none none;
margin: 0;
}
 
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
 
/* Module:vgregion Preview Warning */
.vgr-preview-warning {
font-style: italic;
padding-left: 1.6em;
margin-bottom: 0.5em;
color: red;
}
}

Latest revision as of 20:58, 16 March 2024

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

/* Add styling for kbd HTML tag */
kbd {
  box-sizing: border-box;
  text-align: center;
  color: #555;
  cursor: pointer;
  margin: 0 8px;
  padding: 0 5px;
  border-color: #f2f2f2;
  border-style: solid;
  text-shadow: 0 0.5px 1px #777, 0 2px 6px #f2f2f2;
  border-width: 1px;
  border-radius: 5px;
  background: -webkit-linear-gradient(top, #f9f9f9 0%, #D2D2D2 80%, #c0c0c0 100%);
  font-family: sans-serif;
  display: inline-block;
  transition: box-shadow 0.3s ease, transform 0.15s ease;
  box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 6px 0 #C0C0C0, 0 8px 17px rgba(#444, 0.4), 2px 1px 4px rgba(#444, 0.25), -2px 1px 4px rgba(#444, 0.25), 0 9px 16px rgba(#444, 0.1);
}

kbd:hover, kbd:focus {
  box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 4px 0 #C0C0C0, 0 2px 35px rgba(#444, 0.3), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 7px 4px rgba(#444, 0.1);
  transform: translateY(2px);
}

kbd:active {
  box-shadow: 0 0 1px #888,0 1px 0 #fff, 0 0 0 #C0C0C0, 0 0px 30px rgba(#444, 0.15), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 0px 4px rgba(#444, 0.25);
  transform: translateY(4px); 
}

/**
 * Style for horizontal lists (separator following item).
 * @source https://www.mediawiki.org/wiki/Snippets/Horizontal_lists
 * @revision 9 (2016-08-10)
 * @author https://www.mediawiki.org/wiki/User:Edokter
 */
.hlist dl,
.hlist ol,
.hlist ul {
  margin: 0;
  padding: 0;
}

/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
  /* don't trust the note that says margin doesn't work with inline
   * removing margin: 0 makes dds have margins again */
  margin: 0;
  display: inline;
}

/* Display nested lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
  display: inline;
}

/* Hide empty list items */
.hlist .mw-empty-li,
.hlist .mw-empty-elt {
  display: none;
}

/* Generate interpuncts */
.hlist dt:after {
  content: ": ";
}

.hlist dd:after,
.hlist li:after {
  content: " · ";
  font-weight: bold;
}

.hlist dd:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
  content: none;
}

/* Add parentheses around nested lists */
.hlist dd dd:first-child:before,
.hlist dd dt:first-child:before,
.hlist dd li:first-child:before,
.hlist dt dd:first-child:before,
.hlist dt dt:first-child:before,
.hlist dt li:first-child:before,
.hlist li dd:first-child:before,
.hlist li dt:first-child:before,
.hlist li li:first-child:before {
  content: " (";
  font-weight: normal;
}

.hlist dd dd:last-child:after,
.hlist dd dt:last-child:after,
.hlist dd li:last-child:after,
.hlist dt dd:last-child:after,
.hlist dt dt:last-child:after,
.hlist dt li:last-child:after,
.hlist li dd:last-child:after,
.hlist li dt:last-child:after,
.hlist li li:last-child:after {
  content: ")";
  font-weight: normal;
}

/* Put ordinals in front of ordered list items */
.hlist ol {
  counter-reset: listitem;
}

.hlist ol > li {
  counter-increment: listitem;
}

.hlist ol > li:before {
  content: " " counter(listitem) "\a0";
}

.hlist dd ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
  content: " (" counter(listitem) "\a0";
}

/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
	line-height: inherit;
	list-style: none none;
	margin: 0;
}

.plainlist ol li,
.plainlist ul li {
	margin-bottom: 0;
}

/* Module:vgregion Preview Warning */
.vgr-preview-warning {
	font-style: italic;
	padding-left: 1.6em;
	margin-bottom: 0.5em;
	color: red;
}