Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
7e03913d
Commit
7e03913d
authored
Feb 08, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use TS instead of JS to store theme variables@next
parent
71576a63
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
36 deletions
+31
-36
packages/grafana-ui/src/themes/dark.ts
+6
-5
packages/grafana-ui/src/themes/default.ts
+1
-1
packages/grafana-ui/src/themes/index.d.ts
+0
-4
packages/grafana-ui/src/themes/index.js
+0
-16
packages/grafana-ui/src/themes/index.ts
+14
-0
packages/grafana-ui/src/themes/light.ts
+9
-10
packages/grafana-ui/src/themes/selectThemeVariant.test.ts
+1
-0
No files found.
packages/grafana-ui/src/themes/dark.
j
s
→
packages/grafana-ui/src/themes/dark.
t
s
View file @
7e03913d
const
defaultTheme
=
require
(
'./default'
);
const
tinycolor
=
require
(
'tinycolor2'
);
import
tinycolor
from
'tinycolor2'
;
import
defaultTheme
from
'./default'
;
import
{
GrafanaTheme
,
GrafanaThemeType
}
from
'../types/theme'
;
const
basicColors
=
{
black
:
'#000000'
,
...
...
@@ -29,9 +30,9 @@ const basicColors = {
orange
:
'#eb7b18'
,
};
const
darkTheme
=
{
const
darkTheme
:
GrafanaTheme
=
{
...
defaultTheme
,
type
:
'dark'
,
type
:
GrafanaThemeType
.
Dark
,
name
:
'Grafana Dark'
,
colors
:
{
...
basicColors
,
...
...
@@ -65,4 +66,4 @@ const darkTheme = {
},
};
module
.
exports
=
darkTheme
;
export
default
darkTheme
;
packages/grafana-ui/src/themes/default.
j
s
→
packages/grafana-ui/src/themes/default.
t
s
View file @
7e03913d
...
...
@@ -59,4 +59,4 @@ const theme = {
}
};
module
.
exports
=
theme
;
export
default
theme
;
packages/grafana-ui/src/themes/index.d.ts
deleted
100644 → 0
View file @
71576a63
import
{
GrafanaTheme
}
from
"../types"
;
export
function
getTheme
(
themeName
?:
string
):
GrafanaTheme
export
function
mockTheme
(
themeMock
:
(
name
:
string
)
=>
object
):
()
=>
void
packages/grafana-ui/src/themes/index.js
deleted
100644 → 0
View file @
71576a63
const
darkTheme
=
require
(
'./dark'
);
const
lightTheme
=
require
(
'./light'
);
let
mockedTheme
;
let
getTheme
=
name
=>
(
mockedTheme
&&
mockedTheme
(
name
))
||
(
name
===
'light'
?
lightTheme
:
darkTheme
);
const
mockTheme
=
mock
=>
{
mockedTheme
=
mock
;
return
()
=>
(
mockedTheme
=
null
);
};
module
.
exports
=
{
getTheme
,
mockTheme
,
};
packages/grafana-ui/src/themes/index.ts
0 → 100644
View file @
7e03913d
import
darkTheme
from
'./dark'
;
import
lightTheme
from
'./light'
;
import
{
GrafanaTheme
}
from
'../types/theme'
;
let
themeMock
:
((
name
?:
string
)
=>
GrafanaTheme
)
|
null
;
export
let
getTheme
=
(
name
?:
string
)
=>
(
themeMock
&&
themeMock
(
name
))
||
(
name
===
'light'
?
lightTheme
:
darkTheme
);
export
const
mockTheme
=
(
mock
:
(
name
:
string
)
=>
GrafanaTheme
)
=>
{
themeMock
=
mock
;
return
()
=>
{
themeMock
=
null
;
};
};
packages/grafana-ui/src/themes/light.
j
s
→
packages/grafana-ui/src/themes/light.
t
s
View file @
7e03913d
// import { GrafanaThemeType } from "../theme";
const
defaultTheme
=
require
(
'./default'
);
const
tinycolor
=
require
(
'tinycolor2'
);
import
tinycolor
from
'tinycolor2'
;
import
defaultTheme
from
'./default'
;
import
{
GrafanaTheme
,
GrafanaThemeType
}
from
'../types/theme'
;
const
basicColors
=
{
black
:
'#000000'
,
...
...
@@ -31,11 +30,11 @@ const basicColors = {
orange
:
'#ff7941'
,
};
const
lightTheme
/*: GrafanaThemeType*/
=
{
const
lightTheme
:
GrafanaTheme
=
{
...
defaultTheme
,
type
:
'light'
,
type
:
GrafanaThemeType
.
Light
,
name
:
'Grafana Light'
,
colors
:
{
colors
:
{
...
basicColors
,
variable
:
basicColors
.
blue
,
inputBlack
:
'#09090b'
,
...
...
@@ -65,7 +64,7 @@ const lightTheme/*: GrafanaThemeType*/ = {
dropdown
:
basicColors
.
white
,
scrollbar
:
basicColors
.
gray5
,
scrollbar2
:
basicColors
.
gray5
,
}
}
}
,
}
;
module
.
exports
=
lightTheme
;
export
default
lightTheme
;
packages/grafana-ui/src/themes/selectThemeVariant.test.ts
View file @
7e03913d
...
...
@@ -17,6 +17,7 @@ const darkThemeMock = {
};
describe
(
'Theme variable variant selector'
,
()
=>
{
// @ts-ignore
const
restoreTheme
=
mockTheme
(
name
=>
(
name
===
GrafanaThemeType
.
Light
?
lightThemeMock
:
darkThemeMock
));
afterAll
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment