Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
813dd1c5
Commit
813dd1c5
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Make colopocalypse a bit more idempotent so we can run again
parent
1c1cc167
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/colopocalypse
+20
-8
20 additions, 8 deletions
bin/colopocalypse
frontend/src/metabase/css/components/header.css
+1
-1
1 addition, 1 deletion
frontend/src/metabase/css/components/header.css
frontend/src/metabase/css/home.css
+2
-2
2 additions, 2 deletions
frontend/src/metabase/css/home.css
with
23 additions
and
11 deletions
bin/colopocalypse
+
20
−
8
View file @
813dd1c5
...
...
@@ -23,9 +23,12 @@ const CSS_SIMPLE_VAR_REGEX = /^var\(([^)]+)\)$/;
const
CSS_COLOR_VAR_REGEX
=
/^color
\(
var
\(([^
)
]
+
)\)
shade
\(([^
)
]
+
)\)\)
$/
;
const
CSS_VAR_REGEX
=
/var
\([^
)
]
+
\)
|color
\(
var
\([^
)
]
+
\)
shade
\([^
)
]
+
\)\)
/g
;
const
FILE_GLOB
=
"
frontend/**/*.{css,js,jsx}
"
;
const
FILE_GLOB
=
"
frontend/
src/
**/*.{css,js,jsx}
"
;
const
FILE_GLOB_IGNORE
=
[
// "**/metabase/lib/colors.js"
"
**/metabase/lib/colors.js
"
,
"
**/metabase/css/core/colors.css
"
,
"
**/metabase/auth/components/AuthScene.jsx
"
,
"
**/metabase/icon_paths.js
"
,
// // recast messes up these file and they don't have any colors so just ignore them:
// "**/metabase/query_builder/components/FieldList.jsx",
// "**/metabase/query_builder/components/filters/FilterPopover.jsx",
...
...
@@ -267,6 +270,11 @@ function replaceJSColorValues(content) {
function
replaceCSSColorVariables
(
content
)
{
const
lines
=
content
.
split
(
"
\n
"
);
return
content
.
replace
(
CSS_VAR_REGEX
,
(
variable
,
index
)
=>
{
const
match
=
variable
.
match
(
/^var
\(
--color-
(
.*
)\)
$/
);
if
(
match
&&
colors
[
match
[
1
]])
{
// already references a color, don't change it
return
variable
;
}
const
color
=
resolveCSSVariableColor
(
variable
);
if
(
color
)
{
const
palette
=
paletteForCSSProperty
(
cssPropertyAtIndex
(
lines
,
index
));
...
...
@@ -349,7 +357,9 @@ ${Object.entries(colors)
}\n\n`
;
const
content
=
fs
.
readFileSync
(
COLORS_CSS_PATH
,
"
utf-8
"
);
fs
.
writeFileSync
(
COLORS_CSS_PATH
,
colorsVarsBlock
+
content
);
if
(
content
.
indexOf
(
"
NOTE: DO NOT ADD COLORS
"
)
<
0
)
{
fs
.
writeFileSync
(
COLORS_CSS_PATH
,
colorsVarsBlock
+
content
);
}
}
function
prependJSVariablesBlock
()
{
...
...
@@ -361,11 +371,13 @@ const colors = window.colors = ${JSON.stringify(colors, null, 2)};
export default colors;\n\n`
;
const
content
=
fs
.
readFileSync
(
COLORS_JS_PATH
,
"
utf-8
"
);
const
anchor
=
"
export const brand =
"
;
fs
.
writeFileSync
(
COLORS_JS_PATH
,
content
.
replace
(
anchor
,
colorsVarsBlock
+
anchor
),
);
if
(
content
.
indexOf
(
"
NOTE: DO NOT ADD COLORS
"
)
<
0
)
{
const
anchor
=
"
export const brand =
"
;
fs
.
writeFileSync
(
COLORS_JS_PATH
,
content
.
replace
(
anchor
,
colorsVarsBlock
+
anchor
),
);
}
}
function
run
()
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/css/components/header.css
+
1
−
1
View file @
813dd1c5
...
...
@@ -34,7 +34,7 @@
}
.EditHeader
{
background-color
:
rgba
(
255
,
255
,
255
,
0.15
);
background-color
:
color
(
var
(
--color-bg-white
)
alpha
(
-85%
)
);
position
:
relative
;
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/css/home.css
+
2
−
2
View file @
813dd1c5
...
...
@@ -10,13 +10,13 @@
/* temporary css for the navbar and search */
.search-bar
{
background-color
:
rgba
(
255
,
255
,
255
,
0.1
);
background-color
:
color
(
var
(
--color-bg-white
)
alpha
(
-90%
)
);
border-color
:
transparent
;
color
:
white
;
}
.search-bar--active
{
background-color
:
rgba
(
255
,
255
,
255
,
0.25
);
background-color
:
color
(
var
(
--color-bg-white
)
alpha
(
-75%
)
);
border-color
:
var
(
--color-brand
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment