You've already forked wp-bootstrap
feat: Bootstrap 5 block renderer, widget cards, and sidebar post layout (v1.1.0)
Add BlockRenderer class injecting Bootstrap classes into 8 core block types (table, button, buttons, image, search, quote, pullquote, list) via per-block render_block filters using WP_HTML_Tag_Processor. Add WidgetRenderer class wrapping sidebar widgets in Bootstrap card components with h4 heading hierarchy via dynamic_sidebar_params and widget_block_content filters. Add widget SCSS stylesheet for list styling, search input-group, tag cloud pills, and card-flush list positioning. Add single-sidebar.html.twig as the default post template with two-column Bootstrap layout (col-lg-8 content, col-lg-4 sidebar). Full-width available via template selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2443,7 +2443,7 @@ textarea.form-control-lg {
|
||||
clip: rect(0, 0, 0, 0);
|
||||
pointer-events: none;
|
||||
}
|
||||
.btn-check[disabled] + .btn, .btn-check:disabled + .btn {
|
||||
.btn-check[disabled] + .btn, .widget .search-form .btn-check[disabled] + .search-submit, .btn-check:disabled + .btn, .widget .search-form .btn-check:disabled + .search-submit {
|
||||
pointer-events: none;
|
||||
filter: none;
|
||||
opacity: 0.65;
|
||||
@@ -2642,11 +2642,11 @@ textarea.form-control-lg {
|
||||
.input-group > .form-floating:focus-within {
|
||||
z-index: 5;
|
||||
}
|
||||
.input-group .btn {
|
||||
.input-group .btn, .input-group .widget .search-form .search-submit, .widget .search-form .input-group .search-submit {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.input-group .btn:focus {
|
||||
.input-group .btn:focus, .input-group .widget .search-form .search-submit:focus, .widget .search-form .input-group .search-submit:focus {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
@@ -2668,7 +2668,8 @@ textarea.form-control-lg {
|
||||
.input-group-lg > .form-control,
|
||||
.input-group-lg > .form-select,
|
||||
.input-group-lg > .input-group-text,
|
||||
.input-group-lg > .btn {
|
||||
.input-group-lg > .btn,
|
||||
.widget .search-form .input-group-lg > .search-submit {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 1.25rem;
|
||||
border-radius: var(--bs-border-radius-lg);
|
||||
@@ -2677,7 +2678,8 @@ textarea.form-control-lg {
|
||||
.input-group-sm > .form-control,
|
||||
.input-group-sm > .form-select,
|
||||
.input-group-sm > .input-group-text,
|
||||
.input-group-sm > .btn {
|
||||
.input-group-sm > .btn,
|
||||
.widget .search-form .input-group-sm > .search-submit {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: var(--bs-border-radius-sm);
|
||||
@@ -2893,7 +2895,7 @@ textarea.form-control-lg {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.btn {
|
||||
.btn, .widget .search-form .search-submit {
|
||||
--bs-btn-padding-x: 0.75rem;
|
||||
--bs-btn-padding-y: 0.375rem;
|
||||
--bs-btn-font-family: ;
|
||||
@@ -2927,44 +2929,44 @@ textarea.form-control-lg {
|
||||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.btn {
|
||||
.btn, .widget .search-form .search-submit {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
.btn:hover {
|
||||
.btn:hover, .widget .search-form .search-submit:hover {
|
||||
color: var(--bs-btn-hover-color);
|
||||
background-color: var(--bs-btn-hover-bg);
|
||||
border-color: var(--bs-btn-hover-border-color);
|
||||
}
|
||||
.btn-check + .btn:hover {
|
||||
.btn-check + .btn:hover, .widget .search-form .btn-check + .search-submit:hover {
|
||||
color: var(--bs-btn-color);
|
||||
background-color: var(--bs-btn-bg);
|
||||
border-color: var(--bs-btn-border-color);
|
||||
}
|
||||
.btn:focus-visible {
|
||||
.btn:focus-visible, .widget .search-form .search-submit:focus-visible {
|
||||
color: var(--bs-btn-hover-color);
|
||||
background-color: var(--bs-btn-hover-bg);
|
||||
border-color: var(--bs-btn-hover-border-color);
|
||||
outline: 0;
|
||||
box-shadow: var(--bs-btn-focus-box-shadow);
|
||||
}
|
||||
.btn-check:focus-visible + .btn {
|
||||
.btn-check:focus-visible + .btn, .widget .search-form .btn-check:focus-visible + .search-submit {
|
||||
border-color: var(--bs-btn-hover-border-color);
|
||||
outline: 0;
|
||||
box-shadow: var(--bs-btn-focus-box-shadow);
|
||||
}
|
||||
.btn-check:checked + .btn, :not(.btn-check) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
|
||||
.btn-check:checked + .btn, .widget .search-form .btn-check:checked + .search-submit, :not(.btn-check) + .btn:active, .widget .search-form :not(.btn-check) + .search-submit:active, .btn:first-child:active, .widget .search-form .search-submit:first-child:active, .btn.active, .widget .search-form .active.search-submit, .btn.show, .widget .search-form .show.search-submit {
|
||||
color: var(--bs-btn-active-color);
|
||||
background-color: var(--bs-btn-active-bg);
|
||||
border-color: var(--bs-btn-active-border-color);
|
||||
}
|
||||
.btn-check:checked + .btn:focus-visible, :not(.btn-check) + .btn:active:focus-visible, .btn:first-child:active:focus-visible, .btn.active:focus-visible, .btn.show:focus-visible {
|
||||
.btn-check:checked + .btn:focus-visible, .widget .search-form .btn-check:checked + .search-submit:focus-visible, :not(.btn-check) + .btn:active:focus-visible, .widget .search-form :not(.btn-check) + .search-submit:active:focus-visible, .btn:first-child:active:focus-visible, .widget .search-form .search-submit:first-child:active:focus-visible, .btn.active:focus-visible, .widget .search-form .active.search-submit:focus-visible, .btn.show:focus-visible, .widget .search-form .show.search-submit:focus-visible {
|
||||
box-shadow: var(--bs-btn-focus-box-shadow);
|
||||
}
|
||||
.btn-check:checked:focus-visible + .btn {
|
||||
.btn-check:checked:focus-visible + .btn, .widget .search-form .btn-check:checked:focus-visible + .search-submit {
|
||||
box-shadow: var(--bs-btn-focus-box-shadow);
|
||||
}
|
||||
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
|
||||
.btn:disabled, .widget .search-form .search-submit:disabled, .btn.disabled, .widget .search-form .disabled.search-submit, fieldset:disabled .btn, fieldset:disabled .widget .search-form .search-submit, .widget .search-form fieldset:disabled .search-submit {
|
||||
color: var(--bs-btn-disabled-color);
|
||||
pointer-events: none;
|
||||
background-color: var(--bs-btn-disabled-bg);
|
||||
@@ -2972,7 +2974,7 @@ textarea.form-control-lg {
|
||||
opacity: var(--bs-btn-disabled-opacity);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
.btn-primary, .widget .search-form .search-submit {
|
||||
--bs-btn-color: #FFFFFF;
|
||||
--bs-btn-bg: #0d6efd;
|
||||
--bs-btn-border-color: #0d6efd;
|
||||
@@ -3266,14 +3268,14 @@ textarea.form-control-lg {
|
||||
color: var(--bs-btn-hover-color);
|
||||
}
|
||||
|
||||
.btn-lg, .btn-group-lg > .btn {
|
||||
.btn-lg, .btn-group-lg > .btn, .widget .search-form .btn-group-lg > .search-submit {
|
||||
--bs-btn-padding-y: 0.5rem;
|
||||
--bs-btn-padding-x: 1rem;
|
||||
--bs-btn-font-size: 1.25rem;
|
||||
--bs-btn-border-radius: var(--bs-border-radius-lg);
|
||||
}
|
||||
|
||||
.btn-sm, .btn-group-sm > .btn {
|
||||
.btn-sm, .btn-group-sm > .btn, .widget .search-form .btn-group-sm > .search-submit {
|
||||
--bs-btn-padding-y: 0.25rem;
|
||||
--bs-btn-padding-x: 0.5rem;
|
||||
--bs-btn-font-size: 0.875rem;
|
||||
@@ -3640,23 +3642,35 @@ textarea.form-control-lg {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.btn-group > .btn,
|
||||
.btn-group-vertical > .btn {
|
||||
.btn-group > .btn, .widget .search-form .btn-group > .search-submit,
|
||||
.btn-group-vertical > .btn,
|
||||
.widget .search-form .btn-group-vertical > .search-submit {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.btn-group > .btn-check:checked + .btn,
|
||||
.btn-group > .btn-check:checked + .btn, .widget .search-form .btn-group > .btn-check:checked + .search-submit,
|
||||
.btn-group > .btn-check:focus + .btn,
|
||||
.widget .search-form .btn-group > .btn-check:focus + .search-submit,
|
||||
.btn-group > .btn:hover,
|
||||
.widget .search-form .btn-group > .search-submit:hover,
|
||||
.btn-group > .btn:focus,
|
||||
.widget .search-form .btn-group > .search-submit:focus,
|
||||
.btn-group > .btn:active,
|
||||
.widget .search-form .btn-group > .search-submit:active,
|
||||
.btn-group > .btn.active,
|
||||
.widget .search-form .btn-group > .active.search-submit,
|
||||
.btn-group-vertical > .btn-check:checked + .btn,
|
||||
.widget .search-form .btn-group-vertical > .btn-check:checked + .search-submit,
|
||||
.btn-group-vertical > .btn-check:focus + .btn,
|
||||
.widget .search-form .btn-group-vertical > .btn-check:focus + .search-submit,
|
||||
.btn-group-vertical > .btn:hover,
|
||||
.widget .search-form .btn-group-vertical > .search-submit:hover,
|
||||
.btn-group-vertical > .btn:focus,
|
||||
.widget .search-form .btn-group-vertical > .search-submit:focus,
|
||||
.btn-group-vertical > .btn:active,
|
||||
.btn-group-vertical > .btn.active {
|
||||
.widget .search-form .btn-group-vertical > .search-submit:active,
|
||||
.btn-group-vertical > .btn.active,
|
||||
.widget .search-form .btn-group-vertical > .active.search-submit {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -3672,19 +3686,23 @@ textarea.form-control-lg {
|
||||
.btn-group {
|
||||
border-radius: var(--bs-border-radius);
|
||||
}
|
||||
.btn-group > :not(.btn-check:first-child) + .btn,
|
||||
.btn-group > :not(.btn-check:first-child) + .btn, .widget .search-form .btn-group > :not(.btn-check:first-child) + .search-submit,
|
||||
.btn-group > .btn-group:not(:first-child) {
|
||||
margin-left: calc(-1 * var(--bs-border-width));
|
||||
}
|
||||
.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
|
||||
.btn-group > .btn:not(:last-child):not(.dropdown-toggle), .widget .search-form .btn-group > .search-submit:not(:last-child):not(.dropdown-toggle),
|
||||
.btn-group > .btn.dropdown-toggle-split:first-child,
|
||||
.btn-group > .btn-group:not(:last-child) > .btn {
|
||||
.widget .search-form .btn-group > .dropdown-toggle-split.search-submit:first-child,
|
||||
.btn-group > .btn-group:not(:last-child) > .btn,
|
||||
.widget .search-form .btn-group > .btn-group:not(:last-child) > .search-submit {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.btn-group > .btn:nth-child(n+3),
|
||||
.btn-group > .btn:nth-child(n+3), .widget .search-form .btn-group > .search-submit:nth-child(n+3),
|
||||
.btn-group > :not(.btn-check) + .btn,
|
||||
.btn-group > .btn-group:not(:first-child) > .btn {
|
||||
.widget .search-form .btn-group > :not(.btn-check) + .search-submit,
|
||||
.btn-group > .btn-group:not(:first-child) > .btn,
|
||||
.widget .search-form .btn-group > .btn-group:not(:first-child) > .search-submit {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
@@ -3700,12 +3718,12 @@ textarea.form-control-lg {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split {
|
||||
.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split, .widget .search-form .btn-group-sm > .search-submit + .dropdown-toggle-split {
|
||||
padding-right: 0.375rem;
|
||||
padding-left: 0.375rem;
|
||||
}
|
||||
|
||||
.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split {
|
||||
.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split, .widget .search-form .btn-group-lg > .search-submit + .dropdown-toggle-split {
|
||||
padding-right: 0.75rem;
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
@@ -3715,22 +3733,25 @@ textarea.form-control-lg {
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
}
|
||||
.btn-group-vertical > .btn,
|
||||
.btn-group-vertical > .btn, .widget .search-form .btn-group-vertical > .search-submit,
|
||||
.btn-group-vertical > .btn-group {
|
||||
width: 100%;
|
||||
}
|
||||
.btn-group-vertical > .btn:not(:first-child),
|
||||
.btn-group-vertical > .btn:not(:first-child), .widget .search-form .btn-group-vertical > .search-submit:not(:first-child),
|
||||
.btn-group-vertical > .btn-group:not(:first-child) {
|
||||
margin-top: calc(-1 * var(--bs-border-width));
|
||||
}
|
||||
.btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle),
|
||||
.btn-group-vertical > .btn-group:not(:last-child) > .btn {
|
||||
.btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle), .widget .search-form .btn-group-vertical > .search-submit:not(:last-child):not(.dropdown-toggle),
|
||||
.btn-group-vertical > .btn-group:not(:last-child) > .btn,
|
||||
.widget .search-form .btn-group-vertical > .btn-group:not(:last-child) > .search-submit {
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.btn-group-vertical > .btn:nth-child(n+3),
|
||||
.btn-group-vertical > .btn:nth-child(n+3), .widget .search-form .btn-group-vertical > .search-submit:nth-child(n+3),
|
||||
.btn-group-vertical > :not(.btn-check) + .btn,
|
||||
.btn-group-vertical > .btn-group:not(:first-child) > .btn {
|
||||
.widget .search-form .btn-group-vertical > :not(.btn-check) + .search-submit,
|
||||
.btn-group-vertical > .btn-group:not(:first-child) > .btn,
|
||||
.widget .search-form .btn-group-vertical > .btn-group:not(:first-child) > .search-submit {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
@@ -4769,7 +4790,7 @@ textarea.form-control-lg {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btn .badge {
|
||||
.btn .badge, .widget .search-form .search-submit .badge {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
@@ -6718,7 +6739,7 @@ textarea.form-control-lg {
|
||||
background-color: currentcolor;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.placeholder.btn::before {
|
||||
.placeholder.btn::before, .widget .search-form .placeholder.search-submit::before {
|
||||
display: inline-block;
|
||||
content: "";
|
||||
}
|
||||
@@ -20227,6 +20248,127 @@ h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6, blockquote, caption, figca
|
||||
content: "爛";
|
||||
}
|
||||
|
||||
.widget .card-title,
|
||||
.widget .wp-block-heading {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.widget ul,
|
||||
.widget ol {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.widget ul li,
|
||||
.widget ol li {
|
||||
padding: 0.5rem 1rem;
|
||||
border-bottom: var(--bs-border-width) solid var(--bs-border-color);
|
||||
}
|
||||
.widget ul li:last-child,
|
||||
.widget ol li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.widget ul li a,
|
||||
.widget ol li a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.widget ul li a:hover,
|
||||
.widget ol li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.widget .card-body > ul,
|
||||
.widget .card-body > ol,
|
||||
.widget .card-body > nav > ul,
|
||||
.widget .card-body > .wp-block-group > ul,
|
||||
.widget .card-body > .wp-block-group > ol {
|
||||
margin: 0 calc(-1 * var(--bs-card-spacer-x)) calc(-1 * var(--bs-card-spacer-y));
|
||||
}
|
||||
.widget .card-body > ul li:first-child,
|
||||
.widget .card-body > ol li:first-child,
|
||||
.widget .card-body > nav > ul li:first-child,
|
||||
.widget .card-body > .wp-block-group > ul li:first-child,
|
||||
.widget .card-body > .wp-block-group > ol li:first-child {
|
||||
border-top: var(--bs-border-width) solid var(--bs-border-color);
|
||||
}
|
||||
|
||||
.widget select {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: var(--bs-body-color);
|
||||
background-color: var(--bs-body-bg);
|
||||
border: var(--bs-border-width) solid var(--bs-border-color);
|
||||
border-radius: var(--bs-border-radius);
|
||||
appearance: auto;
|
||||
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||
}
|
||||
.widget select:focus {
|
||||
border-color: rgb(134, 182.5, 254);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
||||
}
|
||||
|
||||
.widget .search-form {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.widget .search-form .search-field {
|
||||
flex: 1;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: var(--bs-body-color);
|
||||
background-color: var(--bs-body-bg);
|
||||
border: var(--bs-border-width) solid var(--bs-border-color);
|
||||
border-radius: var(--bs-border-radius);
|
||||
}
|
||||
.widget .search-form .search-field:focus {
|
||||
border-color: rgb(134, 182.5, 254);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
||||
}
|
||||
.widget .wp-block-search .wp-block-search__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget .tagcloud {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
.widget .tagcloud a {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.875rem !important;
|
||||
line-height: 1.5;
|
||||
color: var(--bs-body-color);
|
||||
background-color: var(--bs-tertiary-bg);
|
||||
border: var(--bs-border-width) solid var(--bs-border-color);
|
||||
border-radius: var(--bs-border-radius-pill);
|
||||
text-decoration: none;
|
||||
transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
|
||||
}
|
||||
.widget .tagcloud a:hover {
|
||||
background-color: var(--bs-primary);
|
||||
border-color: var(--bs-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.widget .post-date {
|
||||
display: block;
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
|
||||
.widget .recentcomments {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.wp-bootstrap-dark-mode-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user