Template talk:Ambox

From OpenStreetMap Wiki
Jump to navigation Jump to search

I'm aiming to use this ambox in aid of creating some uniform templates/labels for the WikiProject Cleanup. As part of that, I'm going to update this template to re-implement a few of the feature missing form the Wikipedia version of the box here.

Our implementation is pretty different from their implementation now, and I feel we could do with our own documentation, so that next time someone comes along trying to work out how to use this box, they don't head over the wiki and get confused as our version doesn't implement some of the features. Example's, small text is new and their type= category changes more than the picture. I think most of this is CSS on their end, so not easily just copied over to here.

Martin Renvoize 16:54, 26 November 2009 (UTC)

Categories and colours

Amboxes are divided into various types. Each type should have a corresponding colour code. The colour-coding helps to inform of the severity of the issues at a glance.

  Code Name Description Example Templates
  #b22222 Speedy Immediate deletion {{Db-meta}}
  #b22222 Deletion Full-discussion deletion; proposed deletion {{Afd}}, {{Prod}}
  #f28500 Content Problems with the content of an article, i.e., what the article actually says {{POV}}, {{Globalize}}
  #f4c430 Style Problems not with the content, but how it is formatted/presented {{Cleanup}}, {{Wikify}}
  #1e90ff Notice Information readers/editors should be aware of {{Current}}, {{Recent death}}
  #9932cc Move Merge, split and transwiki proposals {{Split}}, {{Copy to wiktionary}}
  #bba Protection Page is locked against edits {{Pp-protected}}

New Colors

Amboxes are divided into various types. Each type should have a corresponding colour code. The colour-coding helps to inform of the severity of the issues at a glance.

  Code Name Description Example Templates
  #b22222 (#ffaaaa) Danger To Really Warn a User! {{Delete}}
  #b22222 (#ffdddd) Warning To Warn a User! {{Delete}}
  #f28500 (#ffffaa) Caution To Caution a User! {{Cleaning}}
  #f4c430 Proposal Content Proposals. Cleaning {{Cleanup}}
  #00ff00 (#deffde) Approval All Clear Signal! {{Cleaned}}
  #9932cc Detail Merge, split and transwiki proposals {{Split}}, {{Copy to wiktionary}}
  #1e90ff Notice Information readers/editors should be aware of {{Current}}, {{Recent death}}
  #bbbbaa Protection Page is locked against edits {{Pp-protected}}

Original Code (Relying Upon CSS)

Template Documentation


The CSS Injection

This is a slightly modified version of the WikiPedia CSS for MediaWiki:Common.css

/* Article message box styles */
table.ambox {
    margin: 0px 10%;   /* 10% = Will not overlap with other elements */
    border: 1px solid #aaa; 
    border-left: 10px solid #1e90ff;    /* Default "notice" blue */
    background: #fbfbfb; 
}
table.ambox + table.ambox {   /* Single border between stacked boxes. */
    margin-top: -1px;
}
.ambox th.mbox-text, 
.ambox td.mbox-text {            /* The message body cell(s) */
    padding: 0.25em 0.5em;       /* 0.5em left/right */
}
.ambox td.mbox-image {           /* The left image cell */
    padding: 2px 0 2px 0.5em;    /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright {      /* The right image cell */
    padding: 2px 0.5em 2px 0;    /* 0px left, 0.5em right */
}
 
table.ambox-notice {
    border-left: 10px solid #1e90ff;    /* Blue */
}
table.ambox-speedy {
    border-left: 10px solid #b22222;    /* Red */
    background: #fee;                   /* Pink */
}
table.ambox-delete {
    border-left: 10px solid #b22222;    /* Red */
}
table.ambox-content {
    border-left: 10px solid #f28500;    /* Orange */
}
table.ambox-style {
    border-left: 10px solid #f4c430;    /* Yellow */
}
table.ambox-move {
    border-left: 10px solid #9932cc;    /* Purple */
}
table.ambox-protection {
    border-left: 10px solid #bba;       /* Gray-gold */
}

margin auto

What if we use style="margin:2px auto; to place the box centered on the page.

:  one problem xith ths template is that the css assumes LTR layout with the defined keft/right property and it ignores the "mw-content-ltr" or "...-rtl" class to set the correct margins. Centering the box would not solve it cleanly. In adfition centering woukd czuse problems with floating itemscto the right or left, orcing them to move diwn and waste vertical space. — Verdy_p (talk) 20:01, 26 June 2018 (UTC)