Customize: Maximize height of Custom CSS textarea without causing doubled scrollbars.

Textarea will fill vertical height of Custom CSS section for browsers that support `calc()` and when plugins don't add other controls to the section. Also run CSS autoprefixer.

Props michaelarestad, westonruter.
See #35395.
Fixes #38755.


git-svn-id: https://develop.svn.wordpress.org/trunk@39229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2016-11-14 19:11:35 +00:00
parent 292011aecc
commit 58d01ff805
2 changed files with 40 additions and 23 deletions

View File

@ -1135,40 +1135,54 @@ p.customize-section-description {
/**
* Custom CSS Section
*
* Modifications to the Section Container to
* make the textarea full-width.
* Modifications to the Section Container to make the textarea full-width and
* full-height, if the control is the only control in the section.
*/
#customize-theme-controls #sub-accordion-section-custom_css {
padding-left: 0;
padding-right: 0;
}
#customize-theme-controls #sub-accordion-section-custom_css .customize-section-title {
margin-left: 0;
}
#customize-theme-controls #sub-accordion-section-custom_css .customize-control-title,
#customize-theme-controls #sub-accordion-section-custom_css .notice {
margin-left: 10px;
margin-right: 10px;
}
#customize-theme-controls #sub-accordion-section-custom_css textarea {
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
#customize-controls .customize-section-description-container.section-meta.customize-info {
border-bottom: none;
}
#sub-accordion-section-custom_css .customize-control-notifications-container {
margin-bottom: 15px;
}
#sub-accordion-section-custom_css textarea {
border-right: 0;
border-left: 0;
#customize-control-custom_css textarea {
display: block;
font-family: Consolas, Monaco, monospace;
font-size: 12px;
padding: 6px 8px;
height: 553px;
height: 500px;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
}
.customize-section-description-container + #customize-control-custom_css:last-child textarea {
border-right: 0;
border-left: 0;
height: -webkit-calc( 100vh - 185px );
height: calc( 100vh - 185px );
resize: none;
}
.customize-section-description-container + #customize-control-custom_css:last-child {
margin-left: -12px;
width: 299px;
margin-bottom: -12px;
}
@media screen and ( max-width: 640px ) {
.customize-section-description-container + #customize-control-custom_css:last-child {
margin-left: 0;
margin-right: 0;
width: 100%;
}
.customize-section-description-container + #customize-control-custom_css:last-child textarea {
height: -webkit-calc( 100vh - 140px );
height: calc( 100vh - 140px );
width: 100%;
border: solid 1px #ddd;
}
}
/**

View File

@ -55,6 +55,8 @@
box-shadow: 0 2px 1px rgba(46,68,83,0.15);
text-align: center;
cursor: pointer;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 3px;
-webkit-animation-fill-mode: both;
@ -86,6 +88,7 @@
}
.customize-partial-edit-shortcut button:focus {
-webkit-box-shadow: 0 0 0 2px #008ec2;
box-shadow: 0 0 0 2px #008ec2;
}