Skip to content

[foundation]: Basic element styles #3533

Closed
@gfellerph

Description

Since we're removing bootstrap as a dependency, we can also implement our own CSS reset.

Proposal

/* === Source: Josh Comeau, https://www.joshwcomeau.com/css/custom-css-reset/ (adapted) === */

/*
  Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
  box-sizing: border-box;
}

/*
  Improve media defaults
*/
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/*
  Remove built-in form typography styles
*/
input, button, textarea, select {
  font: inherit;
}

/*
  Avoid text overflows
*/
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  hyphen: auto;
}

References

  • normalize.css: Has some good resets, but also supports older browsers like IE which is not necessary anymore and most of the styles can be applied to elements directly.
  • modern CSS reset: adapted in the proposal above
  • reset CSS: made for older browsers
  • reboot: bootstrap resets, could be interesting for element files

Activity

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

Metadata

Assignees

Labels

📦 stylesRelated to the @swisspost/design-system-styles package

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions