Initial support for userContent.css (#389)

This commit is contained in:
Tom Bursch 2022-05-23 17:14:33 +02:00 committed by GitHub
parent fc44130eb9
commit c8ad4341c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -56,6 +56,26 @@ function saveProfile(){
echo "@import \"firefox-gnome-theme\/theme/colors/dark-$THEME.css\";" >> userChrome.css echo "@import \"firefox-gnome-theme\/theme/colors/dark-$THEME.css\";" >> userChrome.css
fi fi
# Create single-line user content CSS files if non-existent or empty.
if [ -s userContent.css ]; then
# Remove older theme imports
sed 's/@import "firefox-gnome-theme.*.//g' userContent.css | sed '/^\s*$/d' > userContent.css
echo >> userContent.css
else
echo >> userContent.css
fi
# Import this theme at the beginning of the CSS files.
sed -i '1s/^/@import "firefox-gnome-theme\/userContent.css";\n/' userContent.css
if [ $THEME = "DEFAULT" ]; then
echo "No theme set, using default adwaita."
else
echo "Setting $THEME theme."
echo "@import \"firefox-gnome-theme\/theme/colors/light-$THEME.css\";" >> userContent.css
echo "@import \"firefox-gnome-theme\/theme/colors/dark-$THEME.css\";" >> userContent.css
fi
cd .. cd ..
# Symlink user.js to firefox-gnome-theme one. # Symlink user.js to firefox-gnome-theme one.

9
theme/pages/newtab.css Normal file
View File

@ -0,0 +1,9 @@
/* about:newtab */
@-moz-document url("about:newtab"), url("about:home") {
body {
--newtab-background-color: var(--gnome-browser-before-load-background) !important;
--newtab-background-color-secondary: var(--gnome-button-background) !important;
--newtab-primary-action-background: var(--gnome-accent) !important;
}
}

4
userContent.css Normal file
View File

@ -0,0 +1,4 @@
@import "theme/colors/light.css";
@import "theme/colors/dark.css";
@import "theme/pages/newtab.css";