Skip to content

CSS box-sizing reset with high specificity breaks spectrum-Calendar-tableCell #72

@Harbs

Description

@Harbs

spectrum-Calendar-tableCell has the following CSS:

.spectrum-Calendar-tableCell {
  text-align: center;
  padding: 0;
  position: relative;
  box-sizing: content-box;
  height: 32px;
  width: 32px;
  padding: 4px;
}

I always have the following CSS in my application:

.royale * {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}

This has a higher specificity and overrides the first css. If the above is not allowed with spectrum-css, I could write my own overrides, but I think specifying global border-box sizing is pretty standard.

Changing the css to the following should fix it:

.spectrum .spectrum-Calendar-tableCell {
  text-align: center;
  padding: 0;
  position: relative;
  box-sizing: content-box;
  height: 32px;
  width: 32px;
  padding: 4px;
}

I'm wondering why content-box is being used at all though. Why not set the width and height to 40px and keep border-box sizing? That seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions