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

CSS Box Sizing Reset #48

Open
hedgecox opened this issue Aug 19, 2020 · 2 comments
Open

CSS Box Sizing Reset #48

hedgecox opened this issue Aug 19, 2020 · 2 comments

Comments

@hedgecox
Copy link
Contributor

Sakura seems to be almost 'plug and play' however the issue I seem to run into is the lack of box-sizing reset. A very basic CSS reset such as the following would prevent the need for global override on every project:

    html {
        box-sizing: border-box;
    }

    *, *:before, *:after {
        box-sizing: inherit;
    }

My only concern is this is potentially a breaking change as anyone who is currently using the default box sizing without a global override could potentially have layout shifts if this was applied

@oxalorg
Copy link
Owner

oxalorg commented Sep 17, 2020

@hedgecox Yes I agree.

I wanted to include it, but instead thought it would be better to recommend people to use Normalise.css as I was not too keen on reimplementing what normalize does. Turns out normalize does not add the border-box as I assumed it did.

We should definitely look forward to adding this, maybe in a v2 release. I'm open to more suggestions!

@hedgecox
Copy link
Contributor Author

hedgecox commented Oct 3, 2020

@oxalorg Sorry for the slow reply in getting back to this

Having a quick look at the Normalize.css source, I don't think there is a huge number of styles that would actually take affect (expecially in modern browsers) as they are immediately overridden by the Sakura styles.

You could probably achieve almost a full css reset by using something like the following (not tested)

   html {
        box-sizing: border-box;
    }

    *, *:before, *:after {
        box-sizing: inherit;
        margin: 0;
        padding: 0;
    }

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

No branches or pull requests

2 participants