MediaWiki:Common.css: Difference between revisions

From Cramsession
Jump to navigationJump to search
(Created page with "→‎CSS placed here will be applied to all skins: →‎Style the main page InputBox wrapper: .mw-inputbox-form { display: flex; justify-content: center; align-items: center; gap: 10px; } →‎Make the text input field look modern and spacious: .mw-inputbox-form input[type="text"], .mw-inputbox-form input[type="search"] { padding: 12px 20px; font-size: 16px; border: 2px solid #ddd; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 41: Line 41:
.mw-inputbox-form input[type="submit"]:hover {
.mw-inputbox-form input[type="submit"]:hover {
     background-color: #1a252f;
     background-color: #1a252f;
}
/* 1. Turn the standard list into a responsive CSS Grid */
.cram-latest-grid ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}
/* 2. Style each list item as an authoritative card *
/* 3. Add hover animations to the cards */
.cram-latest-grid ul li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #3498db;
}
/* 4. Resurrect and style ONLY the Article Title link */
.cram-latest-grid ul {
    display: grid;
    /* Force 4 equal columns on desktop */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}
.cram-latest-grid ul li .mw-newpages-pagename:hover {
    color: #3498db !important;
}
/* 5. Hide any other sub-links (like talk pages, history, or user profile tools) */
.cram-latest-grid ul li a:not(.mw-newpages-pagename) {
    display: none !important;
}
/* Add a media query so it still looks great and stacks on mobile devices */
@media (max-width: 900px) {
    .cram-latest-grid ul {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}
@media (max-width: 600px) {
    .cram-latest-grid ul {
        grid-template-columns: 1fr; /* 1 column on phones */
    }
}
/* Hide the Special Pages link from the toolbox sidebar */
#t-specialpages {
    display: none !important;
}
}

Latest revision as of 01:21, 16 May 2026

/* CSS placed here will be applied to all skins */

/* Style the main page InputBox wrapper */
.mw-inputbox-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Make the text input field look modern and spacious */
.mw-inputbox-form input[type="text"], 
.mw-inputbox-form input[type="search"] {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mw-inputbox-form input[type="text"]:focus {
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* Style the search button to look like a modern CTA */
.mw-inputbox-form input[type="submit"] {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mw-inputbox-form input[type="submit"]:hover {
    background-color: #1a252f;
}

/* 1. Turn the standard list into a responsive CSS Grid */
.cram-latest-grid ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}

/* 2. Style each list item as an authoritative card *

/* 3. Add hover animations to the cards */
.cram-latest-grid ul li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #3498db;
}

/* 4. Resurrect and style ONLY the Article Title link */
.cram-latest-grid ul {
    display: grid;
    /* Force 4 equal columns on desktop */
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}

.cram-latest-grid ul li .mw-newpages-pagename:hover {
    color: #3498db !important;
}

/* 5. Hide any other sub-links (like talk pages, history, or user profile tools) */
.cram-latest-grid ul li a:not(.mw-newpages-pagename) {
    display: none !important;
}

/* Add a media query so it still looks great and stacks on mobile devices */
@media (max-width: 900px) {
    .cram-latest-grid ul {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}

@media (max-width: 600px) {
    .cram-latest-grid ul {
        grid-template-columns: 1fr; /* 1 column on phones */
    }
}

/* Hide the Special Pages link from the toolbox sidebar */
#t-specialpages {
    display: none !important;
}