Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.

Use data attr selectors instead of class selectors #98

Merged
merged 3 commits into from
Feb 28, 2017

Conversation

NathanPJF
Copy link
Contributor

To address #95

Copy link
Contributor

@chrisberthe chrisberthe left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise looks awesome.

@@ -50,7 +50,7 @@
</label>

<select
class="single-option-selector"
data-single-option-selector
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we should keep the ordering consistent when inside of a tag:
id/class - data selector - data attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can get onboard with that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where would you put stuff like alt, src, href in this list? I wonder if there's a thing in our FED guide

Copy link
Contributor

@chrisberthe chrisberthe Feb 28, 2017

Choose a reason for hiding this comment

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

I'd be curious to know if there's anything like this in our FED guide too, will 👀 .

Personal preference but imo any attribute, e.g. href and src, that are specific to a tag should come right after the tag itself. For instance:

<img src="smiley.gif" alt="Smiley face" height="42" width="42" class="some-image" data-so-image data-much-wow="doge">

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looked into it. There's nothing. I'll just put them at the end.

@@ -65,7 +65,7 @@
{% endfor %}
{% endunless %}

<select class="no-js product-select" name="id">
<select data-product-select class="no-js" name="id">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@@ -57,7 +57,7 @@
{% endfor %}
{% endunless %}

<select class="no-js product-select" name="id">
<select data-product-select class="no-js" name="id">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@NathanPJF NathanPJF merged commit 9dbd1c5 into master Feb 28, 2017
@chrisberthe chrisberthe deleted the data-attr-selectors branch February 28, 2017 21:14
@lock
Copy link

lock bot commented Oct 26, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants