O'Reilly logo

Cross-platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding custom styles with SASS

Seemingly, the resulting UI needs additional styling. I suggest that we code our custom styles in SASS:

./app/sass/app.scss

 .main-wrapper { 
  height: 100vh; 
} 

First of all, we make the top level element (./app/ts/Containers/App.tsx) always adapt to the actually window height.

Further, we declare a variable for the fixed height of the title bar and set the layout for feed items and item content containers:

./app/sass/app.scss

 $headrHeight: 66px; .feed-index { display: flex; flex-flow: row nowrap; overflow-y: auto; height: calc(100vh - #{$headrHeight}); &.is-open { overflow-y: hidden; .feed-list { width: 50%; } .feed-contents { width: 50%; } } } .feed-list { flex: 1 0 auto; width: 100%; transition: width 200ms ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required