「MediaWiki:Mobile.css」の版間の差分
編集の要約なし |
編集の要約なし |
||
| 646行目: | 646行目: | ||
転スラWiki 外部画像スライドギャラリー | 転スラWiki 外部画像スライドギャラリー | ||
PC / タブレット / スマートフォン対応 | PC / タブレット / スマートフォン対応 | ||
・外部画像の生URLに対応 | |||
・縦長 / 横長 / 正方形を混在可能 | |||
・画像は絶対にトリミングしない | |||
・画像表示領域の高さを統一 | |||
・PCでは左右ボタン | |||
・スマホでは横スワイプ | |||
========================================================= */ | ========================================================= */ | ||
/* | /* ========================================================= | ||
ギャラリー全体 | 1. ギャラリー全体 | ||
-------- | ========================================================= */ | ||
.mw-parser-output .ts-gallery { | |||
--ts-gallery-image-height: 300px; | |||
position: relative; | position: relative; | ||
display: block; | display: block; | ||
| 667行目: | 676行目: | ||
.mw-parser-output .ts-gallery__title { | |||
.ts-gallery__title { | |||
margin: 0 0 0.6em; | margin: 0 0 0.6em; | ||
padding: 0; | padding: 0; | ||
| 678行目: | 686行目: | ||
/* | /* ========================================================= | ||
横スクロール領域 | 2. 横スクロール領域 | ||
========================================================= */ | |||
.ts-gallery__track { | .mw-parser-output .ts-gallery__track { | ||
display: flex !important; | display: flex !important; | ||
flex-flow: row nowrap !important; | flex-flow: row nowrap !important; | ||
| 692行目: | 700行目: | ||
max-width: 100% !important; | max-width: 100% !important; | ||
margin: 0; | margin: 0 !important; | ||
padding: 4px 46px 12px 2px; | padding: 4px 46px 12px 2px !important; | ||
overflow-x: auto !important; | overflow-x: auto !important; | ||
| 700行目: | 708行目: | ||
box-sizing: border-box; | box-sizing: border-box; | ||
scroll-snap-type: x mandatory; | scroll-snap-type: x mandatory; | ||
scroll-behavior: smooth; | scroll-behavior: smooth; | ||
| 707行目: | 714行目: | ||
overscroll-behavior-x: contain; | overscroll-behavior-x: contain; | ||
scrollbar-width: thin; | scrollbar-width: thin; | ||
scrollbar-color: #a2a9b1 transparent; | scrollbar-color: #a2a9b1 transparent; | ||
| 713行目: | 719行目: | ||
.ts-gallery__track::-webkit-scrollbar { | .mw-parser-output .ts-gallery__track::-webkit-scrollbar { | ||
height: 6px; | height: 6px; | ||
} | } | ||
.ts-gallery__track::-webkit-scrollbar-track { | .mw-parser-output .ts-gallery__track::-webkit-scrollbar-track { | ||
background: transparent; | background: transparent; | ||
} | } | ||
.ts-gallery__track::-webkit-scrollbar-thumb { | .mw-parser-output .ts-gallery__track::-webkit-scrollbar-thumb { | ||
background: #a2a9b1; | background: #a2a9b1; | ||
border-radius: 999px; | border-radius: 999px; | ||
| 729行目: | 735行目: | ||
/* | /* ========================================================= | ||
1枚ごとのカード | 3. 1枚ごとのカード | ||
========================================================= */ | |||
.ts-gallery__item { | .mw-parser-output .ts-gallery__item { | ||
/* | /* | ||
* | * 大きすぎず小さすぎないサイズ。 | ||
* | * 広いPCでは最大380px。 | ||
*/ | */ | ||
flex: 0 0 clamp(300px, 31vw, 380px) !important; | flex: 0 0 clamp(300px, 31vw, 380px) !important; | ||
| 742行目: | 748行目: | ||
width: clamp(300px, 31vw, 380px) !important; | width: clamp(300px, 31vw, 380px) !important; | ||
max-width: calc(100% - 24px) !important; | max-width: calc(100% - 24px) !important; | ||
min-width: 0 !important; | min-width: 0 !important; | ||
margin: 0; | margin: 0 !important; | ||
padding: 0; | padding: 0 !important; | ||
background: #fff; | background: #fff; | ||
| 753行目: | 758行目: | ||
border-radius: 5px; | border-radius: 5px; | ||
/* | |||
* カード外へのはみ出しだけを防ぐ。 | |||
* 画像本体は下で必ず枠内に収める。 | |||
*/ | |||
overflow: hidden; | overflow: hidden; | ||
| 762行目: | 771行目: | ||
/* | /* ========================================================= | ||
4. 画像表示領域 | |||
========================================================= */ | |||
.ts-gallery__imagebox { | .mw-parser-output .ts-gallery__imagebox { | ||
display: flex !important; | display: flex !important; | ||
align-items: center !important; | align-items: center !important; | ||
| 777行目: | 782行目: | ||
width: 100% !important; | width: 100% !important; | ||
height: | /* | ||
min-height: | * 全画像で表示領域の高さを統一 | ||
max-height: | */ | ||
height: var(--ts-gallery-image-height) !important; | |||
min-height: var(--ts-gallery-image-height) !important; | |||
max-height: var(--ts-gallery-image-height) !important; | |||
margin: 0 !important; | margin: 0 !important; | ||
| 786行目: | 794行目: | ||
background: #f8f9fa; | background: #f8f9fa; | ||
box-sizing: border-box; | |||
/* | |||
* 画像は100%×100% + containで | |||
* 必ずこの領域内に収まるため、 | |||
* ここではトリミング処理をしない。 | |||
*/ | |||
overflow: visible !important; | |||
} | } | ||
/* | /* ========================================================= | ||
5. 画像がリンクで囲まれた場合 | |||
========================================================= */ | |||
.ts-gallery__imagebox > a { | |||
display: | .mw-parser-output .ts-gallery__imagebox > a { | ||
display: block !important; | |||
width: 100% !important; | width: 100% !important; | ||
| 810行目: | 822行目: | ||
/* | /* ========================================================= | ||
画像本体 | 6. 画像本体 | ||
最重要部分 | |||
========================================================= */ | |||
/* | |||
* 重要: | |||
* | |||
* width:auto; | |||
* height:auto; | |||
* | |||
* は使用しない。 | |||
* | |||
* img自体に表示枠と同じサイズを与え、 | |||
* object-fit:contain で画像本体だけを | |||
* 縦横比を維持したまま収める。 | |||
* | |||
* これにより、 | |||
* | |||
* 縦長画像 → 左右に余白 | |||
* 横長画像 → 上下に余白 | |||
* 正方形 → 状況に応じて余白 | |||
* | |||
* となり、画像は一切切れない。 | |||
*/ | |||
.mw-parser-output .ts-gallery__imagebox > img, | |||
.mw-parser-output .ts-gallery__imagebox > a > img, | |||
.mw-parser-output .ts-gallery img.ts-gallery__image { | |||
display: block !important; | display: block !important; | ||
width: 100% !important; | |||
height: 100% !important; | |||
height: | |||
max-width: 100% !important; | max-width: 100% !important; | ||
| 837行目: | 862行目: | ||
min-height: 0 !important; | min-height: 0 !important; | ||
margin: | margin: 0 !important; | ||
padding: 0 !important; | padding: 0 !important; | ||
border: 0 !important; | |||
box-shadow: none !important; | |||
object-fit: contain !important; | object-fit: contain !important; | ||
object-position: center center !important; | object-position: center center !important; | ||
background: transparent !important; | |||
box-sizing: border-box !important; | |||
} | } | ||
/* | /* ========================================================= | ||
キャプション | 7. キャプション | ||
========================================================= */ | |||
.ts-gallery__caption { | .mw-parser-output .ts-gallery__caption { | ||
display: block; | display: block; | ||
width: 100%; | |||
margin: 0; | margin: 0; | ||
padding: 10px 12px 12px; | padding: 10px 12px 12px; | ||
color: #202122; | |||
background: #fff; | |||
font-size: 12px; | font-size: 12px; | ||
line-height: 1.6; | line-height: 1.6; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
overflow-wrap: anywhere; | overflow-wrap: anywhere; | ||
word-break: normal; | word-break: normal; | ||
| 882行目: | 902行目: | ||
.ts-gallery__caption p { | .mw-parser-output .ts-gallery__caption p { | ||
margin-top: 0; | margin-top: 0; | ||
margin-bottom: 0.4em; | margin-bottom: 0.4em; | ||
| 888行目: | 908行目: | ||
.ts-gallery__caption p:last-child { | .mw-parser-output .ts-gallery__caption p:last-child { | ||
margin-bottom: 0; | margin-bottom: 0; | ||
} | } | ||
.ts-gallery__source { | .mw-parser-output .ts-gallery__source { | ||
display: inline; | display: inline; | ||
color: #54595d; | |||
font-size: 11px; | font-size: 11px; | ||
line-height: 1.55; | line-height: 1.55; | ||
overflow-wrap: anywhere; | overflow-wrap: anywhere; | ||
| 905行目: | 925行目: | ||
.mw-parser-output .ts-gallery__caption a, | |||
.ts-gallery__caption a, | .mw-parser-output .ts-gallery__source a { | ||
.ts-gallery__source a { | |||
overflow-wrap: anywhere; | overflow-wrap: anywhere; | ||
} | } | ||
/* | /* ========================================================= | ||
左右移動ボタン | 8. 左右移動ボタン | ||
========================================================= */ | |||
.ts-gallery__nav { | .mw-parser-output .ts-gallery__nav { | ||
position: absolute; | position: absolute; | ||
/* | /* | ||
* | * 300px画像領域の中央付近 | ||
*/ | */ | ||
top: | top: calc( | ||
(var(--ts-gallery-image-height) / 2) | |||
+ 4px | |||
); | |||
z-index: 20; | z-index: 20; | ||
| 962行目: | 982行目: | ||
.ts-gallery__prev { | .mw-parser-output .ts-gallery__prev { | ||
left: 10px; | left: 10px; | ||
} | } | ||
.ts-gallery__next { | .mw-parser-output .ts-gallery__next { | ||
right: 10px; | right: 10px; | ||
} | } | ||
.ts-gallery__nav:hover { | .mw-parser-output .ts-gallery__nav:hover { | ||
background: #fff; | background: #fff; | ||
border-color: #72777d; | border-color: #72777d; | ||
| 978行目: | 998行目: | ||
.ts-gallery__nav:focus-visible { | .mw-parser-output .ts-gallery__nav:focus-visible { | ||
outline: 2px solid #36c; | outline: 2px solid #36c; | ||
outline-offset: 2px; | outline-offset: 2px; | ||
| 984行目: | 1,004行目: | ||
.ts-gallery__nav:disabled { | .mw-parser-output .ts-gallery__nav:disabled { | ||
opacity: 0.25; | opacity: 0.25; | ||
cursor: default; | cursor: default; | ||
| 991行目: | 1,011行目: | ||
/* | /* | ||
* | * スライドする必要がなければボタン非表示 | ||
*/ | */ | ||
.ts-gallery:not(.ts-gallery--scrollable) .ts-gallery__nav { | .mw-parser-output | ||
.ts-gallery:not(.ts-gallery--scrollable) | |||
.ts-gallery__nav { | |||
display: none; | display: none; | ||
} | } | ||
| 1,000行目: | 1,021行目: | ||
/* ========================================================= | /* ========================================================= | ||
9. タブレット | |||
========================================================= */ | ========================================================= */ | ||
@media screen and (max-width: 900px) { | @media screen and (max-width: 900px) { | ||
.ts-gallery__item { | .mw-parser-output .ts-gallery__item { | ||
flex-basis: clamp(290px, 45vw, 360px) !important; | flex-basis: clamp(290px, 45vw, 360px) !important; | ||
width: clamp(290px, 45vw, 360px) !important; | width: clamp(290px, 45vw, 360px) !important; | ||
| 1,014行目: | 1,035行目: | ||
/* ========================================================= | /* ========================================================= | ||
スマートフォン | 10. スマートフォン | ||
========================================================= */ | ========================================================= */ | ||
@media screen and (max-width: 720px) { | @media screen and (max-width: 720px) { | ||
.ts-gallery { | .mw-parser-output .ts-gallery { | ||
/* | |||
* スマホでは少し低くする。 | |||
* ただし全画像で同じ高さ。 | |||
*/ | |||
--ts-gallery-image-height: | |||
clamp(220px, 64vw, 270px); | |||
width: 100% !important; | width: 100% !important; | ||
max-width: 100% !important; | max-width: 100% !important; | ||
| 1,028行目: | 1,056行目: | ||
.ts-gallery__track { | .mw-parser-output .ts-gallery__track { | ||
width: 100% !important; | width: 100% !important; | ||
max-width: 100% !important; | max-width: 100% !important; | ||
| 1,041行目: | 1,065行目: | ||
/* | /* | ||
* | * 次のカードが少しだけ見える | ||
*/ | */ | ||
padding: 3px 30px 8px 0 !important; | padding: 3px 30px 8px 0 !important; | ||
| 1,052行目: | 1,075行目: | ||
/* | /* | ||
* | * スマホではスクロールバーを隠す | ||
*/ | */ | ||
scrollbar-width: none; | scrollbar-width: none; | ||
| 1,059行目: | 1,081行目: | ||
.mw-parser-output | |||
.ts-gallery__track::-webkit-scrollbar { | .ts-gallery__track::-webkit-scrollbar { | ||
display: none; | display: none; | ||
| 1,064行目: | 1,087行目: | ||
.ts-gallery__item { | .mw-parser-output .ts-gallery__item { | ||
/* | /* | ||
* | * vwではなく親要素基準。 | ||
* | * MobileFrontendでも本文幅からはみ出しにくい。 | ||
*/ | */ | ||
flex: 0 0 calc(100% - 28px) !important; | flex: | ||
0 0 calc(100% - 28px) !important; | |||
width: calc(100% - 28px) !important; | width: | ||
max-width: calc(100% - 28px) !important; | calc(100% - 28px) !important; | ||
max-width: | |||
calc(100% - 28px) !important; | |||
min-width: 0 !important; | min-width: 0 !important; | ||
| 1,083行目: | 1,105行目: | ||
/* | |||
* スマホでも画像本体は同じ原理。 | |||
* 100%×100%の領域内にcontain。 | |||
*/ | |||
.mw-parser-output | |||
.ts-gallery__imagebox > img, | |||
.mw-parser-output | |||
.ts-gallery__imagebox > a > img, | |||
.mw-parser-output | |||
. | |||
.ts-gallery img.ts-gallery__image { | .ts-gallery img.ts-gallery__image { | ||
width: | width: 100% !important; | ||
height: | height: 100% !important; | ||
max-width: 100% !important; | max-width: 100% !important; | ||
| 1,111行目: | 1,128行目: | ||
.ts-gallery__caption { | .mw-parser-output .ts-gallery__caption { | ||
padding: 9px 10px 11px !important; | padding: 9px 10px 11px !important; | ||
| 1,119行目: | 1,136行目: | ||
.ts-gallery__source { | .mw-parser-output .ts-gallery__source { | ||
font-size: 10.5px; | font-size: 10.5px; | ||
line-height: 1.55; | line-height: 1.55; | ||
| 1,125行目: | 1,142行目: | ||
.ts-gallery__nav { | .mw-parser-output .ts-gallery__nav { | ||
/ | top: calc( | ||
(var(--ts-gallery-image-height) / 2) | |||
+ 3px | |||
); | |||
width: 34px; | width: 34px; | ||
| 1,136行目: | 1,153行目: | ||
font-size: 23px; | font-size: 23px; | ||
background: rgba(255, 255, 255, 0.88); | background: | ||
rgba(255, 255, 255, 0.88); | |||
} | } | ||
.ts-gallery__prev { | .mw-parser-output .ts-gallery__prev { | ||
left: 5px; | left: 5px; | ||
} | } | ||
.ts-gallery__next { | .mw-parser-output .ts-gallery__next { | ||
right: 5px; | right: 5px; | ||
} | } | ||
| 1,153行目: | 1,171行目: | ||
/* ========================================================= | /* ========================================================= | ||
非常に狭いスマートフォン | 11. 非常に狭いスマートフォン | ||
========================================================= */ | ========================================================= */ | ||
@media screen and (max-width: 380px) { | @media screen and (max-width: 380px) { | ||
.ts- | .mw-parser-output .ts-gallery { | ||
--ts-gallery-image-height: 220px; | |||
} | } | ||
.ts- | .mw-parser-output .ts-gallery__track { | ||
padding-right: 24px !important; | |||
} | } | ||
.ts- | .mw-parser-output .ts-gallery__item { | ||
flex-basis: | |||
calc(100% - 22px) !important; | |||
width: | |||
calc(100% - 22px) !important; | |||
max-width: | |||
calc(100% - 22px) !important; | |||
} | } | ||
| 1,186行目: | 1,201行目: | ||
/* ========================================================= | /* ========================================================= | ||
印刷 | 12. 印刷 | ||
========================================================= */ | ========================================================= */ | ||
@media print { | @media print { | ||
.ts-gallery__track { | .mw-parser-output .ts-gallery__track { | ||
display: block !important; | display: block !important; | ||
overflow: visible !important; | overflow: visible !important; | ||
padding: 0 !important; | padding: 0 !important; | ||
} | } | ||
.ts-gallery__item { | .mw-parser-output .ts-gallery__item { | ||
display: inline-block !important; | display: inline-block !important; | ||
| 1,211行目: | 1,227行目: | ||
.ts-gallery__nav { | .mw-parser-output .ts-gallery__nav { | ||
display: none !important; | display: none !important; | ||
} | } | ||
} | } | ||
2026年9月2日 (水) 07:09時点における版
/* ここに記述した全てのCSSはモバイル版サイトの利用者に影響します */
/* ここに記述したCSSは携帯機器版サイトの利用者に影響します */
/* The message body cell(s), such as for {{Commonscat}}.
* this is a very small subset of the styles from Common.css
* just to make sure the box isn't squashed without any spacing
* which looks out of place with visuals of other nearby elements
*/
.mbox-text {
/* @noflip */
padding: 0.25em 0.9em;
}
/* Style for horizontal lists (separator following item).
@source mediawiki.org/wiki/Snippets/Horizontal_lists
@revision 9 (2016-08-10)
@author [[User:Edokter]]
*/
.mw-parser-output .hlist dl,
.mw-parser-output .hlist ol,
.mw-parser-output .hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.mw-parser-output .hlist li {
margin: 0;
display: inline;
}
/* reset hlist margins of Minerva
do not add li here (see T235416) */
.mw-parser-output .hlist dd,
.mw-parser-output .hlist dt {
margin-right: 0 !important;
display: inline;
}
/* Display nested lists inline */
.mw-parser-output .hlist.inline,
.mw-parser-output .hlist.inline dl,
.mw-parser-output .hlist.inline ol,
.mw-parser-output .hlist.inline ul,
.mw-parser-output .hlist dl dl, .mw-parser-output .hlist dl ol, .mw-parser-output .hlist dl ul,
.mw-parser-output .hlist ol dl, .mw-parser-output .hlist ol ol, .mw-parser-output .hlist ol ul,
.mw-parser-output .hlist ul dl, .mw-parser-output .hlist ul ol, .mw-parser-output .hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li,
.hlist .mw-empty-elt {
display: none;
}
/* Generate interpuncts */
.mw-parser-output .hlist dt:after {
content: ":";
}
.mw-parser-output .hlist dd:after,
.mw-parser-output .hlist li:after {
content: " ·" !important;
font-weight: bold;
padding-left: 0px;
}
.mw-parser-output .hlist dd:last-child:after,
.mw-parser-output .hlist dt:last-child:after,
.mw-parser-output .hlist li:last-child:after {
content: none !important;
}
/* Add parentheses around nested lists */
.mw-parser-output .hlist dd dd:first-child:before, .mw-parser-output .hlist dd dt:first-child:before, .mw-parser-output .hlist dd li:first-child:before,
.mw-parser-output .hlist dt dd:first-child:before, .mw-parser-output .hlist dt dt:first-child:before, .mw-parser-output .hlist dt li:first-child:before,
.mw-parser-output .hlist li dd:first-child:before, .mw-parser-output .hlist li dt:first-child:before, .mw-parser-output .hlist li li:first-child:before {
content: "(" !important;
font-weight: normal;
}
.mw-parser-output .hlist dd dd:last-child:after, .mw-parser-output .hlist dd dt:last-child:after, .mw-parser-output .hlist dd li:last-child:after,
.mw-parser-output .hlist dt dd:last-child:after, .mw-parser-output .hlist dt dt:last-child:after, .mw-parser-output .hlist dt li:last-child:after,
.mw-parser-output .hlist li dd:last-child:after, .mw-parser-output .hlist li dt:last-child:after, .mw-parser-output .hlist li li:last-child:after {
content: ")" !important;
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.mw-parser-output .hlist ol {
counter-reset: listitem;
}
.mw-parser-output .hlist ol > li {
counter-increment: listitem;
}
.mw-parser-output .hlist ol > li:before {
content: " " counter(listitem) ".\a0";
}
.mw-parser-output .hlist dd ol > li:first-child:before,
.mw-parser-output .hlist dt ol > li:first-child:before,
.mw-parser-output .hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
}
/* 日本語版の独自仕様。-pipe、-hyphen、-comma、-slash */
.mw-parser-output .hlist-pipe dd:after,
.mw-parser-output .hlist-pipe li:after {
content: " |" !important;
font-weight: normal;
}
.mw-parser-output .hlist-hyphen dd:after,
.mw-parser-output .hlist-hyphen li:after {
content: " -" !important;
font-weight: normal;
}
.mw-parser-output .hlist-comma dd:after,
.mw-parser-output .hlist-comma li:after {
content: "、" !important;
font-weight: normal;
}
.mw-parser-output .hlist-slash dd:after,
.mw-parser-output .hlist-slash li:after {
content: " /" !important;
font-weight: normal;
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
list-style: none none;
padding-left: 0; /* Reset Minerva defaults */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
/* 表が縦に長くなるのを防ぐ */
.wikitable, .tracklist {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: keep-all;
}
/* [[MediaWiki‐ノート:Common.css#Template:Math関連の更新提案]]
Generic class texhtml class for inline math */
span.texhtml {
font-family: serif;
white-space: nowrap;
}
/* Hide broken download box on [[Special:Book]] pending [[phab:T285400]] */
.mw-special-Book #coll-downloadbox {
display: none;
}
/* =========================================================
転スラWiki メインページ - Mobile
========================================================= */
.ts-main {
--ts-blue: #36c;
--ts-blue-dark: #2a4b8d;
--ts-blue-light: #f4f7fc;
--ts-border: #c8ccd1;
--ts-border-light: #eaecf0;
--ts-text: #202122;
--ts-subtext: #54595d;
--ts-muted: #72777d;
width: 100%;
margin: 0;
color: var(--ts-text);
box-sizing: border-box;
}
/* MediaWikiが自動生成する余計な空白対策 */
.ts-main > p,
.ts-main-section > p,
.ts-portal-grid > p,
.ts-grid-4 > p,
.ts-grid-2 > p,
.ts-main > br,
.ts-main-section > br,
.ts-portal-grid > br,
.ts-grid-4 > br,
.ts-grid-2 > br {
display: none !important;
}
/* =========================================================
Welcome
========================================================= */
.ts-welcome {
display: block;
margin: 0 0 16px;
padding: 14px;
border: 1px solid var(--ts-border);
border-radius: 5px;
background: #fff;
}
.ts-welcome-title {
margin: 0 0 5px;
font-size: 1.2rem;
font-weight: 700;
line-height: 1.4;
}
.ts-welcome-desc {
color: var(--ts-subtext);
font-size: .86rem;
line-height: 1.6;
}
.ts-spoiler-note {
color: var(--ts-muted);
font-size: .78rem;
}
.ts-welcome-count {
margin-top: 10px;
padding-top: 8px;
border-top: 1px solid var(--ts-border-light);
color: var(--ts-muted);
font-size: .82rem;
}
.ts-welcome-count strong {
color: var(--ts-blue-dark);
font-size: 1rem;
}
/* =========================================================
セクション見出し
========================================================= */
.ts-main-section {
margin: 16px 0 !important;
padding: 0 !important;
}
.ts-main-heading {
margin: 0 0 9px !important;
padding: 3px 0 6px 9px !important;
border: 0 !important;
border-left: 4px solid var(--ts-blue) !important;
border-bottom: 1px solid var(--ts-border-light) !important;
font-size: 1.08rem !important;
font-weight: 700 !important;
}
/* =========================================================
探す
スマホでも2列
========================================================= */
.ts-portal-grid {
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
overflow: hidden;
border: 1px solid var(--ts-border);
border-radius: 5px;
background: #fff;
}
.ts-portal-card {
display: block !important;
min-width: 0;
min-height: 112px;
margin: 0 !important;
padding: 12px !important;
border-right: 1px solid var(--ts-border-light);
border-bottom: 1px solid var(--ts-border-light);
box-sizing: border-box;
background: #fff;
}
.ts-portal-card:nth-of-type(2n) {
border-right: 0;
}
.ts-portal-card:nth-last-of-type(-n+2) {
border-bottom: 0;
}
.ts-portal-icon {
display: flex;
align-items: center;
justify-content: center;
width: 31px;
height: 31px;
margin-bottom: 7px;
border: 1px solid #a7b9d8;
border-radius: 4px;
background: #f8faff;
color: var(--ts-blue-dark);
font-size: .84rem;
font-weight: 700;
}
.ts-portal-title {
margin: 0 0 4px;
font-size: .91rem;
font-weight: 700;
line-height: 1.4;
}
.ts-portal-title a {
color: var(--ts-blue-dark);
}
.ts-portal-description {
margin: 0;
color: var(--ts-subtext);
font-size: .75rem;
line-height: 1.45;
}
.ts-portal-more {
display: none;
}
/* =========================================================
各パネル
========================================================= */
.ts-grid-4,
.ts-grid-2 {
display: grid !important;
grid-template-columns: 1fr !important;
overflow: hidden;
border: 1px solid var(--ts-border);
border-radius: 5px;
background: #fff;
}
.ts-panel {
min-width: 0;
margin: 0 !important;
padding: 14px !important;
border-right: 0;
border-bottom: 1px solid var(--ts-border-light);
box-sizing: border-box;
}
.ts-grid-4 > .ts-panel:last-of-type,
.ts-grid-2 > .ts-panel:last-of-type {
border-bottom: 0;
}
.ts-panel-heading {
display: flex;
align-items: center;
gap: 6px;
margin: 0 0 9px !important;
padding: 0 0 7px !important;
border-bottom: 1px solid var(--ts-border-light);
color: var(--ts-blue-dark);
font-size: .98rem;
font-weight: 700;
}
.ts-panel-symbol {
color: var(--ts-blue);
}
.ts-panel-content {
margin: 0 !important;
padding: 0 !important;
font-size: .86rem;
line-height: 1.6;
}
.ts-panel-content ul {
margin: 0 0 0 1.2em !important;
padding: 0 !important;
}
.ts-panel-footer {
margin-top: 9px;
text-align: right;
font-size: .79rem;
}
/* =========================================================
ピックアップ・今日のスキル
========================================================= */
.ts-pickup-label {
display: inline-block;
margin: 0 0 6px;
padding: 2px 6px;
border-radius: 3px;
background: #eef3fb;
color: var(--ts-blue-dark);
font-size: .7rem;
font-weight: 700;
}
.ts-pickup-title {
margin: 0 0 5px;
font-size: 1rem;
font-weight: 700;
}
.ts-pickup-text {
margin: 0;
color: var(--ts-subtext);
font-size: .84rem;
line-height: 1.55;
}
/* =========================================================
注目の記事
========================================================= */
.ts-focus-list {
margin: 0 !important;
padding: 0 !important;
list-style: none !important;
}
.ts-focus-list li {
position: relative;
margin: 0 !important;
padding: 6px 0 6px 14px !important;
border-bottom: 1px dotted #d8dfe8;
}
.ts-focus-list li:last-child {
border-bottom: 0;
}
.ts-focus-list li::before {
content: "›";
position: absolute;
left: 1px;
color: var(--ts-blue);
font-weight: 700;
}
/* =========================================================
新着・最近更新
========================================================= */
.ts-update-list {
margin: 0 !important;
padding: 0 !important;
list-style: none !important;
}
.ts-update-list li {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
margin: 0 !important;
padding: 6px 0 !important;
border-bottom: 1px dotted #d8dfe8;
}
.ts-update-list li:last-child {
border-bottom: 0;
}
.ts-update-title {
min-width: 0;
overflow-wrap: anywhere;
}
.ts-update-date {
flex-shrink: 0;
color: var(--ts-muted);
font-size: .73rem;
white-space: nowrap;
}
/* =========================================================
人気記事・急上昇
========================================================= */
.ts-ranking {
display: table;
width: 100%;
margin: 0 !important;
border: 0 !important;
border-collapse: collapse;
background: transparent !important;
}
.ts-ranking tr {
display: grid;
grid-template-columns: 24px minmax(0, 1fr) auto;
align-items: baseline;
width: 100%;
border-bottom: 1px dotted #d8dfe8;
}
.ts-ranking tr:last-child {
border-bottom: 0;
}
.ts-ranking td {
display: block;
min-width: 0;
padding: 6px 2px !important;
border: 0 !important;
background: transparent !important;
font-size: .83rem;
}
.ts-ranking-num {
color: var(--ts-muted);
text-align: center;
}
.ts-ranking-value {
padding-left: 8px !important;
color: var(--ts-muted);
text-align: right;
white-space: nowrap;
font-size: .75rem !important;
}
.ts-ranking-note {
margin: 0 0 7px;
color: var(--ts-muted);
font-size: .74rem;
line-height: 1.5;
}
.ts-up {
color: #14866d !important;
font-weight: 700;
}
/* =========================================================
編集案内
========================================================= */
.ts-edit-list {
margin: 0 !important;
padding-left: 1.2em !important;
}
.ts-edit-list li {
margin: 5px 0;
}
.ts-beginner-box {
margin-top: 11px;
padding: 10px;
border-left: 3px solid var(--ts-blue);
background: #f4f7fc;
font-size: .81rem;
}
.ts-beginner-title {
margin-bottom: 3px;
font-weight: 700;
}
/* =========================================================
作品紹介
========================================================= */
.ts-about {
margin: 0;
padding: 14px;
border: 1px solid var(--ts-border);
border-radius: 5px;
background: #f8f9fa;
font-size: .84rem;
line-height: 1.65;
}
.ts-about-title {
margin-bottom: 6px;
font-size: .98rem;
font-weight: 700;
}
/* =========================================================
下部ナビ
========================================================= */
.ts-subnav {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
margin: 16px 0 0;
padding: 9px 0;
border-top: 1px solid var(--ts-border-light);
border-bottom: 1px solid var(--ts-border-light);
font-size: .76rem;
line-height: 1.8;
}
.ts-subnav a {
margin: 2px 0;
padding: 0 8px;
border-right: 1px solid var(--ts-border);
}
.ts-subnav a:last-child {
border-right: 0;
}
/* =========================================================
かなり狭いスマホ
========================================================= */
@media screen and (max-width: 360px) {
.ts-portal-card {
min-height: 105px;
padding: 10px !important;
}
.ts-portal-title {
font-size: .86rem;
}
.ts-portal-description {
font-size: .71rem;
}
.ts-panel {
padding: 12px !important;
}
.ts-ranking td {
font-size: .8rem;
}
.ts-ranking-value {
font-size: .71rem !important;
}
}
/* =========================================================
転スラWiki 外部画像スライドギャラリー
PC / タブレット / スマートフォン対応
・外部画像の生URLに対応
・縦長 / 横長 / 正方形を混在可能
・画像は絶対にトリミングしない
・画像表示領域の高さを統一
・PCでは左右ボタン
・スマホでは横スワイプ
========================================================= */
/* =========================================================
1. ギャラリー全体
========================================================= */
.mw-parser-output .ts-gallery {
--ts-gallery-image-height: 300px;
position: relative;
display: block;
width: 100%;
max-width: 100%;
margin: 0.8em 0 1.5em;
padding: 0;
box-sizing: border-box;
}
.mw-parser-output .ts-gallery__title {
margin: 0 0 0.6em;
padding: 0;
font-size: 1.05em;
font-weight: 700;
line-height: 1.4;
}
/* =========================================================
2. 横スクロール領域
========================================================= */
.mw-parser-output .ts-gallery__track {
display: flex !important;
flex-flow: row nowrap !important;
align-items: flex-start !important;
gap: 12px;
width: 100% !important;
max-width: 100% !important;
margin: 0 !important;
padding: 4px 46px 12px 2px !important;
overflow-x: auto !important;
overflow-y: hidden !important;
box-sizing: border-box;
scroll-snap-type: x mandatory;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
overscroll-behavior-x: contain;
scrollbar-width: thin;
scrollbar-color: #a2a9b1 transparent;
}
.mw-parser-output .ts-gallery__track::-webkit-scrollbar {
height: 6px;
}
.mw-parser-output .ts-gallery__track::-webkit-scrollbar-track {
background: transparent;
}
.mw-parser-output .ts-gallery__track::-webkit-scrollbar-thumb {
background: #a2a9b1;
border-radius: 999px;
}
/* =========================================================
3. 1枚ごとのカード
========================================================= */
.mw-parser-output .ts-gallery__item {
/*
* 大きすぎず小さすぎないサイズ。
* 広いPCでは最大380px。
*/
flex: 0 0 clamp(300px, 31vw, 380px) !important;
width: clamp(300px, 31vw, 380px) !important;
max-width: calc(100% - 24px) !important;
min-width: 0 !important;
margin: 0 !important;
padding: 0 !important;
background: #fff;
border: 1px solid #a2a9b1;
border-radius: 5px;
/*
* カード外へのはみ出しだけを防ぐ。
* 画像本体は下で必ず枠内に収める。
*/
overflow: hidden;
box-sizing: border-box;
scroll-snap-align: start;
scroll-snap-stop: always;
}
/* =========================================================
4. 画像表示領域
========================================================= */
.mw-parser-output .ts-gallery__imagebox {
display: flex !important;
align-items: center !important;
justify-content: center !important;
width: 100% !important;
/*
* 全画像で表示領域の高さを統一
*/
height: var(--ts-gallery-image-height) !important;
min-height: var(--ts-gallery-image-height) !important;
max-height: var(--ts-gallery-image-height) !important;
margin: 0 !important;
padding: 0 !important;
background: #f8f9fa;
box-sizing: border-box;
/*
* 画像は100%×100% + containで
* 必ずこの領域内に収まるため、
* ここではトリミング処理をしない。
*/
overflow: visible !important;
}
/* =========================================================
5. 画像がリンクで囲まれた場合
========================================================= */
.mw-parser-output .ts-gallery__imagebox > a {
display: block !important;
width: 100% !important;
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
box-sizing: border-box;
}
/* =========================================================
6. 画像本体
最重要部分
========================================================= */
/*
* 重要:
*
* width:auto;
* height:auto;
*
* は使用しない。
*
* img自体に表示枠と同じサイズを与え、
* object-fit:contain で画像本体だけを
* 縦横比を維持したまま収める。
*
* これにより、
*
* 縦長画像 → 左右に余白
* 横長画像 → 上下に余白
* 正方形 → 状況に応じて余白
*
* となり、画像は一切切れない。
*/
.mw-parser-output .ts-gallery__imagebox > img,
.mw-parser-output .ts-gallery__imagebox > a > img,
.mw-parser-output .ts-gallery img.ts-gallery__image {
display: block !important;
width: 100% !important;
height: 100% !important;
max-width: 100% !important;
max-height: 100% !important;
min-width: 0 !important;
min-height: 0 !important;
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
box-shadow: none !important;
object-fit: contain !important;
object-position: center center !important;
background: transparent !important;
box-sizing: border-box !important;
}
/* =========================================================
7. キャプション
========================================================= */
.mw-parser-output .ts-gallery__caption {
display: block;
width: 100%;
margin: 0;
padding: 10px 12px 12px;
color: #202122;
background: #fff;
font-size: 12px;
line-height: 1.6;
box-sizing: border-box;
overflow-wrap: anywhere;
word-break: normal;
}
.mw-parser-output .ts-gallery__caption p {
margin-top: 0;
margin-bottom: 0.4em;
}
.mw-parser-output .ts-gallery__caption p:last-child {
margin-bottom: 0;
}
.mw-parser-output .ts-gallery__source {
display: inline;
color: #54595d;
font-size: 11px;
line-height: 1.55;
overflow-wrap: anywhere;
}
.mw-parser-output .ts-gallery__caption a,
.mw-parser-output .ts-gallery__source a {
overflow-wrap: anywhere;
}
/* =========================================================
8. 左右移動ボタン
========================================================= */
.mw-parser-output .ts-gallery__nav {
position: absolute;
/*
* 300px画像領域の中央付近
*/
top: calc(
(var(--ts-gallery-image-height) / 2)
+ 4px
);
z-index: 20;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
margin: 0;
padding: 0;
border: 1px solid rgba(84, 89, 93, 0.45);
border-radius: 50%;
background: rgba(255, 255, 255, 0.92);
color: #202122;
font-family: Arial, sans-serif;
font-size: 27px;
font-weight: normal;
line-height: 1;
cursor: pointer;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
transform: translateY(-50%);
transition:
background-color 0.15s ease,
opacity 0.15s ease,
border-color 0.15s ease;
}
.mw-parser-output .ts-gallery__prev {
left: 10px;
}
.mw-parser-output .ts-gallery__next {
right: 10px;
}
.mw-parser-output .ts-gallery__nav:hover {
background: #fff;
border-color: #72777d;
}
.mw-parser-output .ts-gallery__nav:focus-visible {
outline: 2px solid #36c;
outline-offset: 2px;
}
.mw-parser-output .ts-gallery__nav:disabled {
opacity: 0.25;
cursor: default;
}
/*
* スライドする必要がなければボタン非表示
*/
.mw-parser-output
.ts-gallery:not(.ts-gallery--scrollable)
.ts-gallery__nav {
display: none;
}
/* =========================================================
9. タブレット
========================================================= */
@media screen and (max-width: 900px) {
.mw-parser-output .ts-gallery__item {
flex-basis: clamp(290px, 45vw, 360px) !important;
width: clamp(290px, 45vw, 360px) !important;
}
}
/* =========================================================
10. スマートフォン
========================================================= */
@media screen and (max-width: 720px) {
.mw-parser-output .ts-gallery {
/*
* スマホでは少し低くする。
* ただし全画像で同じ高さ。
*/
--ts-gallery-image-height:
clamp(220px, 64vw, 270px);
width: 100% !important;
max-width: 100% !important;
margin: 0.6em 0 1.2em !important;
padding: 0 !important;
}
.mw-parser-output .ts-gallery__track {
width: 100% !important;
max-width: 100% !important;
gap: 9px;
margin: 0 !important;
/*
* 次のカードが少しだけ見える
*/
padding: 3px 30px 8px 0 !important;
overflow-x: auto !important;
overflow-y: hidden !important;
scroll-snap-type: x mandatory;
/*
* スマホではスクロールバーを隠す
*/
scrollbar-width: none;
}
.mw-parser-output
.ts-gallery__track::-webkit-scrollbar {
display: none;
}
.mw-parser-output .ts-gallery__item {
/*
* vwではなく親要素基準。
* MobileFrontendでも本文幅からはみ出しにくい。
*/
flex:
0 0 calc(100% - 28px) !important;
width:
calc(100% - 28px) !important;
max-width:
calc(100% - 28px) !important;
min-width: 0 !important;
}
/*
* スマホでも画像本体は同じ原理。
* 100%×100%の領域内にcontain。
*/
.mw-parser-output
.ts-gallery__imagebox > img,
.mw-parser-output
.ts-gallery__imagebox > a > img,
.mw-parser-output
.ts-gallery img.ts-gallery__image {
width: 100% !important;
height: 100% !important;
max-width: 100% !important;
max-height: 100% !important;
object-fit: contain !important;
object-position: center center !important;
}
.mw-parser-output .ts-gallery__caption {
padding: 9px 10px 11px !important;
font-size: 12px;
line-height: 1.6;
}
.mw-parser-output .ts-gallery__source {
font-size: 10.5px;
line-height: 1.55;
}
.mw-parser-output .ts-gallery__nav {
top: calc(
(var(--ts-gallery-image-height) / 2)
+ 3px
);
width: 34px;
height: 34px;
font-size: 23px;
background:
rgba(255, 255, 255, 0.88);
}
.mw-parser-output .ts-gallery__prev {
left: 5px;
}
.mw-parser-output .ts-gallery__next {
right: 5px;
}
}
/* =========================================================
11. 非常に狭いスマートフォン
========================================================= */
@media screen and (max-width: 380px) {
.mw-parser-output .ts-gallery {
--ts-gallery-image-height: 220px;
}
.mw-parser-output .ts-gallery__track {
padding-right: 24px !important;
}
.mw-parser-output .ts-gallery__item {
flex-basis:
calc(100% - 22px) !important;
width:
calc(100% - 22px) !important;
max-width:
calc(100% - 22px) !important;
}
}
/* =========================================================
12. 印刷
========================================================= */
@media print {
.mw-parser-output .ts-gallery__track {
display: block !important;
overflow: visible !important;
padding: 0 !important;
}
.mw-parser-output .ts-gallery__item {
display: inline-block !important;
width: 45% !important;
max-width: 45% !important;
margin: 0 2% 1em 0;
vertical-align: top;
}
.mw-parser-output .ts-gallery__nav {
display: none !important;
}
}