botoxparty / XP.css

A CSS framework for building faithful recreations of operating system GUIs.
https://botoxparty.github.io/XP.css/
MIT License
2.24k stars 106 forks source link

Make content of `window-body` able to scroll #33

Open NaitLee opened 3 years ago

NaitLee commented 3 years ago

I'm just making an explorer.exe liked thing, and need content of window-body to scroll (rather than overflow). So I tried this CSS:

.window-body {
    overflow: auto;
    height: calc(100% - 44px);  /* (inherit-height 100%) - (title-bar 21px) - (title-bar-border 1px) - (title-bar-padding 2 x 3px) - (window-body-margin 2 x 8px) */
}

Then it works as expected :)