-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create action button component #158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/stories/actionbutton.stories.js
Outdated
aButton.setAttribute('btn-color', args.buttonColor); | ||
aButton.setAttribute('icon', args.icon); | ||
aButton.setAttribute('title', args.title); | ||
aButton.setAttribute('body', args.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to setup the component using slots
rather than attributes. It will probably make the implementation easier. The body
field on drupal will export mark up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jedgar1mx , I intentionally used an attribute here because that will force users of the button to not try and shove too much inside the button. These buttons aren't really designed to have rich, formatted content inside. The 'body' is meant to be a simple sentence or few words.
With that in mind, let me know if you still think slots is a better approach here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using slot for the body field is probably a better approach to accommodate the old content.
@jedgar1mx I fixed the multi-button layout issue. I also went ahead and scrapped the idea of the
The reason for this shift in mindset: it's overly cumbersome and also fragile to have components control one another's styles. Components that are reused often will quickly devolve into unmaintainable style sheets. Also, composing components that control each other's styles seems like an anti-pattern with shadow DOM style encapsulation. |
Moved this back to draft while I:
|
@jedgar1mx full markup is now supported in the body (added a story for demo), also fixed the alignment in grid layouts. Ready to review. |
Context
See context in #100.
This PR
cod-clickable
component since it is for internal use onlyTesting
Test new story with various args:
Check chromatic for no regression of other components