Skip to content
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

Base input style #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bittermandel
Copy link
Contributor

This PR applies some basic styling for text, email and base inputs. It includes some rounded borders, some outlines on focus and just prettier defaults.

@bittermandel
Copy link
Contributor Author

Not sure why there's 9 commits instead of just the last 3 😮

@@ -2,7 +2,7 @@
name="{% if input.name|wordcount > 1 %}{{ input.name|slugify }}{% else %}{{ input.name }}{% endif %}"
value="{{ input.value }}"
{% if input.input_type != "hidden" %}
class="{{ input.field_classes }}"
class="{{ input.field_classes }} bg-white focus:outline-none focus:shadow-outline border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal"
Copy link
Member

Choose a reason for hiding this comment

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

Say the form has two buttons, submit / cancel. Does this allow users to still adjust colour by adding additional classes? (seems to me like the most likely use case).

"fileinput": "fileinput fileUpload",
"passwordinput": "textinput textInput",
"emailinput": "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full \
Copy link
Member

Choose a reason for hiding this comment

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

Can we add these classes to the default_styles dict on the class instead?

Will need to drop the trailing input/widget from from the widget type.

@smithdc1
Copy link
Member

smithdc1 commented May 9, 2020

Hi @bittermandel

Thanks for this! Sorry I've been a bit quiet the last week.

I've added your styling to most of the widget classes which are text inputs. The image below shows where we're currently at (not quite sure what's not happening with the labels they should be styled but it's not working on the test project)

I'm still not sure about the buttons - so may merge the first commit and leave this pull request open with the buttons.

On the tests, whilst I think it worked to show how it works initially I think we're reaching the point where this isn't a good long term solution. Also as there are dicts involved for storing classes we get test failures on py35 as dicts are unordered. I may drop 3.5 from the test matrix as it's EOL in a few month's anyway.

screencapture-127-0-0-1-8000-tailwind-2020-05-09-19_45_22_2

@smithdc1 smithdc1 force-pushed the base-input-style branch 2 times, most recently from d9008d4 to 9e339c6 Compare May 10, 2020 11:15
smithdc1 and others added 2 commits May 10, 2020 12:17
Co-authored-by: Jonathan Grahl <[email protected]>
Co-authored-by:  Jonathan Grahl <[email protected]>
@smithdc1
Copy link
Member

Hey @bittermandel

I've pushed the base styles in this commit. dd3f497

screencapture-127-0-0-1-8000-tailwind-2020-05-10-12_29_29

We're therefore currently at this with |crispy - it's starting to take shape now 👍

@GitRon
Copy link
Contributor

GitRon commented Jan 5, 2024

Hi @bittermandel and @smithdc1!

Is this PR still relevant? I saw that you pushed some commits regarding these changes ages ago.

Best
Ronny

@blasferna
Copy link
Contributor

It would be nice if the base styles defaulted by this library were adapted at least similar to those of https://tailwindui.com/components/

@GitRon
Copy link
Contributor

GitRon commented Jan 8, 2024

Hi @blasferna!

Carltons approach to requests like this is usually: "This is a suggetion / template, customize it as much as you want in your own project."

Nevertheless, if you have some concrete ideas, I'd be happy to discuss them in a PR. 🙂

@blasferna
Copy link
Contributor

Hello @GitRon!

Thank you for your response. I have the time available to dedicate to the project and would be delighted to work on it. Regarding the default suggestion/template, I think we could make some adjustments to enhance its appearance. I am open to suggestions and eager to collaborate with you.

Best regards! 😊

@GitRon
Copy link
Contributor

GitRon commented Jan 9, 2024

Hi @blasferna !

That sounds great having you on board ❤️

I'm always a fan of starting small instead of reinventing the world in one PR. Maybe you could identify one or two smaller issues and create a PR for that?

I'd suggest we start with "broken" or "anti-pattern" stuff and move then to the best practices.

What do you think?

Best from Cologne
Ronny

@blasferna
Copy link
Contributor

Absolutely, let's start with smaller tasks. I'll be working on some issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants