Skip to content

Commit abe0948

Browse files
ockhamclaude
andcommitted
Use the wp-admin sass mixin for the WP 7.0 field styles
Mirrors upstream's nested @include wp-admin("7-0") structure instead of flat compiled-style selectors. Brings _mixins.scss into the build via @use; compiled output is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0c2415f commit abe0948

1 file changed

Lines changed: 47 additions & 30 deletions

File tree

assets/src/sass/acf-input.scss

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@charset "UTF-8";
2+
@use "mixins" as *;
23
/*--------------------------------------------------------------------------------------------
34
*
45
* Vars
@@ -586,10 +587,13 @@ body.acf-browser-firefox .acf-field select {
586587
border-color: #dddddd;
587588
min-height: 28px;
588589
}
589-
.acf-admin-7-0 .acf-input-prepend,
590-
.acf-admin-7-0 .acf-input-append {
591-
min-height: 40px;
592-
padding: 9px 8px;
590+
.acf-input-prepend,
591+
.acf-input-append {
592+
// WP 7.0+
593+
@include wp-admin("7-0") {
594+
min-height: 40px;
595+
padding: 9px 8px;
596+
}
593597
}
594598

595599
.acf-input-prepend {
@@ -743,8 +747,11 @@ html[dir=rtl] input.acf-is-prepended.acf-is-appended {
743747
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
744748
min-height: 31px;
745749
}
746-
.acf-admin-7-0 .select2-container.-acf .select2-choices {
747-
min-height: 40px;
750+
.select2-container.-acf .select2-choices {
751+
// WP 7.0+
752+
@include wp-admin("7-0") {
753+
min-height: 40px;
754+
}
748755
}
749756
.select2-container.-acf .select2-choices .select2-search-choice {
750757
margin: 5px 0 5px 5px;
@@ -848,30 +855,40 @@ html[dir=rtl] .select2-container.-acf .select2-choice .select2-arrow {
848855
.acf-admin-3-8 .select2-container.-acf .select2-selection {
849856
border-color: #aaa;
850857
}
851-
.acf-admin-7-0 .select2-container.-acf .select2-selection--single {
852-
height: 40px;
853-
}
854-
.acf-admin-7-0 .select2-container.-acf .select2-selection--single .select2-selection__rendered {
855-
line-height: 38px;
856-
}
857-
.acf-admin-7-0 .select2-container.-acf .select2-selection--multiple {
858-
min-height: 40px;
859-
line-height: 0;
860-
}
861-
.acf-admin-7-0 .select2-container.-acf .select2-selection--multiple .select2-selection__rendered {
862-
line-height: normal;
863-
display: flex;
864-
align-items: center;
865-
flex-wrap: wrap;
866-
min-height: 38px;
867-
}
868-
.acf-admin-7-0 .select2-container.-acf .select2-selection--multiple .select2-search__field {
869-
margin-top: 0;
870-
}
871-
.acf-admin-7-0 .select2-container.-acf .select2-selection--multiple .select2-selection__choice {
872-
margin-top: 0;
873-
padding-top: 4px;
874-
padding-bottom: 4px;
858+
.select2-container.-acf {
859+
// WP 7.0+
860+
@include wp-admin("7-0") {
861+
.select2-selection--single {
862+
height: 40px;
863+
864+
.select2-selection__rendered {
865+
line-height: 38px;
866+
}
867+
}
868+
869+
.select2-selection--multiple {
870+
min-height: 40px;
871+
line-height: 0;
872+
873+
.select2-selection__rendered {
874+
line-height: normal;
875+
display: flex;
876+
align-items: center;
877+
flex-wrap: wrap;
878+
min-height: 38px;
879+
}
880+
881+
.select2-search__field {
882+
margin-top: 0;
883+
}
884+
885+
.select2-selection__choice {
886+
margin-top: 0;
887+
padding-top: 4px;
888+
padding-bottom: 4px;
889+
}
890+
}
891+
}
875892
}
876893
.select2-container.-acf .select2-selection--multiple .select2-search--inline:first-child {
877894
float: none;

0 commit comments

Comments
 (0)