Skip to content

Template markup improvement - #138

Merged
ain merged 3 commits into
ain:v2from
Ge11ert:template-markup-improvement
Nov 18, 2019
Merged

Template markup improvement#138
ain merged 3 commits into
ain:v2from
Ge11ert:template-markup-improvement

Conversation

@Ge11ert

@Ge11ert Ge11ert commented Nov 16, 2019

Copy link
Copy Markdown

Hello! I am glad to see you use BEM for class naming convention (at least, it's pertty similar to bem).

But some parts of html template markup contain few mistakes, if we are talking about BEM.

The first (pretty common, but pretty rude) mistake - is having elements of elements. Or having block's grandchilds, if you like.

E.g. in master branch you have a block called smartbanner, which has an element smartbanner__info, which in his turn also has an element smartbanner__info__author.
Quick link to FAQ with this question.

The second what I noticed - markup has a plain div tag without any class. Some will judge you for that, some will not.
But AFAIK, you should avoid tags without a class, every should have one. Because if you dont have a class, there's no information about which block this element belongs to.

I am absolutely not shure about smartbanner__info-container, I'm not so inventive, so I would like to accept any suggestion, if you have it.

P.S. If these changes will be approved, I think the can go with v-2.0.0, when it comes to light. Because it might be breaking change for those, who rely on classnames.

@ain

ain commented Nov 17, 2019

Copy link
Copy Markdown
Owner

Many thanks for the criticism, it definitely deserves an improvement and it's great you've sent the PR!

You're right about this being a breaking change so it should definitely target v2.0.0.

@ain ain added this to the 2.0.0 milestone Nov 17, 2019

@ain ain left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Some suggestions.

Comment thread src/smartbanner.js Outdated
<div class="smartbanner__info__title">${this.options.title}</div>
<div class="smartbanner__info__author">${this.options.author}</div>
<div class="smartbanner__info__price">${this.options.price}${this.priceSuffix}</div>
<div class="smartbanner__info-container">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd suggest a more laconic copy here as in reference to matter that needs to be printed:

Suggested change
<div class="smartbanner__info-container">
<div class="smartbanner__copy">

Comment thread src/smartbanner.js Outdated
</div>
</div>
<a href="${this.buttonUrl}" target="_blank" class="smartbanner__button" rel="noopener" aria-label="${this.options.button}"><span class="smartbanner__button__label">${this.options.button}</span></a>
<a href="${this.buttonUrl}" target="_blank" class="smartbanner__button" rel="noopener" aria-label="${this.options.button}"><span class="smartbanner__button-text">${this.options.button}</span></a>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

In the legacy context, let's keep it closer to what it was?

Suggested change
<a href="${this.buttonUrl}" target="_blank" class="smartbanner__button" rel="noopener" aria-label="${this.options.button}"><span class="smartbanner__button-text">${this.options.button}</span></a>
<a href="${this.buttonUrl}" target="_blank" class="smartbanner__button" rel="noopener" aria-label="${this.options.button}"><span class="smartbanner__button-label">${this.options.button}</span></a>

Comment thread src/smartbanner.scss Outdated
&__label {
text-align: center;
}
&__button-text {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
&__button-text {
&__button-label {

Comment thread src/smartbanner.scss Outdated
&__label {
display: block;
padding: 0 10px;
.smartbanner__button-text {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
.smartbanner__button-text {
.smartbanner__button-label {

Comment thread test/spec/smartbanner_spec.js Outdated
<div class="smartbanner__info__title">Smart Application</div>
<div class="smartbanner__info__author">SmartBanner Contributors</div>
<div class="smartbanner__info__price">FREE - On the App Store</div>
<div class="smartbanner__info-container">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<div class="smartbanner__info-container">
<div class="smartbanner__copy">

Comment thread test/spec/smartbanner_spec.js Outdated
</div>
</div>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button__label">View</span></a>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-label">View</span></a>

Comment thread test/spec/smartbanner_spec.js Outdated
<div class="smartbanner__info__title">Smart Application</div>
<div class="smartbanner__info__author">SmartBanner Contributors</div>
<div class="smartbanner__info__price">FREE</div>
<div class="smartbanner__info-container">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<div class="smartbanner__info-container">
<div class="smartbanner__copy">

Comment thread test/spec/smartbanner_spec.js Outdated
</div>
</div>
<a href="#" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button__label">View</span></a>
<a href="#" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<a href="#" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>
<a href="#" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-label">View</span></a>

Comment thread test/spec/smartbanner_spec.js Outdated
<div class="smartbanner__info__title">Smart Application</div>
<div class="smartbanner__info__author">SmartBanner Contributors</div>
<div class="smartbanner__info__price">FREE - In Google Play</div>
<div class="smartbanner__info-container">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<div class="smartbanner__info-container">
<div class="smartbanner__copy">

Comment thread test/spec/smartbanner_spec.js Outdated
</div>
</div>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button__label">View</span></a>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-text">View</span></a>
<a href="https://play.google.com/store" target="_blank" class="smartbanner__button" rel="noopener" aria-label="View"><span class="smartbanner__button-label">View</span></a>

@Ge11ert
Ge11ert force-pushed the template-markup-improvement branch from 1face76 to b76c626 Compare November 18, 2019 22:22
@Ge11ert

Ge11ert commented Nov 18, 2019

Copy link
Copy Markdown
Author

@ain I dont know how to manage with these "suggested changes", actually :) (It seems, GH offers me to create new commits with applied changes, but I need fixup/amend them)
So I just pushed requested fixes into my commits and also performed rebase to your current master in order to resolve conflicts.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 94.619% when pulling b76c626 on Ge11ert:template-markup-improvement into 7bb61c6 on ain:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 94.619% when pulling b76c626 on Ge11ert:template-markup-improvement into 7bb61c6 on ain:master.

@Ge11ert
Ge11ert requested a review from ain November 18, 2019 22:29
@ain

ain commented Nov 18, 2019

Copy link
Copy Markdown
Owner

Many thanks! I'll release the current master as 1.15.0 and then we can jump-start the work for 2.0.0

@ain
ain changed the base branch from master to v2 November 18, 2019 23:36
@ain
ain merged commit cd10254 into ain:v2 Nov 18, 2019
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.

3 participants