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

feat(ui): add icon to WdsTextInput. WF-36 #511

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

madeindjs
Copy link
Collaborator

Simply add leftIcon props to WdsTextInput and add a search icon to the dataframe component.

Screencast.from.2024-08-08.22-07-19.mp4

Simply add `leftIcon` props to `WdsTextInput` and add a search icon to
the dataframe component.
@madeindjs madeindjs self-assigned this Aug 8, 2024
border: 1px solid var(--softenedAccentColor);
box-shadow: 0px 0px 0px 3px rgba(81, 31, 255, 0.05);
}

.WdsTextInput--leftIcon {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey I guess nothing wrong with it but just wanted to know, why do you do

.WdsTextInput--leftIcon

instead of

.WdsTextInput.leftIcon

It'd more compact since

class="WdsTextInput WdsTextInput--leftIcon"

becomes

class="WdsTextInput leftIcon"

Since the styles are scoped there's no risk of another leftIcon bothering you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just a habit of following BEM convention. It helps to improve the organization of the CSS. So the *--leftIcon acts as a "modifier". A modifier means to change appearance, behavior or state of an element.

But I agree that here, it's not necessary since the style is scoped

@ramedina86 ramedina86 merged commit c98d4c2 into writer:dev Aug 12, 2024
15 checks passed
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.

2 participants