Skip to content

Form theme that removed custom bootstrap css class from input type file #27996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Form theme that removed custom bootstrap css class from input type file #27996

wants to merge 1 commit into from

Conversation

lsv
Copy link

@lsv lsv commented Jul 19, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27477
License MIT
Doc PR I will create a little info box on the https://github.com/symfony/symfony-docs/blob/master/form/bootstrap4.rst if approved

This will create a new bootstrap theme that removes the custom css class from <input type="file"> so the user can now see what files that are selected in the input.

I have decided to keep the custom radio/checkbox, as these dont break the functionality.

Before

selection_111

After

selection_109

Usage

twig:
    form_themes: ['bootstrap_4_nocustom_layout.html.twig']

This a follow up to #27478

@@ -129,8 +129,12 @@
{% endblock %}

{% block form_widget_simple -%}
{% if use_bootstrap_custom is not defined %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about naming this: use_custom_file_input instead?

@nicolas-grekas nicolas-grekas added this to the next milestone Jul 23, 2018
@javiereguiluz
Copy link
Member

I don't like this proposal much. We already have two themes for Bootstrap ... now we're proposing to add (and maintain forever) a third one. Also, this would open the door to new themes that tweak/change other elements of the theme.

I think we should be as strict as for the SymfonyStyle for the Symfony Console. It's an opinionated theme that can't be customized in any way. We (the community) can change it ... but the user can't configure it: either it uses it unchanged ... or they create their own theme. I'd like to do the same here.

@lsv in spite of my previous comment, I thank you for proposing this contribution and working on this!

@lsv
Copy link
Author

lsv commented Sep 21, 2018

@javiereguiluz I do see your point, and the best way is actually just to remove the custom.sass from bootstrap, which I normally do with encore, but not possible by using bootstrap cdn

@lsv lsv closed this Sep 21, 2018
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants