themesberg / themesberg/flowbite
Style error in Angular reusable input text components
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9.4k
- Forks
- 862
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When trying to make a reusable input component in Angular and wanting to pass a type property with @Input, the preset styles for the <input> tags are applied because of the CSS selectors
To Reproduce
Steps to reproduce the behavior:
- Create an Angular component to make a reusable input text.
- Add
@Input() type: string = 'text';inside the component. - Import and use the
inputcomponent inside the page component. - Add the type attribute with a valid value like email, like this
type="email". - Run the development server and view in the browser
Screenshots
Expected behavior
If CSS selectors were more specific, for example input[type=email] instead of [type=email], then the styles would only apply to tags and not to components with a custom attribute called type created by the developer.
This is how it should look without those unwanted styles:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Angular reusable input component described in the reproduction and locate the component styles using selectors such as [type=email]. Compare the rendered behavior for a native input and a custom component with a type input. Done means type-specific styles apply only to input elements, without affecting custom components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, css, tailwindcss
- Domain
- design, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100