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

Add more title options #79

Merged
merged 4 commits into from
Dec 1, 2020
Merged

Add more title options #79

merged 4 commits into from
Dec 1, 2020

Conversation

KevinBatdorf
Copy link
Contributor

This PR adds a couple more ways to discover a component's title.

Some of these might not fit given they are not standard, but I feel they offer flexibility. I can remove them if no one agrees.

x-title - Let's the user override the title and not have it affect anything else.
x-id - Used in the $component helper so if it exists, the user has intended it to be an identifier
aria-label - Accessibility label so better than role

This also pushes role below x-data (if a function name) as role is usually pretty generic, while a function name is often a better identifier. Objections?

I also added a unit test to check the naming. Visual test passed too.

Not sure how to test the Livewire portion though, or if we event want to.

@KevinBatdorf
Copy link
Contributor Author

First PR so wanted to keep it light :D

Copy link
Collaborator

@HugoDF HugoDF left a comment

Choose a reason for hiding this comment

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

Happy to merge this.

Couple of comments & since we're adding tests again, it would be good to run them on CI, have a look at https://github.com/alpine-collective/alpinejs-devtools/blob/master/.github/workflows/build.yml#L27

packages/shell-chrome/src/utils.js Outdated Show resolved Hide resolved
packages/shell-chrome/src/utils.js Outdated Show resolved Hide resolved
packages/shell-chrome/src/utils.js Outdated Show resolved Hide resolved
tests/utils.spec.js Outdated Show resolved Hide resolved
tests/utils.spec.js Outdated Show resolved Hide resolved
@HugoDF
Copy link
Collaborator

HugoDF commented Nov 27, 2020

Also remembered that we've got a note about this in the README that we should probably update.

@KevinBatdorf KevinBatdorf changed the title RFC Add more title options Add more title options Dec 1, 2020
@HugoDF HugoDF merged commit 5007427 into master Dec 1, 2020
@HugoDF HugoDF deleted the tweak/add-more-title-options branch December 1, 2020 10:00
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.

None yet

2 participants