Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Broad style rules in structure.scss can cause conflicts #1442

Closed
jelbourn opened this issue Feb 9, 2015 · 9 comments
Closed

Broad style rules in structure.scss can cause conflicts #1442

jelbourn opened this issue Feb 9, 2015 · 9 comments
Assignees
Labels
for: internal contributor The team will address this issue and community PRs are not requested. type: bug ui: layout
Milestone

Comments

@jelbourn
Copy link
Member

jelbourn commented Feb 9, 2015

The very broad rules in structure.scss (example below) can cause issues when used alongside another component library. We should explore ways to apply these styles more selectively.

*,
*:before,
*:after {
  box-sizing: border-box;
}
@ThomasBurleson ThomasBurleson modified the milestone: 0.9.0 Feb 17, 2015
@marcysutton marcysutton self-assigned this Mar 13, 2015
marcysutton pushed a commit that referenced this issue Mar 14, 2015
Includes new typography stylesheet, flex styles for layout.scss in Safari

Closes #1442, #1561, #1718
@jelbourn jelbourn added the for: internal contributor The team will address this issue and community PRs are not requested. label Mar 17, 2015
marcysutton pushed a commit that referenced this issue Mar 18, 2015
Includes new typography stylesheet, flex styles for layout.scss in Safari

Closes #1442, #1561, #1718
marcysutton pushed a commit that referenced this issue Mar 18, 2015
Includes new typography stylesheet, flex styles for layout.scss in Safari

Closes #1442, #1561, #1718
marcysutton pushed a commit that referenced this issue Mar 20, 2015
Includes new typography stylesheet, flex styles for layout.scss in Safari

Closes #1442, #1561, #1718
@marcysutton
Copy link
Contributor

That is good feedback. But if we don't provide defaults, then you'd ALWAYS have to provide a CSS class for headings, which would be a pain. Do you really need !important if your font size comes after that definition?

@PrashantAshok
Copy link

Thanks. Yes I don't need !important - didn't realize my files were being loaded before material files.

[btw, sorry i accidentally deleted my comment, re-posting here again]
aren't the default h tags still too broad?

h1 {
  @extend .md-display-1;
  font-weight: 400;
  margin: $h1-margin-base;
}

@marcysutton
Copy link
Contributor

@PrashantAshok wouldn't you already have to override the browser's default font size anyway? I am definitely thinking hard on whether the styles are in fact too broad, but I want to consider all angles. Libraries like Bootstrap do define default font sizes for headings. I think as long as they are easy to override, that is the key.

@PrashantAshok
Copy link

Yep. Libraries like bootstrap are easy to override, but I am thinking maybe material leaves it to bootstrap/others to define defaults and just has material specific styles?

@marcysutton
Copy link
Contributor

Great feedback from @jelbourn:

If you just want to use the datepicker, you shouldn't have to change the style of your <h1> tags, etc.

Based on that and your concerns @PrashantAshok, I'm thinking the base h tags should cascade off of a CSS class on the body or other parent element. Would that help?

@PrashantAshok
Copy link

I think that should work, something like .md-body {}?

@marcysutton
Copy link
Contributor

(Edited) A body class is not a good idea, as it turns out. We are investigating solutions for this, so stay tuned.

@marcysutton
Copy link
Contributor

@PrashantAshok have a look at #2042, it should sort everything out.

@PrashantAshok
Copy link

Looks great @marcysutton . Thanks.

marcysutton pushed a commit that referenced this issue Mar 27, 2015
Includes new typography stylesheet, flex styles for layout.scss in Safari

Closes #1442, #1561, #1718
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for: internal contributor The team will address this issue and community PRs are not requested. type: bug ui: layout
Projects
None yet
4 participants