關於next.js中的css
阿新 • • 發佈:2018-12-21
css進行了全域性和區域性的限制
export default () => ( <div className='hello'> <p>Hello World</p> <div className="addWords">some scoped words</div> <style jsx>{` .hello { font: 15px Helvetica, Arial, sans-serif; background: #eee; padding: 100px; text-align: center; transition: 100ms ease-in background; } .hello:hover { background: #ccc; } .addWords{ color:red; } `}</style> <style global jsx>{` body { color:yellow; } `}</style> </div> )
可見官方的github https://github.com/zeit/next.js/tree/canary/examples/basic-css