MediaWiki

Difference between revisions of "Common.css"

From Shadow Era Wiki

m
m
Line 72: Line 72:
  
 
/* ----------------------------- */
 
/* ----------------------------- */
/* Responsive Design for Code Blocks and Tables on Mobile */
+
/* Styles for Card Template */
 +
/* This section contains styles for the card layout, ensuring that the
 +
  image and table are displayed correctly on both large and small screens.
 +
  It uses Flexbox for a responsive design. */
 
/* ----------------------------- */
 
/* ----------------------------- */
  
/* Responsive Code Blocks */
+
/* Container for the card image and table */
pre, code, .syntaxhighlight {
+
.card-container {
     white-space: pre-wrap !important;
+
     display: flex;
     word-wrap: break-word !important;
+
    flex-wrap: wrap;
     max-width: 100% !important; /* Ensures blocks do not exceed screen width */
+
     align-items: flex-start;
 +
     gap: 20px;
 +
    margin-bottom: 20px;
 
}
 
}
  
/* Responsive Tables */
+
/* Style for the card image */
table {
+
.card-image {
     width: 100% !important;
+
     flex: 0 0 300px;
    table-layout: auto !important; /* Allows columns to adjust automatically */
+
    word-wrap: break-word !important; /* Forces line breaks within tables */
+
 
}
 
}
  
/* Specific Styles for Small Screens */
+
/* Style for the card information (table) */
@media only screen and (max-width: 600px) {
+
.card-info {
     table {
+
    flex: 1;
         display: block; /* Allow horizontal scrolling for tables */
+
    min-width: 200px;
        overflow-x: auto;
+
}
 +
 
 +
/* Responsive adjustments for small screens */
 +
@media (max-width: 600px) {
 +
     .card-container {
 +
         display: block;
 
     }
 
     }
  
     pre, code, .syntaxhighlight {
+
     .card-image, .card-info {
         font-size: 12px !important; /* Reduce font size in code blocks for small screens */
+
         width: 100%;
 +
        margin: 0;
 
     }
 
     }
}
 
  
/* Flexible Layout for Code Tables */
+
    .card-image img {
.code-table {
+
        width: 100% !important;
    width: 100% !important;
+
        height: auto;
    table-layout: auto !important; /* Ensures tables with code blocks are flexible */
+
    }
 
}
 
}

Revision as of 06:24, 28 September 2024

/* 
   Ajustements de style pour les petits écrans (moins de 600px de large) 
   - Les tableaux (.wikitable) prennent toute la largeur de l'écran disponible.
   - Les images s'ajustent à 100% de la largeur de leur conteneur, tout en conservant leurs proportions.
*/
@media only screen and (max-width: 600px) {
    .wikitable {
        width: 100% !important;
    }
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}
/* ----------------------------- */
/* Styling for Inline Code and C# Syntax Highlighting */
/* ----------------------------- */
 
/* Style the backtick text */
.backtick-style {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border: 1px solid #d1d5da;
    border-radius: 3px;
}
 
/* Style parentheses (like () in C#) */
.csharp.source-csharp .br0 {
    color: hsl(32, 93%, 66%) !important;  /* Orange for parentheses */
}
 
/* Style comments in C# syntax */
.csharp.source-csharp .co1 {
    color: hsl(221, 12%, 69%) !important;  /* Light blue for comments */
}
 
/* Style keywords in C# syntax */
.csharp.source-csharp .kw1 {
    color: hsl(357, 75%, 77%) !important;  /* Light red for main keywords */
}
 
.csharp.source-csharp .kw3, .csharp.source-csharp .kw4 {
    color: hsl(300, 30%, 68%) !important;  /* Pink for additional keywords */
}
 
/* Style methods in C# syntax */
.csharp.source-csharp .me1 {
    color: hsl(210, 50%, 60%) !important;  /* Light blue for methods */
}
 
/* Style numbers in C# syntax */
.csharp.source-csharp .nu0 {
    color: hsl(32, 93%, 66%) !important;  /* Orange for numbers */
}
 
/* Style symbols in C# syntax */
.csharp.source-csharp .sy0 {
    color: hsl(116, 73%, 51%) !important;  /* Green for symbols */
}
 
/* Style strings in C# syntax */
.csharp.source-csharp .st0 {
    color: hsl(114, 31%, 68%) !important;  /* Light green for strings */
}
 
/* General background and text color for code blocks */
.syntaxhighlight {
    background-color: hsl(210, 15%, 22%) !important;  /* Background */
    color: hsl(219, 28%, 88%) !important;  /* General text color */
}
 
/* ----------------------------- */
/* Styles for Card Template */
/* This section contains styles for the card layout, ensuring that the 
   image and table are displayed correctly on both large and small screens. 
   It uses Flexbox for a responsive design. */
/* ----------------------------- */
 
/* Container for the card image and table */
.card-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}
 
/* Style for the card image */
.card-image {
    flex: 0 0 300px;
}
 
/* Style for the card information (table) */
.card-info {
    flex: 1;
    min-width: 200px;
}
 
/* Responsive adjustments for small screens */
@media (max-width: 600px) {
    .card-container {
        display: block;
    }
 
    .card-image, .card-info {
        width: 100%;
        margin: 0;
    }
 
    .card-image img {
        width: 100% !important;
        height: auto;
    }
}