Merge pull request #25125 from woocommerce/fix/25029.3

Fix select2 style and admin screen button alignments in WP 5.3
This commit is contained in:
Peter Fabian 2019-11-27 17:58:46 +01:00 committed by GitHub
commit 278cf53f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 283 additions and 5 deletions

View File

@ -579,6 +579,7 @@
}
#variable_product_options {
.form-row select {
max-width: 100%;
}
@ -636,6 +637,14 @@ mark.amount {
}
}
.branch-5-3 {
.woocommerce-help-tip {
font-size: 1.2em;
cursor: help;
}
}
h2 .woocommerce-help-tip {
margin-top: -5px;
margin-left: 0.25em;
@ -3051,7 +3060,6 @@ table.wc_input_table {
vertical-align: middle;
input {
width: auto;
padding: 0;
}
}
@ -4115,6 +4123,84 @@ img.help_tip {
}
}
.branch-5-3 {
.woocommerce {
h2.wc-table-list-header {
margin: 1em 0 0.35em 0;
}
input + .subsubsub {
margin: 8px 0 0;
}
table.form-table {
// Give regular settings inputs a standard width and padding.
textarea,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="week"],
input[type="url"],
input[type="tel"],
input.regular-input {
padding: 0 8px;
@media only screen and (max-width: 782px) {
width: 100%;
}
}
select {
@media only screen and (max-width: 782px) {
width: 100%;
}
}
th label {
img.help_tip,
.woocommerce-help-tip {
margin: -7px -24px 0 0;
@media only screen and (max-width: 782px) {
right: auto;
margin-left: 5px;
}
}
}
.forminp-color {
font-size: 0;
}
.colorpickpreview {
padding: 0;
width: 30px;
height: 30px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
font-size: 16px;
border-radius: 4px;
margin-right: 3px;
@media only screen and (max-width: 782px) {
float: left;
width: 40px;
height: 40px;
}
}
}
}
}
.woocommerce #tabs-wrap table a.remove {
margin-left: 4px;
}
@ -4561,7 +4647,6 @@ img.help_tip {
.woocommerce_options_panel .checkbox,
.woocommerce_variable_attributes .checkbox {
width: auto;
margin: 4px 0 !important;
vertical-align: middle;
float: left;
@ -6609,6 +6694,180 @@ table.bar_chart {
min-width: 400px !important;
}
.branch-5-3 {
.select2-results {
.select2-results__option,
.select2-results__group {
&:focus {
outline: none;
}
}
}
.select2-dropdown {
border-color: #007cba;
&::after {
position: absolute;
left: 0;
right: 0;
height: 1px;
background: #fff;
content: "";
}
}
.select2-dropdown--below {
box-shadow: 0 0 0 1px #007cba, 0 2px 1px rgba(0, 0, 0, 0.1);
&::after {
top: -1px;
}
}
.select2-dropdown--above {
box-shadow: 0 0 0 1px #007cba, 0 -2px 1px rgba(0, 0, 0, 0.1);
&::after {
bottom: -1px;
}
}
.select2-container {
@media only screen and (max-width: 782px) {
font-size: 16px;
}
&:focus {
outline: none;
}
.select2-selection--single {
height: 30px;
border-color: #7e8993;
@media only screen and (max-width: 782px) {
height: 40px;
}
&:focus {
outline: none;
}
.select2-selection__rendered {
line-height: 28px;
@media only screen and (max-width: 782px) {
line-height: 38px;
}
&:hover {
color: #007cba;
}
}
.select2-selection__arrow {
right: 1px;
height: 28px;
width: 28px;
background: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") no-repeat right 5px top 55%;
background-size: 16px 16px;
@media only screen and (max-width: 782px) {
height: 38px;
}
b {
display: none;
}
}
}
&.select2-container--focus .select2-selection--single,
&.select2-container--open .select2-selection--single,
&.select2-container--open .select2-selection--multiple {
border-color: #007cba;
box-shadow: 0 0 0 1px #007cba;
}
.select2-selection--multiple {
min-height: 30px;
border-color: #7e8993;
border-radius: 4px;
}
.select2-search--inline .select2-search__field {
padding: 0 0 0 3px;
min-height: 28px;
}
}
.woocommerce table.form-table .select2-container {
@media only screen and (max-width: 782px) {
min-width: 100% !important;
}
}
}
/**
* Select2 colors for built-in admin color themes.
*/
.branch-5-3 {
.admin-color {
$wp_admin_colors: (
blue: #096484,
coffee: #c7a589,
ectoplasm: #a3b745,
midnight: #e14d43,
ocean: #9ebaa0,
sunrise: #dd823b,
light: #04a4cc
);
@each $name, $color in $wp_admin_colors {
&-#{$name} {
.select2-dropdown {
border-color: $color;
}
.select2-dropdown--below {
box-shadow: 0 0 0 1px $color, 0 2px 1px rgba(0, 0, 0, 0.1);
}
.select2-dropdown--above {
box-shadow: 0 0 0 1px $color, 0 -2px 1px rgba(0, 0, 0, 0.1);
}
.select2-selection--single .select2-selection__rendered:hover {
color: $color;
}
.select2-container.select2-container--focus .select2-selection--single,
.select2-container.select2-container--open .select2-selection--single,
.select2-container.select2-container--open .select2-selection--multiple {
border-color: $color;
box-shadow: 0 0 0 1px $color;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
background-color: $color;
}
}
}
}
}
.post-type-product .tablenav,
.post-type-shop_order .tablenav {

View File

@ -1159,6 +1159,14 @@ h3.jetpack-reasons {
}
}
.branch-5-3 {
.location-input {
margin: 0;
}
}
.address-step {
.select2 {
@ -1380,6 +1388,17 @@ p.jetpack-terms {
}
}
.branch-5-3 {
.wc-wizard-service-setting-stripe_create_account,
.wc-wizard-service-setting-ppec_paypal_reroute_requests {
.payment-checkbox-input {
margin-top: 3px;
}
}
}
.wc-wizard-service-setting-stripe_email,
.wc-wizard-service-setting-ppec_paypal_email {
margin-top: 0.75em;

View File

@ -95,7 +95,7 @@ class WC_Admin_API_Keys {
private static function table_list_output() {
global $wpdb, $keys_table_list;
echo '<h2>' . esc_html__( 'REST API', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . esc_html__( 'Add key', 'woocommerce' ) . '</a></h2>';
echo '<h2 class="wc-table-list-header">' . esc_html__( 'REST API', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . esc_html__( 'Add key', 'woocommerce' ) . '</a></h2>';
// Get the API keys count.
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1;" );

View File

@ -706,7 +706,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
} elseif ( $description && in_array( $value['type'], array( 'checkbox' ), true ) ) {
$description = wp_kses_post( $description );
} elseif ( $description ) {
$description = '<span class="description">' . wp_kses_post( $description ) . '</span>';
$description = '<p class="description">' . wp_kses_post( $description ) . '</p>';
}
if ( $tooltip_html && in_array( $value['type'], array( 'checkbox' ), true ) ) {

View File

@ -267,7 +267,7 @@ class WC_Admin_Webhooks {
private static function table_list_output() {
global $webhooks_table_list;
echo '<h2>' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ) . '" class="add-new-h2">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';
echo '<h2 class="wc-table-list-header">' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ) . '" class="add-new-h2">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';
// Get the webhooks count.
$data_store = WC_Data_Store::load( 'webhook' );