🚿 A modern CSS reset

  • By ● filipe
  • Last update: Jan 6, 2023
  • Comments: 11

A brunch and the ress name

Modern CSS reset

Build Status Size npm

Installation

npm install --save ress

or

bower install --save ress

Features

  1. Apply box-sizing: border-box; in all elements.
  2. Reset padding and margin in all elements.
  3. Specify background-repeat: no-repeat in all elements and pseudo elements.
  4. Inherit text-decoration and vertical-align to ::before and ::after.
  5. Remove the outline when hovering in all browsers.
  6. Specify font-family: monospace in code elements.
  7. Reset border-radius in input elements.
  8. Specify font inheritance of form elements.
  9. Remove the default button styling in all browsers.
  10. Specify textarea resizability to vertical.
  11. Apply cursor: pointer to button elements.
  12. Apply tab-size: 4 in html.
  13. Style select like a standard input.
  14. Style cursor by aria attributes.

Crossbrowser

ress uses Normalize.css under the hood with some customizations to apply a solid base to start your stylesheet.

Browser support

Inherit from Normalize

CDN

unpkg

https://unpkg.com/ress/dist/ress.min.css

RawGit

# Production
https://cdn.rawgit.com/filipelinhares/ress/master/dist/ress.min.css

# Development
https://rawgit.com/filipelinhares/ress/master/dist/ress.min.css

License

MIT © Filipe Linhares

Github

https://github.com/filipelinhares/ress

Comments(11)

  • 1

    Apply cursor: pointer to button elements

    It has always bugged me that buttons don't default to the pointer cursor. An implementation that excludes the "disabled" attribute would make sense.

    button {
        cursor: pointer;
    }
    
    button:disabled {
        cursor: default;
    }
    
  • 2

    Weird looking radio buttons in Safari Mobile

    I think this is because of:

    button,
    input,
    select,
    textarea {
      background-color: transparent;
      border-style: none;
      color: inherit;
    }
    

    and

    input {
      border-radius: 0;
    }
    

    Should we add :not([type=checkbox]):not([type=radio]) to those?

  • 3

    Remove form elements' focus outline

  • 4

    Button color

    The button style adds a "color: inherit" property, which adds complexity to style the button

    /* Apply cursor pointer to button elements */
    button,
    [type='button'],
    [type='reset'],
    [type='submit'],
    [role='button'] {
      cursor: pointer;
      color: inherit;
    }
    
  • 5

    Input content multiline

    Hi, I've noticed that the property word-break: break-word is behaving differently in different browsers. In particular, the content of an input tag, if too long, will break on multiple lines in Safari but not in Chrome.

    Since the default value is word-break: normal I would suggest changing this. Let me know. Thanks

  • 6

    button:active color property is not reset

    button:active color property is not reset. This is problematic in Safari which uses

    input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::-webkit-file-upload-button:active, button:active {
      color: activebuttontext;
    }
    

    where activebuttontext is code for white.

  • 7

    [disabled] rule is defined too soon

    /* Replace pointer cursor in disabled elements */
    [disabled] {
      cursor: default;
    }
    

    This rule is overridden by the button rule that sets the cursor to pointer.

    Solution: define the rule later in the CSS.

  • 8

    Change out rawgit links to jsDelivr

  • 9

    border-style on iframe elements

    Hi @filipelinhares,

    I noticed that iframe on chrome (didn't test other browsers) have the following:

    border-width: 2px;
    border-style: inset;
    border-color: initial;
    border-image: initial;
    

    I was thinking that maybe we could add a border-style: none to align default styling. What do you think? Is this in the scope of this library?

    Thank you in advance 😁

  • 10

    Avoid `cursor: default` when `aria-disabled="false"`

    Before fix

    • <a href="" aria-disabled="false"> => default cursor
    • <a href="" aria-disabled="true"> => default cursor

    After fix

    • <a href="" aria-disabled="false"> => pointer cursor
    • <a href="" aria-disabled="true"> => default cursor
  • 11

    Bump ini from 1.3.5 to 1.3.8

    Bumps ini from 1.3.5 to 1.3.8.

    Commits
    • a2c5da8 1.3.8
    • af5c6bb Do not use Object.create(null)
    • 8b648a1 don't test where our devdeps don't even work
    • c74c8af 1.3.7
    • 024b8b5 update deps, add linting
    • 032fbaf Use Object.create(null) to avoid default object property hazards
    • 2da9039 1.3.6
    • cfea636 better git push script, before publish instead of after
    • 56d2805 do not allow invalid hazardous string as section name
    • See full diff in compare view
    Maintainer changes

    This version was pushed to npm by isaacs, a new releaser for ini since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.