MediaWiki:Common.css: Difference between revisions
Appearance
Cdjensen94 (talk | contribs) |
Cdjensen94 (talk | contribs) |
||
| Line 10: | Line 10: | ||
font-style: italic; | font-style: italic; | ||
border-radius: 4px; | border-radius: 4px; | ||
} | |||
/* Keep Special:ListFiles from overflowing the layout */ | |||
body.page-Special_ListFiles .continuum-body { | |||
overflow-x: auto; /* horizontal scroll if needed, not page-breaks */ | |||
} | |||
/* Make the table respect the container */ | |||
body.page-Special_ListFiles .mw-datatable.listfiles { | |||
width: 100%; | |||
max-width: 100%; | |||
table-layout: fixed; /* predictable column widths; enables wrapping */ | |||
border-collapse: collapse; | |||
} | |||
/* Wrap long content instead of blowing out */ | |||
body.page-Special_ListFiles .mw-datatable.listfiles th, | |||
body.page-Special_ListFiles .mw-datatable.listfiles td { | |||
white-space: normal; /* was often nowrap via defaults */ | |||
overflow-wrap: anywhere; /* modern wrap for very long strings */ | |||
word-break: break-word; /* fallback for older browsers */ | |||
} | |||
/* Keep thumbnails sane */ | |||
body.page-Special_ListFiles .mw-datatable.listfiles img { | |||
max-width: 100px; | |||
height: auto; | |||
} | |||
/* Reasonable fixed widths for the first couple columns (thumb + size) */ | |||
body.page-Special_ListFiles .mw-datatable.listfiles td:nth-child(1), | |||
body.page-Special_ListFiles .mw-datatable.listfiles th:nth-child(1) { | |||
width: 120px; /* thumbnail */ | |||
} | |||
body.page-Special_ListFiles .mw-datatable.listfiles td:nth-child(2), | |||
body.page-Special_ListFiles .mw-datatable.listfiles th:nth-child(2) { | |||
width: 120px; /* size / dims column (tweak if your layout differs) */ | |||
} | |||
/* Don’t let code-y bits (SHA1, MIME) refuse to wrap */ | |||
body.page-Special_ListFiles .mw-datatable.listfiles code, | |||
body.page-Special_ListFiles .mw-datatable.listfiles a, | |||
body.page-Special_ListFiles .mw-datatable.listfiles .mw-sha1, | |||
body.page-Special_ListFiles .mw-datatable.listfiles .mime-type { | |||
overflow-wrap: anywhere; | |||
word-break: break-word; | |||
} | |||
/* Safety net: prevent any rogue table inside from exceeding container width */ | |||
body.page-Special_ListFiles .continuum-body table { | |||
max-width: 100%; | |||
} | } | ||