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

Indent nested taxon menues and highlight the selected taxons. #2316

Merged
merged 1 commit into from
May 3, 2018
Merged

Indent nested taxon menues and highlight the selected taxons. #2316

merged 1 commit into from
May 3, 2018

Conversation

bofrede
Copy link
Contributor

@bofrede bofrede commented Oct 23, 2017

To see this in action you need:

  • Create multiple nested taxons in the backend.
  • config.max_level_in_taxons_menu = 3 in config/initializers/spree.rb

@kennyadsl
Copy link
Member

Hello! It would be great if you could explain better which problem this PR will solve, and maybe post some screenshot of the result so it is immediately clear to everyone.

Thanks for your contribution!

@bofrede
Copy link
Contributor Author

bofrede commented Oct 23, 2017

Without this fix, the taxon menu looks like this

  • Cars
  • Ferrari
  • Lotus
  • Mercedes
  • Boats
  • Regal
  • Wellcraft

With this fix, the taxon menu looks like this

  • Cars
    • Ferrari
    • Lotus
    • Mercedes
  • Boats
    • Regal
    • Wellcraft

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

I see the issue and this PR fixes it. I just think scss can be simplified and I left a comment about that.

a {
font-size: $main_navigation_font_size
}
}
.current {
font-weight: bold;
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this code can be simplified in this way:

  ul.taxons-list {
    ul {
      margin-left: 1em;
    }

    li {
      font-size: $main_navigation_font_size;
      font-weight: normal;

      &.current {
        font-weight: bold;
      }
    }
  }

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 agree it can be simplified a little.
However &.current is a too specific selector.

Copy link
Member

@kennyadsl kennyadsl Oct 23, 2017

Choose a reason for hiding this comment

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

I think it works with &.current since it applies to ul.taxons-list li, which is exactly elements that need this style.

Copy link
Member

Choose a reason for hiding this comment

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

@kennyadsl I think @bofrede meant that the selector is too strong in terms of "Do not over specify css selectors" rule of thumb. It would be hard to override this if we over specify selectors. 90% of !important usage is because CSS authors uses too specific css selectors.

Copy link
Member

Choose a reason for hiding this comment

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

@tvdeyen thanks for your feedback. Yes, it's probably better to have it less specific.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

LGTM

a {
font-size: $main_navigation_font_size
}
}
.current {
font-weight: bold;
}
Copy link
Member

Choose a reason for hiding this comment

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

@kennyadsl I think @bofrede meant that the selector is too strong in terms of "Do not over specify css selectors" rule of thumb. It would be hard to override this if we over specify selectors. 90% of !important usage is because CSS authors uses too specific css selectors.

kennyadsl
kennyadsl previously approved these changes Oct 25, 2017
@kennyadsl kennyadsl dismissed their stale review October 25, 2017 10:33

It's bettter to squash commits into a single one

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

I'm ok with changes but can you squash commits into a single one please? Thanks!

@bofrede
Copy link
Contributor Author

bofrede commented Oct 29, 2017

Now simplified and squashed as per @kennyadsl's request.

@kennyadsl
Copy link
Member

Thanks!

@tvdeyen tvdeyen merged commit 679674b into solidusio:master May 3, 2018
@tvdeyen
Copy link
Member

tvdeyen commented May 3, 2018

Sorry that this took so long to be merged. Please feel free to ping us, if an approved PR takes too long to be merged.

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