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

Flexbox CSS specificity bugs #5106

Closed
jdfreder opened this issue Feb 12, 2014 · 2 comments · Fixed by #5368
Closed

Flexbox CSS specificity bugs #5106

jdfreder opened this issue Feb 12, 2014 · 2 comments · Fixed by #5368
Assignees
Milestone

Comments

@jdfreder
Copy link
Member

I have a notebook (part of https://github.com/jdfreder/ipython-d3/) which uses the following code to center align contents within a box:

box.add_class('align-center')
box.add_class('center')

Unfortunately, this code doesn't seem to work always.

image

The specificity of the widget-container CSS is equal to the specificity of the flexbox alignment classes which leaves the browsers to make the decision of which class is more important. The widget-container inherits from the vbox class in LESS which defines default alignments. Since the LESS loses the inheritance structure when compiled, the default alignments are defined on the widget-container class (from the browsers point of view).

One possible, hackish, solution is to !important the alignment properties in the alignment classes. Maybe someone who is more familiar

@jdfreder jdfreder added this to the 2.0 milestone Feb 12, 2014
@jdfreder
Copy link
Member Author

Google has a lot of good info on specificity, but I still haven't found a solution.
https://www.google.com/search?q=css+specificity&oq=css+specific

@jdfreder jdfreder self-assigned this Mar 3, 2014
@jdfreder jdfreder changed the title Flexbox CSS specifity bugs Flexbox CSS specificity bugs Mar 17, 2014
@jdfreder
Copy link
Member Author

Closed by Pull Request #5368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant