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

Fixed mode card arrangement #51

Merged
merged 2 commits into from
Mar 9, 2017
Merged

Fixed mode card arrangement #51

merged 2 commits into from
Mar 9, 2017

Conversation

fxedel
Copy link
Member

@fxedel fxedel commented Mar 9, 2017

The problem with :nth-of-type is, that it only works with tags, not classes. See mdn docs:

The :nth-of-type(an+b) CSS pseudo-class matches an element that has an+b-1 siblings with the same element name before it in the document tree

If a tag is matched by :nth-of-type, it only later checks if it also matches the selector before, e.g. .card.fixture-mode in .card.fixture-mode:nth-of-type. So it's not possible to match every second .card, but only every second section. See this live fiddle showing this problematic.

We could either keep it like this and toggle between even and odd every time sections are added/removed before the modes or we introduce another container around the modes.

@fxedel fxedel added bug Something doesn't work as intended. component-ui Affects the user interface on the open-fixture-library.org website. labels Mar 9, 2017
@FloEdelmann FloEdelmann temporarily deployed to open-fixture-library-pr-51 March 9, 2017 21:35 Inactive
@fxedel fxedel requested a review from FloEdelmann March 9, 2017 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work as intended. component-ui Affects the user interface on the open-fixture-library.org website.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants