MediaWiki:Comparison.css

/** * Establishes a "character comparison" product type. * @author  Ursuul  * @version 1.0.2 */

/* Vars */ .comparison-footer, .comparison { --c-text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 1px 1px 0 #000000; --c-background-color: #2E2733; --c-border-color: #594D61; --c-border-width: 5px; --c-emblem-background-color: #43464A; --c-emblem-border-color: #2A2E36; }

/* Mobile fallback */ .comparison-mobile { display: none; }

/** Show mobile on documentation page **/ .c-show-mobile .comparison { display: none; }

.c-show-mobile .comparison-mobile { display: table; width: 100%; }

/* Comparison Container */ .comparison { display: flex; flex-direction: column; background-color: var(--c-background-color, #2E2733); border: var(--c-border-width, 5px) solid var(--c-border-color, #594D61); margin: 25px 0 0.75em; }

.comparison.has-footer { padding-bottom: calc(35px - var(--c-border-width, 5px)); }

.comparison .c-emblem { align-self: center; position: relative; cursor: help; }

.comparison .c-eborder { position: absolute; top: -24px; left: -20px; z-index: 40; width: 40px; height: 40px; overflow: hidden; background-color: var(--c-emblem-background-color, #43464A); border: 5px solid var(--c-emblem-border-color, #2A2E36); border-radius: 100%; box-sizing: border-box; }

.comparison .c-eborder:before { content: ""; display: block; position: absolute; top: 4px; left: 2pt; z-index: 50; width: 27px; height: 27px; background-image: url("data:image/svg+xml; base64, PHN2ZyB3aWR0aD0iMjA0LjEzOTgiIGhlaWdodD0iMTkzLjU0NiIgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZiNzAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxIiBzdHJva2Utd2lkdGg9IjUiPgogICAgICAgIDxjaXJjbGUgY3g9IjYyLjUiIGN5PSI2Mi41IiByPSI2MCIvPgogICAgICAgIDxjaXJjbGUgY3g9IjE0MS42Mzk4IiBjeT0iNjIuNSIgcj0iNjAiLz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMDIuMDY5OSIgY3k9IjEzMS4wNDYiIHI9IjYwIi8+CiAgICA8L2c+Cjwvc3ZnPg=="); background-size: 25px 25px; background-repeat: no-repeat; }

/* Comparison footer */ .comparison-footer { display: none; justify-content: center; align-items: center; width: calc(100% - (var(--c-border-width, 5px) * 2)); height: 35px; background-color: var(--c-background-color, #2E2733); color: #BFBFBF; border-top: 2px dotted; border-bottom: var(--c-border-width, 5px) solid; border-color: var(--c-border-color, #594D61); box-sizing: border-box; margin: calc(-0.75em + -35px) auto 0; }

.comparison-footer small { font-size: 11px; }

.comparison-footer a { font-weight: bold; color: inherit; text-decoration: underline; }

.comparison.has-footer + .comparison-footer { display: flex; }

.c-show-mobile .comparison.has-footer + .comparison-footer { all: unset; display: block; text-align: center; }

/* Header body */ .c-chars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }

.c-chars .c-char--container { display: flex; justify-content: center; align-items: center; position: relative; min-height: 70px; font-weight: bold; line-height: normal; color: #FFFFFF; text-align: center; text-shadow: var(--c-text-shadow); padding: 3px 5px 5px; box-sizing: border-box; }

.c-chars .c-char--container a { font-weight: inherit; color: inherit; }

.c-chars .c-char--container .c-char--link a { transform: initial; }

/* Shapes */ .c-track { --c-shape-scale--baseline: 6/10; --c-shape-scale: var(--c-shape-scale--baseline); display: flex; flex-wrap: wrap; justify-content: space-between; }

.c-track .c-container.xx-small { --c-shape-scale: 8/10 * var(--c-shape-scale--baseline); }

.c-track .c-container.x-small { --c-shape-scale: 9/10 * var(--c-shape-scale--baseline); }

.c-track .c-container.medium { --c-shape-scale: 10/10 * var(--c-shape-scale--baseline); }

.c-track .c-container.x-large { --c-shape-scale: 11/10 * var(--c-shape-scale--baseline); }

.c-track .c-container.xx-large { --c-shape-scale: 12/10 * var(--c-shape-scale--baseline); }

.c-container { display: inline-block; padding: 25px; }

.c-container.ERROR { display: none; }

.c-container .c-shape { position: relative; width: calc(130px * var(--c-shape-scale)); height: calc(130px * var(--c-shape-scale)); display: flex; justify-content: center; align-items: center; }

.c-container .c-shape .c-shape--link a, .c-container .c-shape .c-before, .c-container .c-shape .c-after, .c-chars .c-char--link a { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; transform: rotate(158deg); }

.c-container .c-shape .c-shape--link a:nth-child(2), .c-container .c-shape .c-after { transform: rotate(23deg); }

.c-container .c-shape .c-shape--link span, .c-container .c-shape .c-shape--link a, .c-chars .c-char--link { font-size: 0; background: transparent; color: transparent; z-index: 30; }

.c-container .c-shape .c-shape--link span { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; }

.c-container .c-shape .c-before[title], .c-container .c-shape .c-after[title] { cursor: help; }

.c-shape--body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; position: absolute; z-index: 20; width: calc(100% + (22px * var(--c-shape-scale))); overflow: hidden; font-weight: bold; font-size: calc(19px * var(--c-shape-scale)); line-height: calc(30px * var(--c-shape-scale)); color: #FFFFFF; text-align: center; text-overflow: ellipsis; text-shadow: var(--c-text-shadow); margin-top: calc(-2px * var(--c-shape-scale)); }

.c-shape--body p { display: contents; line-height: inherit; }

.c-shape--body a { color: inherit; }

/* Comparison Legend */ /** Legend container & positioning **/ .comparison .comparison-legend { align-self: flex-end; display: flex; flex-direction: column; list-style-type: none; color: #E6E6E6; padding: 0 1em 5px 0.25em; border-width: 2px 2px 0 2px; border-style: dotted; border-color: var(--c-border-color, #594D61); margin: 0; }

/** Legend items & labels **/ .comparison .comparison-legend li { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }

.comparison .comparison-legend li .legend-label { max-width: 300px; overflow: hidden; font-size: 14px; line-height: normal; text-overflow: ellipsis; white-space: nowrap; padding-right: 5px; cursor: help; }

/** Only display so many list-items **/ .comparison-legend.one li:nth-child(1) ~ li { display: none; }

.comparison-legend.two li:nth-child(2) ~ li { display: none; }

.comparison-legend.three li:nth-child(3) ~ li { display: none; }

.comparison-legend.four li:nth-child(4) ~ li { display: none; }

.comparison-legend.five li:nth-child(5) ~ li { display: none; }

/** Shapes in the legend **/ .comparison .comparison-legend div.c-container { --c-shape-scale: 1/15; display: inline-block; padding: 0; }

.comparison .comparison-legend .c-container .c-shape--body { display: none; }

/* Defalt colors, overridden by inline styles */ .c-chars { --c-color-1: #005BC9; --c-color-2: #9400C9; --c-color-3: #C90000; --c-color-4: #C99E00; --c-color-5: #00C900; }

.c-chars { background-image: linear-gradient(       to right,        var(--c-color-1) calc(100% *   0/100),        var(--c-color-1) calc(100% *  19/100),        var(--c-color-2) calc(100% *  21/100),        var(--c-color-2) calc(100% *  39/100),        var(--c-color-3) calc(100% *  41/100),        var(--c-color-3) calc(100% *  59/100),        var(--c-color-4) calc(100% *  61/100),        var(--c-color-4) calc(100% *  79/100),        var(--c-color-5) calc(100% *  81/100),        var(--c-color-5) calc(100% * 100/100)    ); }

.c-chars .c-char--container:nth-child(1) { border-color: var(--c-color-1); }

.c-chars .c-char--container:nth-child(2) { border-color: var(--c-color-2); }

.c-chars .c-char--container:nth-child(3) { border-color: var(--c-color-3); }

.c-chars .c-char--container:nth-child(4) { border-color: var(--c-color-4); }

.c-chars .c-char--container:nth-child(5) { border-color: var(--c-color-5); }