Fix image size handling in Twenty Ten. props lancewillett, iandstewart, see #14303 for trunk.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-09-12 15:21:29 +00:00
parent ca725961c5
commit b85b71ee83
2 changed files with 74 additions and 66 deletions

View File

@ -1,15 +1,13 @@
/* /*
Theme Name: Twenty Ten Theme Name: Twenty Ten
*/ Description: Used to style the TinyMCE editor.
/*
Used to style the TinyMCE editor.
*/ */
html .mceContentBody { html .mceContentBody {
max-width:640px; max-width: 640px;
} }
* { * {
font-family: Georgia, "Bitstream Charter", serif;
color: #444; color: #444;
font-family: Georgia, "Bitstream Charter", serif;
line-height: 1.5; line-height: 1.5;
} }
p, p,
@ -40,10 +38,10 @@ body, input, textarea {
} }
hr { hr {
background-color: #e7e7e7; background-color: #e7e7e7;
border:0; border: 0;
clear: both;
height: 1px; height: 1px;
margin-bottom: 18px; margin-bottom: 18px;
clear:both;
} }
/* Text elements */ /* Text elements */
p { p {
@ -58,22 +56,22 @@ ol {
margin: 0 0 18px 1.5em; margin: 0 0 18px 1.5em;
} }
ol ol { ol ol {
list-style:upper-alpha; list-style: upper-alpha;
} }
ol ol ol { ol ol ol {
list-style:lower-roman; list-style: lower-roman;
} }
ol ol ol ol { ol ol ol ol {
list-style:lower-alpha; list-style: lower-alpha;
} }
ul ul, ul ul,
ol ol, ol ol,
ul ol, ul ol,
ol ul { ol ul {
margin-bottom:0; margin-bottom: 0;
} }
dl { dl {
margin:0 0 24px 0; margin: 0 0 24px 0;
} }
dt { dt {
font-weight: bold; font-weight: bold;
@ -82,20 +80,20 @@ dd {
margin-bottom: 18px; margin-bottom: 18px;
} }
strong { strong {
font-weight: bold;
color: #000; color: #000;
font-weight: bold;
} }
cite, cite,
em, em,
i { i {
font-style: italic;
border: none; border: none;
font-style: italic;
} }
big { big {
font-size: 131.25%; font-size: 131.25%;
} }
ins { ins {
background: #ffffcc; background: #ffc;
border: none; border: none;
color: #333; color: #333;
} }
@ -129,11 +127,11 @@ ins {
} }
sup, sup,
sub { sub {
font-size: 10px;
height: 0; height: 0;
line-height: 1; line-height: 1;
vertical-align: baseline;
position: relative; position: relative;
font-size: 10px; vertical-align: baseline;
} }
sup { sup {
bottom: 1ex; bottom: 1ex;
@ -142,10 +140,10 @@ sub {
top: .5ex; top: .5ex;
} }
a:link { a:link {
color:#0066cc; color: #06c;
} }
a:visited { a:visited {
color:#743399; color: #743399;
} }
a:active, a:active,
a:hover { a:hover {
@ -157,13 +155,13 @@ ol,
dd, dd,
pre, pre,
hr { hr {
margin-bottom:24px; margin-bottom: 24px;
} }
ul ul, ul ul,
ol ol, ol ol,
ul ol, ul ol,
ol ul { ol ul {
margin-bottom:0; margin-bottom: 0;
} }
pre, pre,
kbd, kbd,
@ -188,9 +186,9 @@ h4,
h5, h5,
h6 { h6 {
color: #000; color: #000;
margin: 0 0 20px 0;
line-height: 1.5em;
font-weight: normal; font-weight: normal;
line-height: 1.5em;
margin: 0 0 20px 0;
} }
h1 { h1 {
font-size: 2.4em; font-size: 2.4em;
@ -212,11 +210,11 @@ h6 {
} }
table { table {
border: 1px solid #e7e7e7 !important; border: 1px solid #e7e7e7 !important;
text-align: left;
margin: 0 -1px 24px 0;
width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
margin: 0 -1px 24px 0;
text-align: left;
width: 100%;
} }
tr th, tr th,
thead th { thead th {
@ -232,11 +230,15 @@ tr td {
border-top: 1px solid #e7e7e7 !important; border-top: 1px solid #e7e7e7 !important;
padding: 6px 24px; padding: 6px 24px;
} }
img { img {
margin: 0; margin: 0;
max-width: 640px; }
img.size-auto,
img.size-large,
img.size-full,
img.size-medium {
max-width: 100%;
height: auto;
} }
.alignleft, .alignleft,
img.alignleft { img.alignleft {
@ -265,18 +267,19 @@ img.aligncenter {
margin-bottom: 12px; margin-bottom: 12px;
} }
.wp-caption { .wp-caption {
border: none;
background: #f1f1f1; background: #f1f1f1;
border: none;
-khtml-border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
color: #888; color: #888;
font-size: 12px; font-size: 12px;
line-height: 18px; line-height: 18px;
text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
max-width: 632px !important; /* prevent too-wide images from breaking layout */
padding: 4px; padding: 4px;
-moz-border-radius: 0; text-align: center;
-khtml-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
} }
.wp-caption img { .wp-caption img {
margin: 5px; margin: 5px;
@ -285,5 +288,5 @@ img.aligncenter {
margin: 0 0 4px; margin: 0 0 4px;
} }
.wp-smiley { .wp-smiley {
margin:0; margin: 0;
} }

View File

@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar. Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar.
Author: the WordPress team Author: the WordPress team
Version: 1.1 Version: 1.1
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
*/ */
@ -761,86 +761,91 @@ body.page .edit-link {
/* =Images /* =Images
-------------------------------------------------------------- */ -------------------------------------------------------------- */
#content img { /*
margin: 0; Resize images to fit the main content area.
height: auto; - Applies only to images uploaded via WordPress by targeting size-* classes.
max-width: 640px; - Other images will be left alone. Use "size-auto" class to apply to other images.
width: auto; */
img.size-auto,
img.size-full,
img.size-large,
img.size-medium,
.attachment img {
max-width: 100%; /* When images are too wide for containing element, force them to fit. */
height: auto; /* Override height to match resized width for correct aspect ratio. */
} }
#content .attachment img { .alignleft,
max-width: 900px; img.alignleft {
}
#content .alignleft,
#content img.alignleft {
display: inline; display: inline;
float: left; float: left;
margin-right: 24px; margin-right: 24px;
margin-top: 4px; margin-top: 4px;
} }
#content .alignright, .alignright,
#content img.alignright { img.alignright {
display: inline; display: inline;
float: right; float: right;
margin-left: 24px; margin-left: 24px;
margin-top: 4px; margin-top: 4px;
} }
#content .aligncenter, .aligncenter,
#content img.aligncenter { img.aligncenter {
clear: both; clear: both;
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
#content img.alignleft, img.alignleft,
#content img.alignright, img.alignright,
#content img.aligncenter { img.aligncenter {
margin-bottom: 12px; margin-bottom: 12px;
} }
#content .wp-caption { .wp-caption {
background: #f1f1f1; background: #f1f1f1;
line-height: 18px; line-height: 18px;
margin-bottom: 20px; margin-bottom: 20px;
max-width: 632px !important; /* prevent too-wide images from breaking layout */
padding: 4px; padding: 4px;
text-align: center; text-align: center;
} }
#content .wp-caption img { .wp-caption img {
margin: 5px 5px 0; margin: 5px 5px 0;
} }
#content .wp-caption p.wp-caption-text { .wp-caption p.wp-caption-text {
color: #888; color: #888;
font-size: 12px; font-size: 12px;
margin: 5px; margin: 5px;
} }
#content .wp-smiley { .wp-smiley {
margin: 0; margin: 0;
} }
#content .gallery { .gallery {
margin: 0 auto 18px; margin: 0 auto 18px;
} }
#content .gallery .gallery-item { .gallery .gallery-item {
float: left; float: left;
margin-top: 0; margin-top: 0;
text-align: center; text-align: center;
width: 33%; width: 33%;
} }
#content .gallery img { .gallery img {
border: 2px solid #cfcfcf; border: 2px solid #cfcfcf;
} }
#content .gallery .gallery-caption { .gallery .gallery-caption {
color: #888; color: #888;
font-size: 12px; font-size: 12px;
margin: 0 0 12px; margin: 0 0 12px;
} }
#content .gallery dl { .gallery dl {
margin: 0; margin: 0;
} }
#content .gallery img { .gallery img {
border: 10px solid #f1f1f1; border: 10px solid #f1f1f1;
} }
#content .gallery br+br { .gallery br+br {
display: none; display: none;
} }
#content .attachment img { /* single attachment images should be centered */ #content .attachment img {/* single attachment images should be centered */
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }