Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.css: Difference between revisions

MediaWiki interface page
Attempt to fix weird code block issues
m Reverted edit by Asexualdinosaur (talk) to last revision by Technofied
Tag: Rollback
 
(19 intermediate revisions by 2 users not shown)
Line 7: Line 7:
}
}


/* Base Admonition Styles */
/* Base Admonition Styling */
.admonition {
.admonition {
  max-width: 100%; /* Ensure the box does not exceed the container width */
   display: flex;
   display: flex;
   align-items: flex-start;
   align-items: flex-start;
Line 14: Line 15:
   padding: 16px;
   padding: 16px;
   margin: 1.5em 0;
   margin: 1.5em 0;
   border: 1px solid #ddd;
   border-top: none; /* Remove top border */
  border-right: none; /* Remove right border */
  border-bottom: none; /* Remove bottom border */
  border-left: 5px solid; /* Add a 5px solid left border */
  background-color: var(--admonition-bg, #e6ffed); /* Fallback to green */
  word-wrap: break-word; /* Ensure long words break inside the container */
  word-break: break-word; /* Alternative for modern CSS */
  overflow-wrap: break-word; /* Ensure long words break inside the container */
  box-sizing: border-box; /* Ensure padding and borders are included in the element's width */
}
}


.admonition-icon {
.admonition-icon pre,
   font-size: 24px;
.admonition-icon code,
   margin-right: 12px;
.admonition-icon .mw-code {
   display: flex;
   background-color: transparent !important;
   align-items: center;
  border: none !important;
   justify-content: center;
  color: inherit !important;
  padding: 0 !important;
   margin: 0 !important;
   font-family: inherit !important;
   font-size: inherit !important;
   display: inline !important;
}
}


Line 29: Line 43:
}
}


.admonition-title {
/* Reset Styling for Code Blocks within Admonitions */
  font-weight: bold;
.admonition-title code, .admonition-title pre,
   background-color: transparent;
.admonition-text code, .admonition-text pre,
   padding: 0;
.admonition-title .mw-code, .admonition-text .mw-code {
   border: none;
   background-color: transparent !important;
   display: inline-block; /* Use inline-block to allow margin */
   border: none !important;
   margin-bottom: 0; /* Adjust margin as needed */
   color: inherit !important;
}
   font-family: inherit !important;
 
  font-size: inherit !important;
.admonition-text {
   padding: 0 !important;
   margin: 0;
   margin: 0 !important;
   background-color: transparent;
   display: inline !important;
   padding: 0;
   word-wrap: break-word; /* Ensure text breaks within the container */
   border: none;
   word-break: break-word; /* Alternative for modern CSS */
   display: block; /* Ensure text is block-level */
   overflow-wrap: break-word; /* Ensure code blocks break properly within the container */
  box-sizing: border-box;
}
}


/* Specific Admonition Types */
/* Specific Admonition Types */
/* Note */
.admonition-note {
.admonition-note {
   background-color: #f0f6ff;
   --admonition-bg: #f0f8ff;
   border-left: 4px solid #2196f3;
  --admonition-color: #a2c2e0;
   border-left-color: #a2c2e0; /* Set the left border color */
}
}


/* Tip */
.admonition-tip {
.admonition-tip {
   background-color: #e6ffed;
   --admonition-bg: #e6ffed;
   border-left: 4px solid #4caf50;
   --admonition-color: #8acc90;
   display: flex;
   border-left-color: #8acc90; /* Set the left border color */
  align-items: center;
}
}


/* Caution */
.admonition-info {
.admonition-caution {
   --admonition-bg: #e7f5ff;
   background-color: #fff4e5;
  --admonition-color: #a3c2f0;
   border-left: 4px solid #ff9800;
   border-left-color: #a3c2f0; /* Set the left border color */
}
}


