1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Using .theme-light flag across components

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-08-21 10:48:33 +03:00
parent a12b16cec9
commit 112114385e
9 changed files with 21 additions and 23 deletions

View File

@ -1,13 +1,6 @@
@import "release.mixins"; @import "release.mixins";
.ReleaseDetails { .ReleaseDetails {
&.light {
.AceEditor {
border: 1px solid gainsboro;
border-radius: $radius;
}
}
.DrawerItem { .DrawerItem {
align-items: center; align-items: center;
} }

View File

@ -5,14 +5,17 @@
flex: 1; flex: 1;
z-index: 10; z-index: 10;
&.hidden { .theme-light & {
visibility: hidden; border: 1px solid gainsboro;
border-radius: $radius;
.ace_scrollbar {
@include custom-scrollbar(dark);
}
} }
&.light { &.hidden {
.ace_scrollbar { visibility: hidden;
@include custom-scrollbar($theme: dark);
}
} }
> .editor { > .editor {

View File

@ -148,9 +148,8 @@ export class AceEditor extends React.Component<Props, State> {
render() { render() {
const { className, hidden } = this.props; const { className, hidden } = this.props;
const themeType = themeStore.activeTheme.type;
return ( return (
<div className={cssNames("AceEditor", className, { hidden }, themeType)}> <div className={cssNames("AceEditor", className, { hidden })}>
<div className="editor" ref={e => this.elem = e}/> <div className="editor" ref={e => this.elem = e}/>
</div> </div>
) )

View File

@ -5,7 +5,7 @@
margin-left: $padding * 2; margin-left: $padding * 2;
margin-top: $padding * 2; margin-top: $padding * 2;
&.light { .theme-light & {
.xterm-viewport { .xterm-viewport {
@include custom-scrollbar(dark); @include custom-scrollbar(dark);
} }

View File

@ -9,7 +9,7 @@
box-shadow: 0 0 $unit * 2 $boxShadow; box-shadow: 0 0 $unit * 2 $boxShadow;
z-index: $zIndex-drawer; z-index: $zIndex-drawer;
&.light { .theme-light & {
.drawer-content { .drawer-content {
@include custom-scrollbar(dark); @include custom-scrollbar(dark);
} }

View File

@ -6,7 +6,6 @@ import { cssNames, noop } from "../../utils";
import { Icon } from "../icon"; import { Icon } from "../icon";
import { Animate, AnimateName } from "../animate"; import { Animate, AnimateName } from "../animate";
import { history } from "../../navigation"; import { history } from "../../navigation";
import { themeStore } from "../../theme.store";
export interface DrawerProps { export interface DrawerProps {
open: boolean; open: boolean;
@ -101,7 +100,7 @@ export class Drawer extends React.Component<DrawerProps> {
render() { render() {
const { open, position, title, animation, children, toolbar, size, usePortal } = this.props const { open, position, title, animation, children, toolbar, size, usePortal } = this.props
let { className, contentClass } = this.props; let { className, contentClass } = this.props;
className = cssNames("Drawer", className, position, themeStore.activeTheme.type); className = cssNames("Drawer", className, position);
contentClass = cssNames("drawer-content flex column box grow", contentClass); contentClass = cssNames("drawer-content flex column box grow", contentClass);
const style = size ? { "--size": size } as React.CSSProperties : undefined; const style = size ? { "--size": size } as React.CSSProperties : undefined;
const drawer = ( const drawer = (

View File

@ -11,6 +11,10 @@
@include custom-scrollbar; @include custom-scrollbar;
--flex-gap: #{$spacing}; --flex-gap: #{$spacing};
padding: $spacing; padding: $spacing;
.theme-light & {
@include custom-scrollbar(dark);
}
} }
> .head-col { > .head-col {

View File

@ -1,9 +1,9 @@
.Table { .Table {
&.scrollable { &.scrollable {
&.light { .theme-light & {
@include custom-scrollbar(dark); @include custom-scrollbar(dark);
} }
@include custom-scrollbar(); @include custom-scrollbar();
flex: 1 0 0; // hackfix: flex-basis must be "0" for proper work in firefox flex: 1 0 0; // hackfix: flex-basis must be "0" for proper work in firefox
} }

View File

@ -94,8 +94,8 @@ export class ThemeStore {
}); });
this.styles.textContent = `:root {\n${cssVars.join("\n")}}`; this.styles.textContent = `:root {\n${cssVars.join("\n")}}`;
// Adding universal theme flag which can be used in component styles // Adding universal theme flag which can be used in component styles
const rootElem = document.getElementById("app"); const body = document.querySelector("body");
rootElem.classList.toggle("theme-light", theme.type === ThemeType.LIGHT); body.classList.toggle("theme-light", theme.type === ThemeType.LIGHT);
} }
} }