مدیاویکی:Common.css: تفاوت میان نسخهها
از ویکییاد
بدون خلاصۀ ویرایش |
جزبدون خلاصۀ ویرایش |
||
| (۲۸ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
| خط ۱: | خط ۱: | ||
/* Import Vazirmatn from Google Fonts (supports Persian/Arabic very well) */ | /* Import Vazirmatn from Google Fonts (supports Persian/Arabic very well) */ | ||
@ | @font-face { | ||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Thin.woff2') format('woff2'); | |||
font-weight: 100; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-ExtraLight.woff2') format('woff2'); | |||
font-weight: 200; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Light.woff2') format('woff2'); | |||
font-weight: 300; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Regular.woff2') format('woff2'); | |||
font-weight: 400; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Medium.woff2') format('woff2'); | |||
font-weight: 500; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-SemiBold.woff2') format('woff2'); | |||
font-weight: 600; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Bold.woff2') format('woff2'); | |||
font-weight: 700; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-ExtraBold.woff2') format('woff2'); | |||
font-weight: 800; | |||
font-style: normal; | |||
} | |||
@font-face { | |||
font-family: 'VazirmatnFD'; | |||
src: url('/resources/fonts/Vazirmatn-FD-Black.woff2') format('woff2'); | |||
font-weight: 900; | |||
font-style: normal; | |||
} | |||
/* Apply Vazirmatn as the main UI font everywhere possible */ | /* Apply Vazirmatn as the main UI font everywhere possible */ | ||
body, | body, | ||
#p-logo-text a, | |||
#mw-page-base, | #mw-page-base, | ||
#mw-head-base, | #mw-head-base, | ||
| خط ۲۲: | خط ۸۴: | ||
.skin-vector-search-vue, | .skin-vector-search-vue, | ||
.skin-vector-2022 { /* Covers Vector 2022 skin - most common now */ | .skin-vector-2022 { /* Covers Vector 2022 skin - most common now */ | ||
font-family: | font-family: 'VazirmatnFD', 'Vazirmatn', "Noto Sans Arabic", "DejaVu Sans", Tahoma, Arial, sans-serif !important; | ||
font-feature-settings: "ss01" 1 !important; | |||
font-variant-numeric: normal !important; | |||
} | |||
:lang(fa) { | |||
font-feature-settings: "ss01" 1 !important; | |||
font-variant-numeric: normal !important; | |||
} | } | ||
| خط ۲۹: | خط ۹۸: | ||
.mw-first-heading, | .mw-first-heading, | ||
#firstHeading { | #firstHeading { | ||
font-family: | font-family: 'VazirmatnFD', 'Vazirmatn', "Noto Kufi Arabic", sans-serif !important; | ||
font-weight: 700; /* Medium-bold for better readability */ | font-weight: 700; /* Medium-bold for better readability */ | ||
} | } | ||
p {text-align: justify;} | |||
/* Code / monospace elements - keep a fallback monospace font */ | /* Code / monospace elements - keep a fallback monospace font */ | ||
code, pre, .mw-code { | code, pre, .mw-code { | ||
font-family: | font-family: 'VazirmatnFD', 'Vazirmatn', ui-monospace, monospace !important; | ||
} | } | ||
| خط ۴۳: | خط ۱۱۴: | ||
} | } | ||
/* color */ | |||
.mw-body h1.firstHeading, | |||
#mw-content-container { | |||
border-color: #dc2625; | |||
} | |||
/* ONLY apply these gallery changes on Category pages (ns-14) */ | |||
body.ns-14, .javidnam { | |||
/* Target gallery items from DPL or core gallery */ | |||
/* Restore gallery container layout (multi-column / flex) */ | |||
ul.gallery, | |||
.gallery, | |||
.dplgallery { | |||
display: flex !important; | |||
flex-wrap: wrap !important; | |||
list-style: none !important; | |||
padding: 0 !important; | |||
margin: 0 auto !important; | |||
justify-content: center !important; | |||
} | |||
/* Each box - keep square but allow horizontal flow */ | |||
li.gallerybox { | |||
position: relative !important; | |||
overflow: hidden !important; | |||
width: 200px !important; | |||
height: 200px !important; | |||
margin: 8px !important; | |||
padding: 0 !important; | |||
border: none !important; | |||
flex: 0 0 auto !important; /* don't grow, allow wrap */ | |||
display: inline-block !important; /* fallback */ | |||
background-color: #f8f9fa; /* fallback bg if image fails */ | |||
} | |||
/* Thumb div fills the box */ | |||
.gallerybox .thumb { | |||
position: absolute !important; | |||
inset: 0 !important; | |||
width: 100% !important; | |||
height: 100% !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | |||
/* Hide original image (already handled by your JS anyway) */ | |||
.gallerybox .thumb img { | |||
display: none !important; | |||
} | |||
/* Caption overlay at bottom - keep clickable */ | |||
.gallerybox .gallerytext { | |||
position: absolute !important; | |||
bottom: 0 !important; | |||
left: 0 !important; | |||
right: 0 !important; | |||
background: rgba(0,0,0,0.65) !important; | |||
color: white !important; | |||
text-align: center !important; | |||
padding: 6px 4px !important; | |||
margin: 0 !important; | |||
font-size: 0.9em !important; | |||
z-index: 10 !important; | |||
pointer-events: auto !important; /* clickable links */ | |||
box-sizing: border-box !important; | |||
} | |||
/* Ensure the link inside caption is clickable */ | |||
.gallerybox .gallerytext a { | |||
color: white !important; | |||
text-decoration: none !important; | |||
display: block !important; | |||
width: 100% !important; | |||
height: 100% !important; | |||
} | |||
/* Hover effect */ | |||
li.gallerybox:hover { | |||
transform: scale(1.04); | |||
transition: transform 0.25s ease; | |||
} | |||
ul.gallery, | |||
.gallery, | |||
.dplgallery { | |||
justify-content: center !important; | |||
} | |||
@media (max-width: 425px) { | |||
li.gallerybox { | |||
width: 180px !important; | |||
height: 180px !important; | |||
margin: 6px !important; /* slightly less spacing */ | |||
} | |||
} | |||
@media (max-width: 375px) { | |||
li.gallerybox { | |||
width: 160px !important; | |||
height: 160px !important; | |||
margin: 6px !important; /* slightly less spacing */ | |||
} | |||
} | |||
@media (max-width: 320px) { | |||
li.gallerybox { | |||
width: 135px !important; | |||
height: 135px !important; | |||
margin: 6px !important; /* slightly less spacing */ | |||
} | |||
} | |||
} | |||
/* Layout container */ | |||
.mw-category-group ul { | |||
list-style: none; | |||
} | |||
.cat-thumb-wrapper { | |||
display: inline-flex !important; | |||
align-items: center; | |||
padding: 5px 0; | |||
width: 100%; | |||
} | |||
/* Square image container */ | |||
.cat-thumb-container { | |||
width: 80px; | |||
height: 80px; | |||
min-width: 80px; | |||
margin-inline-end: 15px; /* Spacing between image and text */ | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
overflow: hidden; | |||
border-radius: 8px; | |||
border: 1px solid #eaecf0; | |||
background-color: #f8f9fa; | |||
} | |||
/* Force image to fill the 80x80 square */ | |||
.category-page-thumb { | |||
width: 80px !important; | |||
height: 80px !important; | |||
object-fit: cover; /* This crops the image into a square */ | |||
display: block; | |||
} | |||
/* Link styling */ | |||
.cat-thumb-link { | |||
font-weight: bold; | |||
font-size: 1.1em; | |||
text-decoration: none; | |||
} | |||
.cat-thumb-link:hover { | |||
text-decoration: underline; | |||
} | |||
/* Grayscale only the default icon */ | |||
.default-thumb { | |||
filter: grayscale(100%); | |||
opacity: 0.7; /* Optional: makes it look slightly more subtle/disabled */ | |||
transition: filter 0.3s ease; /* Smooth transition if you want to hover */ | |||
} | |||
/* | /* Optional: turn color back on when hovering over the row */ | ||
.cat-thumb-wrapper:hover .default-thumb { | |||
filter: grayscale(0%); | |||
opacity: 1; | |||
} | } | ||
.mw-search-result-thumb { | |||
float: right; | |||
margin: 0 0 1em 1em; | |||
margin | |||
} | } | ||
/* | /* === Fallback for gallery items with broken/missing images === */ | ||
.gallerybox .thumb { | /* Target thumbs that contain the broken-media placeholder */ | ||
.gallerybox .thumb:has(.mw-broken-media), | |||
.gallerybox .thumb span[typeof*="mw:Error"] { | |||
background-image: url('https://www.wikiyad.org/resources/assets/wikiyad_icon.png') !important; | |||
background-size: cover !important; | |||
background-position: center center !important; | |||
background-repeat: no-repeat !important; | |||
background-color: #f8f9fa !important; | |||
filter: grayscale(100%) !important; | |||
transition: filter 0.3s ease; | |||
} | } | ||
.gallerybox .thumb:has(.mw-broken-media):hover, | |||
.gallerybox .thumb | .gallerybox .thumb span[typeof*="mw:Error"] ~ .thumb:hover, | ||
.gallerybox .thumb:has(.mw-broken-media):hover { | |||
filter: grayscale(0%) !important; /* full color on hover */ | |||
} | |||
.gallerybox .thumb .mw-broken-media, | |||
.gallerybox .thumb span[typeof*="mw:Error"] { | |||
display: none !important; | display: none !important; | ||
} | } | ||
.gallerybox .thumb:has(.mw-broken-media) { | |||
.gallerybox . | display: block !important; | ||
min-height: 100% !important; | |||
} | } | ||
/* | /* If you want the fallback only on categories (more specific) */ | ||
.gallerybox . | body.category .gallerybox .thumb:has(.mw-broken-media) { | ||
/* same rules as above, or just repeat if specificity issues */ | |||
} | } | ||
blockquote { | |||
background: #efefef; | |||
padding: 5px 15px; | |||
border-radius: 10px; | |||
} | } | ||
نسخهٔ کنونی تا ۲۴ فوریهٔ ۲۰۲۶، ساعت ۱۹:۲۵
/* Import Vazirmatn from Google Fonts (supports Persian/Arabic very well) */
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Thin.woff2') format('woff2');
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-ExtraLight.woff2') format('woff2');
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Light.woff2') format('woff2');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Medium.woff2') format('woff2');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-SemiBold.woff2') format('woff2');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'VazirmatnFD';
src: url('/resources/fonts/Vazirmatn-FD-Black.woff2') format('woff2');
font-weight: 900;
font-style: normal;
}
/* Apply Vazirmatn as the main UI font everywhere possible */
body,
#p-logo-text a,
#mw-page-base,
#mw-head-base,
#content,
.mw-body,
.mw-body-content,
.vector-menu,
.vector-menu-heading,
.vector-menu-content,
#p-personal ul,
#footer,
.mw-indicators,
.mw-editsection,
.mw-parser-output,
input, button, select, textarea,
.oo-ui-labelElement-label,
.skin-vector,
.skin-vector-search-vue,
.skin-vector-2022 { /* Covers Vector 2022 skin - most common now */
font-family: 'VazirmatnFD', 'Vazirmatn', "Noto Sans Arabic", "DejaVu Sans", Tahoma, Arial, sans-serif !important;
font-feature-settings: "ss01" 1 !important;
font-variant-numeric: normal !important;
}
:lang(fa) {
font-feature-settings: "ss01" 1 !important;
font-variant-numeric: normal !important;
}
/* Headings - make them bolder or adjust if needed */
h1, h2, h3, h4, h5, h6,
.mw-first-heading,
#firstHeading {
font-family: 'VazirmatnFD', 'Vazirmatn', "Noto Kufi Arabic", sans-serif !important;
font-weight: 700; /* Medium-bold for better readability */
}
p {text-align: justify;}
/* Code / monospace elements - keep a fallback monospace font */
code, pre, .mw-code {
font-family: 'VazirmatnFD', 'Vazirmatn', ui-monospace, monospace !important;
}
/* Optional: Improve line height and spacing for Persian text */
body {
line-height: 1.7;
}
/* color */
.mw-body h1.firstHeading,
#mw-content-container {
border-color: #dc2625;
}
/* ONLY apply these gallery changes on Category pages (ns-14) */
body.ns-14, .javidnam {
/* Target gallery items from DPL or core gallery */
/* Restore gallery container layout (multi-column / flex) */
ul.gallery,
.gallery,
.dplgallery {
display: flex !important;
flex-wrap: wrap !important;
list-style: none !important;
padding: 0 !important;
margin: 0 auto !important;
justify-content: center !important;
}
/* Each box - keep square but allow horizontal flow */
li.gallerybox {
position: relative !important;
overflow: hidden !important;
width: 200px !important;
height: 200px !important;
margin: 8px !important;
padding: 0 !important;
border: none !important;
flex: 0 0 auto !important; /* don't grow, allow wrap */
display: inline-block !important; /* fallback */
background-color: #f8f9fa; /* fallback bg if image fails */
}
/* Thumb div fills the box */
.gallerybox .thumb {
position: absolute !important;
inset: 0 !important;
width: 100% !important;
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
}
/* Hide original image (already handled by your JS anyway) */
.gallerybox .thumb img {
display: none !important;
}
/* Caption overlay at bottom - keep clickable */
.gallerybox .gallerytext {
position: absolute !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
background: rgba(0,0,0,0.65) !important;
color: white !important;
text-align: center !important;
padding: 6px 4px !important;
margin: 0 !important;
font-size: 0.9em !important;
z-index: 10 !important;
pointer-events: auto !important; /* clickable links */
box-sizing: border-box !important;
}
/* Ensure the link inside caption is clickable */
.gallerybox .gallerytext a {
color: white !important;
text-decoration: none !important;
display: block !important;
width: 100% !important;
height: 100% !important;
}
/* Hover effect */
li.gallerybox:hover {
transform: scale(1.04);
transition: transform 0.25s ease;
}
ul.gallery,
.gallery,
.dplgallery {
justify-content: center !important;
}
@media (max-width: 425px) {
li.gallerybox {
width: 180px !important;
height: 180px !important;
margin: 6px !important; /* slightly less spacing */
}
}
@media (max-width: 375px) {
li.gallerybox {
width: 160px !important;
height: 160px !important;
margin: 6px !important; /* slightly less spacing */
}
}
@media (max-width: 320px) {
li.gallerybox {
width: 135px !important;
height: 135px !important;
margin: 6px !important; /* slightly less spacing */
}
}
}
/* Layout container */
.mw-category-group ul {
list-style: none;
}
.cat-thumb-wrapper {
display: inline-flex !important;
align-items: center;
padding: 5px 0;
width: 100%;
}
/* Square image container */
.cat-thumb-container {
width: 80px;
height: 80px;
min-width: 80px;
margin-inline-end: 15px; /* Spacing between image and text */
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
border-radius: 8px;
border: 1px solid #eaecf0;
background-color: #f8f9fa;
}
/* Force image to fill the 80x80 square */
.category-page-thumb {
width: 80px !important;
height: 80px !important;
object-fit: cover; /* This crops the image into a square */
display: block;
}
/* Link styling */
.cat-thumb-link {
font-weight: bold;
font-size: 1.1em;
text-decoration: none;
}
.cat-thumb-link:hover {
text-decoration: underline;
}
/* Grayscale only the default icon */
.default-thumb {
filter: grayscale(100%);
opacity: 0.7; /* Optional: makes it look slightly more subtle/disabled */
transition: filter 0.3s ease; /* Smooth transition if you want to hover */
}
/* Optional: turn color back on when hovering over the row */
.cat-thumb-wrapper:hover .default-thumb {
filter: grayscale(0%);
opacity: 1;
}
.mw-search-result-thumb {
float: right;
margin: 0 0 1em 1em;
}
/* === Fallback for gallery items with broken/missing images === */
/* Target thumbs that contain the broken-media placeholder */
.gallerybox .thumb:has(.mw-broken-media),
.gallerybox .thumb span[typeof*="mw:Error"] {
background-image: url('https://www.wikiyad.org/resources/assets/wikiyad_icon.png') !important;
background-size: cover !important;
background-position: center center !important;
background-repeat: no-repeat !important;
background-color: #f8f9fa !important;
filter: grayscale(100%) !important;
transition: filter 0.3s ease;
}
.gallerybox .thumb:has(.mw-broken-media):hover,
.gallerybox .thumb span[typeof*="mw:Error"] ~ .thumb:hover,
.gallerybox .thumb:has(.mw-broken-media):hover {
filter: grayscale(0%) !important; /* full color on hover */
}
.gallerybox .thumb .mw-broken-media,
.gallerybox .thumb span[typeof*="mw:Error"] {
display: none !important;
}
.gallerybox .thumb:has(.mw-broken-media) {
display: block !important;
min-height: 100% !important;
}
/* If you want the fallback only on categories (more specific) */
body.category .gallerybox .thumb:has(.mw-broken-media) {
/* same rules as above, or just repeat if specificity issues */
}
blockquote {
background: #efefef;
padding: 5px 15px;
border-radius: 10px;
}
