最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Do I need normalize.css when developing my own Wordpress-theme?

programmeradmin6浏览0评论

I'm developing my own Wordpress theme and I'm trying to make it as light as possible. I started from the Underscores starter theme, but they use normalize.css to reset the styles.

Is it necessary to include it in my theme or is there a better method?

I'm developing my own Wordpress theme and I'm trying to make it as light as possible. I started from the Underscores starter theme, but they use normalize.css to reset the styles.

Is it necessary to include it in my theme or is there a better method?

Share Improve this question asked May 7, 2019 at 13:08 Thessa VerbruggenThessa Verbruggen 2452 silver badges10 bronze badges 3
  • 1 It's a helpful thing to do for consistency of looks across browsers. not totally necessary, but could reduce the need for browser-specific design fixes later. I reckon it's a good thing, so have included it in my theme. – majick Commented May 7, 2019 at 13:12
  • 1 It's not 'necessary', but it'll help you get consistent styles across browsers. The CSS in your theme can be literally anything you want, but there's a reason people use normalize. It helps. – Jacob Peattie Commented May 7, 2019 at 13:13
  • I guess I'll keep it in there, just to be sure everything will look okay. I just wanted to reduce the amount of code in my theme. – Thessa Verbruggen Commented May 7, 2019 at 13:47
Add a comment  | 

1 Answer 1

Reset to default 2

Web standards are pretty good these days and IMO I don't think things like normalize are nearly as necessary as years ago.

I would recommend having a look through the CSS file and deciding for yourself.

You can always just grab what styles you think are relevant and include them in your own CSS. This will cut down on a dependency and make you more aware of what code you are including in your own theme.

Quick note: You can use caniuse to look up specific styles or tags you might have questions about.

For Example, normalize includes this CSS...

main {
   display: block;
}

If you look up main HERE, you will see it was added to the spec late and could cause bugs in IE if you don't apply block to it.

发布评论

评论列表(0)

  1. 暂无评论