/* Warning */
.admonition-warning {
.admonition-warning {
   background-color: #ffe6e6;
   --admonition-bg: #fff8e1;
   border-left: 4px solid #f44336;
  --admonition-color: #eac261;
  border-left-color: #eac261; /* Set the left border color */
}
 
.admonition-danger {
  --admonition-bg: #ffe5e5;
  --admonition-color: #e09191;
   border-left-color: #e09191; /* Set the left border color */
}
 
 
/* Add space to the start of admonition text */
.admonition-text {
  margin-left: 0.25em; /* Adjust the space as needed */
  clear: both; /* Ensure no floating elements affect text alignment */
  overflow-wrap: break-word; /* Ensure text wraps within the container */
}
 
/* Ensure no extra space is added to the title */
.admonition-title {
  margin-left: 0;
  overflow: hidden; /* Prevent content from overflowing */
  text-overflow: ellipsis; /* Add ellipsis if content is too long */
  font-weight: bold; /* Make the title bold */
  overflow-wrap: break-word; /* Ensure text wraps within the container */
  word-break: break-word;
}
}

Latest revision as of 08:52, 26 August 2024

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

/* To make images responsive */
img {
	max-width:100%;
	height:auto;
}

/* Base Admonition Styling */
.admonition {
  max-width: 100%; /* Ensure the box does not exceed the container width */
  display: flex;
  align-items: flex-start;
  border-radius: 4px;
  padding: 16px;
  margin: 1.5em 0;
  border-top: none; /* Remove top border */
  border-right: none; /* Remove right border */
  border-bottom: none; /* Remove bottom border */
  border-left: 5px solid; /* Add a 5px solid left border */
  background-color: var(--admonition-bg, #e6ffed); /* Fallback to green */
  word-wrap: break-word; /* Ensure long words break inside the container */
  word-break: break-word; /* Alternative for modern CSS */
  overflow-wrap: break-word; /* Ensure long words break inside the container */
  box-sizing: border-box; /* Ensure padding and borders are included in the element's width */
}

.admonition-icon pre, 
.admonition-icon code, 
.admonition-icon .mw-code {
  background-color: transparent !important;
  border: none !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  display: inline !important;
}

.admonition-content {
  flex: 1;
}

/* Reset Styling for Code Blocks within Admonitions */
.admonition-title code, .admonition-title pre, 
.admonition-text code, .admonition-text pre,
.admonition-title .mw-code, .admonition-text .mw-code {
  background-color: transparent !important;
  border: none !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline !important;
  word-wrap: break-word; /* Ensure text breaks within the container */
  word-break: break-word; /* Alternative for modern CSS */
  overflow-wrap: break-word; /* Ensure code blocks break properly within the container */
  box-sizing: border-box;
}

/* Specific Admonition Types */
.admonition-note {
  --admonition-bg: #f0f8ff;
  --admonition-color: #a2c2e0;
  border-left-color: #a2c2e0; /* Set the left border color */
}

.admonition-tip {
  --admonition-bg: #e6ffed;
  --admonition-color: #8acc90;
  border-left-color: #8acc90; /* Set the left border color */
}

.admonition-info {
  --admonition-bg: #e7f5ff;
  --admonition-color: #a3c2f0;
  border-left-color: #a3c2f0; /* Set the left border color */
}

.admonition-warning {
  --admonition-bg: #fff8e1;
  --admonition-color: #eac261;
  border-left-color: #eac261; /* Set the left border color */
}

.admonition-danger {
  --admonition-bg: #ffe5e5;
  --admonition-color: #e09191;
  border-left-color: #e09191; /* Set the left border color */
}


/* Add space to the start of admonition text */
.admonition-text {
  margin-left: 0.25em; /* Adjust the space as needed */
  clear: both; /* Ensure no floating elements affect text alignment */
  overflow-wrap: break-word; /* Ensure text wraps within the container */
}

/* Ensure no extra space is added to the title */
.admonition-title {
  margin-left: 0;
  overflow: hidden; /* Prevent content from overflowing */
  text-overflow: ellipsis; /* Add ellipsis if content is too long */
  font-weight: bold; /* Make the title bold */
  overflow-wrap: break-word; /* Ensure text wraps within the container */
  word-break: break-word;
}