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

feat(accordions): provide accordions component - INNO-615 #207

Merged
merged 4 commits into from Jun 21, 2017

Conversation

yhuard
Copy link
Contributor

@yhuard yhuard commented Jun 21, 2017

Test that you can navigate with the keyboard (arrows up/down, space)

Copy link
Contributor

@emeryro emeryro left a comment

Choose a reason for hiding this comment

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

Overall display is good.
Some small remarks below.

Also, as is, the component can't be used in a composition. So maybe we should use variables (or a block).

}

.ecl-accordions__panel {
background-color: #f5f5f5;
Copy link
Contributor

Choose a reason for hiding this comment

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

should use ecl-colors palette (grey-5)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, thanks for noticing

* @define accordions
*/

.ecl-accordions__header {
Copy link
Contributor

Choose a reason for hiding this comment

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

should use "accordion" instead of "accordions" for classes, as this is what we do for other components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be. I'll rewrite it ;)

};

// module exports
export default accordions;
Copy link
Contributor

Choose a reason for hiding this comment

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

so in the end, accordions do not rely on expandables at all. That's quite a shame, but that's probably easier this way.

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'm thinking about making the "expandable" JS part of ecl-base. Kind of a helper which we would reuse in accordion, tabs, megamenu...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created INNO-640 for following-up

@@ -0,0 +1,18 @@
<div class="ecl-accordions" role="tablist" aria-multiselectable="true">
<h2 id="accordion-header-1" class="ecl-accordions__header" role="tab" aria-controls="accordion-panel-1" tabindex="0" aria-selected="true" aria-expanded="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like using headings inside components, as we don't know if they will match page hierarchy correctly.
Moreover, as you don't use specific ecl classes for headings, it make no real sense.

<h2 id="accordion-header-1" class="ecl-accordions__header" role="tab" aria-controls="accordion-panel-1" tabindex="0" aria-selected="true" aria-expanded="true">
<span class="ecl-accordions__header-icon ecl-icon ecl-icon--rounded ecl-u-bg-secondary ecl-icon--growth"></span> Jobs, Growth, Investment and Competitiveness with an additional quite long string
</h2>
<div id="accordion-panel-1" class="ecl-accordions__panel" role="tabpanel" aria-labelledby="accordion-header-1" tabindex="0" aria-hidden="false">
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason to set a tabindex here? It somehow mess with keyboard navigation (when using tabs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good remark, I'll remove it. http://www.oaa-accessibility.org/examplep/accordian1/ doesn't declare it either

"license": "EUPL-1.1",
"version": "0.1.0",
"description": "ECL Accordions",
"main": "_ecl-accordions.scss",
Copy link
Contributor

Choose a reason for hiding this comment

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

in other components we didn't put "ecl-" as prefix for sass file. I don't really know the reason, but we should keep it consistant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True

@emeryro
Copy link
Contributor

emeryro commented Jun 21, 2017

Another small remark: on small screens icons and margin take a lots of space. Maybe we could reduce the margin here.

@kalinchernev kalinchernev self-assigned this Jun 21, 2017
Copy link
Contributor

@kalinchernev kalinchernev left a comment

Choose a reason for hiding this comment

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

The solution works well for me.
I couldn't test the arrow navigation in Safari because the tabbing there is not easy, but IE9 worked, so I trust Safar should also...

@yhuard yhuard merged commit ce2e12a into master Jun 21, 2017
@yhuard yhuard deleted the feat/accordions branch June 21, 2017 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants