mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
a30fcf9d9a
* Switch from SASS variables to CSS variables for most styling These are the simple cases, and the more complex ones will be covered by future commits. I’ve also replaced $fooZ ± 1 with the appropriate variable to avoid a runtime `calc()`. * Eliminate the `$style` variable 🔥 I’ve added a `--absolute` variable that’s `white` in dark mode and `black` in regular mode. * Remove `$inputFocusBorder` 🔥 * Switch the Prism styles to CSS variables * Convert `$mediumScreen` to a mixin * 🔥 `$selectionText` * Eliminate the final uses of SCSS variables I’ve dropped the 95% opacity on the background of the method source code overlay in RDoc since the difference isn’t noticeable but it makes implementation a lot easier. * Misc fixes * Extract the common variables from the two themes to a new file * Remove illegal usages of CSS variables in SCSS functions This flattens out the buttons on the settings page which makes the styles simpler (and more modern-looking IMO) and removes the box-shadow on the button, which was completely invisible to me. * Fix usages of SCSS functions in CSS variables * Use `html._theme-*` selectors * Eliminate `application-dark.css`; switch themes by toggling classes This also means that the Application Cache doesn’t have to get updated when toggling themes, and a new CSS file that’s nearly the same doesn’t need to be downloaded.
155 lines
2.4 KiB
SCSS
155 lines
2.4 KiB
SCSS
//
|
|
// Mobile overrides
|
|
//
|
|
|
|
._mobile {
|
|
font-size: 100%;
|
|
background: var(--contentBackground);
|
|
|
|
._hide-on-mobile { display: none; }
|
|
|
|
// Layout
|
|
|
|
body { -ms-overflow-style: -ms-autohiding-scrollbar; }
|
|
|
|
&:not(._booting) {
|
|
._app, ._content { overflow: visible; }
|
|
}
|
|
|
|
._container {
|
|
margin: 0;
|
|
padding-top: var(--headerHeight);
|
|
}
|
|
|
|
._content {
|
|
position: static;
|
|
height: auto;
|
|
margin: 0;
|
|
padding: .75rem 1rem 1px;
|
|
|
|
&:before { content: none; }
|
|
}
|
|
|
|
._content-loading:before, ._splash-title { font-size: 3rem; }
|
|
|
|
._header { position: fixed; }
|
|
|
|
._header, ._list {
|
|
width: 100%;
|
|
border-right: 0;
|
|
box-shadow: none;
|
|
}
|
|
|
|
// Settings
|
|
|
|
._settings { position: relative; }
|
|
._settings-tabs { display: block; }
|
|
._header > ._settings-btn-back { width: auto; }
|
|
|
|
// Header
|
|
|
|
._header-btn[hidden] { display: block; }
|
|
|
|
._search {
|
|
padding-right: .125rem;
|
|
padding-left: .125rem;
|
|
|
|
> svg { left: .5rem; }
|
|
}
|
|
|
|
._search-tag { left: .5rem; }
|
|
._search-clear > svg { left: .25rem; }
|
|
|
|
// Sidebar
|
|
|
|
._sidebar {
|
|
position: relative;
|
|
min-height: 100%;
|
|
overflow: visible;
|
|
}
|
|
|
|
._resizer { display: none; }
|
|
|
|
._list-item {
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
overflow-wrap: break-word;
|
|
box-shadow: none;
|
|
}
|
|
|
|
._list-result {
|
|
padding-left: 2.375rem;
|
|
|
|
&:before {
|
|
position: absolute;
|
|
top: .25rem;
|
|
left: .75rem;
|
|
}
|
|
}
|
|
|
|
// Notice
|
|
|
|
._notice {
|
|
position: fixed;
|
|
left: 0;
|
|
padding: 0 .5rem;
|
|
}
|
|
|
|
._notice-text { font-size: .75em; }
|
|
|
|
// Notification
|
|
|
|
._notif { position: fixed; }
|
|
|
|
// Table of contents
|
|
|
|
._toc {
|
|
float: none;
|
|
max-width: none;
|
|
margin-left: 0;
|
|
}
|
|
|
|
// Search Aliases
|
|
|
|
._aliases {
|
|
display: block;
|
|
|
|
> table { width: 100%; }
|
|
}
|
|
}
|
|
|
|
//
|
|
// Fix viewport on Windows Phone
|
|
//
|
|
|
|
@-ms-viewport { width: device-width; }
|
|
@media (orientation: portrait) and (min-device-width: 720px) and (max-device-width: 768px),
|
|
(orientation: landscape) and (device-width: 1280px) and (max-device-height: 768px) {
|
|
@-ms-viewport { width: 50%; }
|
|
}
|
|
|
|
//
|
|
// Header buttons
|
|
//
|
|
|
|
._forward-btn {
|
|
margin-right: -.5rem;
|
|
|
|
> svg { margin-left: -.375rem; }
|
|
}
|
|
|
|
//
|
|
// Intro
|
|
//
|
|
|
|
._mobile-intro {
|
|
> ._intro-list { padding-left: 1.5rem; }
|
|
|
|
._intro-hide {
|
|
position: static;
|
|
float: none;
|
|
display: block;
|
|
margin-top: .75rem;
|
|
text-align: center;
|
|
}
|
|
}
|