コンテンツにスキップ

テンプレート:Hlist/styles.css

提供:KANOTYPE WIKI
  1 /* {{pp-protected|reason=match parent|small=yes}} */
  2 /* 
  3  * hlist styles are defined in core and Minerva and differ in Minerva. The
  4  * current definitions here (2023-01-01) are sufficient to override Minerva
  5  * without use of the hlist-separated class. The most problematic styles were
  6  * related to margin, padding, and the bullet. Check files listed at
  7  * [[MediaWiki talk:Common.css/to do#hlist-separated]]
  8  */
  9 /*
 10  * TODO: When the majority of readership supports it (or some beautiful world
 11  * in which grade C support is above the minimum threshold), use :is()
 12  */
 13 .hlist dl,
 14 .hlist ol,
 15 .hlist ul {
 16 	margin: 0;
 17 	padding: 0;
 18 }
 19 
 20 /* Display list items inline */
 21 .hlist dd,
 22 .hlist dt,
 23 .hlist li {
 24 	/*
 25 	 * don't trust the note that says margin doesn't work with inline
 26 	 * removing margin: 0 makes dds have margins again
 27 	 * We also want to reset margin-right in Minerva
 28 	 */
 29 	margin: 0; 
 30 	display: inline;
 31 }
 32 
 33 /* Display requested top-level lists inline */
 34 .hlist.inline,
 35 .hlist.inline dl,
 36 .hlist.inline ol,
 37 .hlist.inline ul,
 38 /* Display nested lists inline */
 39 .hlist dl dl,
 40 .hlist dl ol,
 41 .hlist dl ul,
 42 .hlist ol dl,
 43 .hlist ol ol,
 44 .hlist ol ul,
 45 .hlist ul dl,
 46 .hlist ul ol,
 47 .hlist ul ul {
 48 	display: inline;
 49 }
 50 
 51 /* Hide empty list items */
 52 .hlist .mw-empty-li {
 53 	display: none;
 54 }
 55 
 56 /* TODO: :not() can maybe be used here to remove the later rule. naive test
 57  * seems to work. more testing needed. like so:
 58  *.hlist dt:not(:last-child)::after {
 59  *	content: ": ";
 60  *}
 61  *.hlist dd:not(:last-child)::after,
 62  *.hlist li:not(:last-child)::after {
 63  *	content: " · ";
 64  *	font-weight: bold;
 65  *}
 66  */
 67 /* Generate interpuncts */
 68 .hlist dt::after {
 69 	content: ": ";
 70 }
 71 
 72 .hlist dd::after,
 73 .hlist li::after {
 74 	content: " · ";
 75 	font-weight: bold;
 76 }
 77 
 78 .hlist dd:last-child::after,
 79 .hlist dt:last-child::after,
 80 .hlist li:last-child::after {
 81 	content: none;
 82 }
 83 
 84 /* Add parentheses around nested lists */
 85 .hlist dd dd:first-child::before,
 86 .hlist dd dt:first-child::before,
 87 .hlist dd li:first-child::before,
 88 .hlist dt dd:first-child::before,
 89 .hlist dt dt:first-child::before,
 90 .hlist dt li:first-child::before,
 91 .hlist li dd:first-child::before,
 92 .hlist li dt:first-child::before,
 93 .hlist li li:first-child::before {
 94 	content: " (";
 95 	font-weight: normal;
 96 }
 97 
 98 .hlist dd dd:last-child::after,
 99 .hlist dd dt:last-child::after,
100 .hlist dd li:last-child::after,
101 .hlist dt dd:last-child::after,
102 .hlist dt dt:last-child::after,
103 .hlist dt li:last-child::after,
104 .hlist li dd:last-child::after,
105 .hlist li dt:last-child::after,
106 .hlist li li:last-child::after {
107 	content: ")";
108 	font-weight: normal;
109 }
110 
111 /* Put ordinals in front of ordered list items */
112 .hlist ol {
113 	counter-reset: listitem;
114 }
115 
116 .hlist ol > li {
117 	counter-increment: listitem;
118 }
119 
120 .hlist ol > li::before {
121 	content: " " counter(listitem) "\a0";
122 }
123 
124 .hlist dd ol > li:first-child::before,
125 .hlist dt ol > li:first-child::before,
126 .hlist li ol > li:first-child::before {
127 	content: " (" counter(listitem) "\a0";
128 }