Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bootstrap5-3426877
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
bootstrap5-3426877
Commits
aa356319
Commit
aa356319
authored
4 years ago
by
Vladimir Roudakov
Committed by
Vladimir Roudakov
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3190581
by VladimirAus: Checkbox is not styled properly
parent
93a4d901
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bootstrap5.theme
+27
-0
27 additions, 0 deletions
bootstrap5.theme
templates/form/input.html.twig
+1
-1
1 addition, 1 deletion
templates/form/input.html.twig
with
28 additions
and
1 deletion
bootstrap5.theme
+
27
−
0
View file @
aa356319
...
...
@@ -366,6 +366,33 @@ function bootstrap5_preprocess_textarea(&$variables) {
$variables
[
'attributes'
][
'class'
][]
=
'form-control'
;
}
/**
* Implements template_preprocess_HOOK() for input.
*/
function
bootstrap5_preprocess_input
(
&
$variables
)
{
$type_html
=
$variables
[
'attributes'
][
'type'
];
$text_types_html
=
[
'text'
,
'email'
,
'tel'
,
'number'
,
'search'
,
'password'
,
'url'
,
'month'
,
'week'
,
];
if
(
in_array
(
$type_html
,
$text_types_html
))
{
$variables
[
'attributes'
][
'class'
][]
=
'form-control'
;
}
if
(
in_array
(
$type_html
,
[
'checkbox'
]))
{
$variables
[
'attributes'
][
'class'
][]
=
'form-check-input'
;
}
}
/**
* Implements theme_preprocess_datetime_form().
*/
...
...
This diff is collapsed.
Click to expand it.
templates/form/input.html.twig
+
1
−
1
View file @
aa356319
...
...
@@ -14,6 +14,6 @@
{%
if
attributes.hasClass
(
'button'
)
and
not
attributes.hasClass
(
'field-add-more-submit'
)
%}
<input
{{
attributes.addClass
(
'btn btn-primary'
)
}}
/>
{%
else
%}
<input
{{
attributes
.addClass
(
'form-control'
)
}}
/>
<input
{{
attributes
}}
/>
{%
endif
%}
{{
children
}}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment