skeletonbow: ---8<---snip--->8---
I posted similar somewhere in the forums ages ago last year or so along with some other related changes. They all work but unfortunately they get blown away every time Galaxy is updated, and you can't just lock the files from being overwritten nor back them up and restore your original later because GOG actually updates those files with new content regularly which could cause problems if it gets blown away also.
The files are a jumbled compacted mess so there is no decent way to track changes as-is either. The only way to customize it and track new releases is to do something like passing the files through some kind of cssindent type program or similar, importing it into a git repository or similar, making changes to it and committing them, then recompacting the deployed files. When it is updated, taking the updated file and auto-indenting it the same why, creating a diff between that and the prior GOG original and merging it with your changes in the git repo head and exporting a copy and recompacting it. A bit of a pain in the ass but some of it could be automated with scripts etc. I've been meaning to do that but never got around to it.
---8<---snip--->8---
Personally, I use emacs for such HTML/CSS tasks. I haven't done much of anything with Galaxy's HTML/CSS stuff other than try a couple of the changes you (skeletonbow) recommend ages ago, as you say. That worked out, but I have a personal stylesheet for gog.com that I activate with Safari in its Advanced preferences, so for now I prefer a web browser with personal styles and gog.com instead of Galaxy.
What I would do if I wanted to customize the CSS for Galaxy, even if I didn't have emacs, would be to create a plain text file and keep notes in it about the changes I'd make to whichever files. Those notes would include:
• The name of the file.
• The name of the CSS selector for the ruleset, and the properties and values to change/add.
—That gives me key words (class names, property names, values, etc.) to search for finding the selector (if it hasn't changed) or for finding something similar if a minor change was made in the upgrade to the overall CSS styles.
• If I did a search/replace when editing, then I'll probably copy/paste the search and replace values so I can copy/paste them from my notes file next time.
In essence, I would use
copy/paste to make my notes about the changes I make. Then when a file changes, for example with Galaxy that would mean after it's updated, I would use
copy/paste to implement the search within the relevant file and then
copy/paste to implement the replacement. That's actually very little to do, prevents typographical errors on my part, requires no special applications or scripting, no backup software or version control, and relies on tried and true
copy/paste into a plain text file and re-implementing from that plain text file.
Note-taking and copy/paste. It's better than custom scripting, IMHO.
Oh, and if re-indenting an HTML or CSS file is desired for temporary viewing (for whatever reason), and I"m without a syntax coloring text viewer/editor (for example, I'm without emacs for whatever reason) then I'd say use a web browser. Web browsers nowadays (2017) seem to automatically re-indent HTML files and CSS files when viewed as the source for a page. Though, a CSS file all by itself in a web browser will likely look formatted the same way it was written. It seems like a CSS file has to be referenced from within an HTML page to trigger the auto-reformatting of the CSS.
To make that happen for a specific CSS file, simply make a new HTML file (append .html as the extension, for example "test.html") that references that specific CSS file. The only HTML needed for this in an HTML file is one single line with a <link> element with the rel attribute and href attribute. Nothing else is needed in the file.
<link rel="stylesheet" href="file:///Wherever/GOG/Put/It/On/Your/Computer/whatever-the-name-GOG-gave-it.css">
Then drag and drop that HTML file (perhaps you named your html file "test.html"?) into a web browser and view the source, in particular its CSS resources. There should be a way choose the referenced CSS file, which then will show it automatically re-formatted by the web browser. Safari seems to do this, and search is available, too, with Command-F after clicking into the CSS part of the inspector.
Again, no special applications, and the procedure is simply to edit a plain text file (albeit an HTML file) with only one HTML element. Unless the name of the CSS file changes in an update to Galaxy, or its path, then that HTML file will continue to work without further modifications for viewing the CSS file automatically reformatted even after Galaxy updates. Assuming that's desired. Oh, of course, if there is more than one CSS file desired for viewing, simply add another <link> element in the same file, because there can be as many <links> as desired. Well, depending how large infinity is… Sometimes that's a smaller number than expected.
Maighstir: ---8<---
The rules of CSS state that if a certain style of the same element is set multiple times, the
last is what defines which is used. Thus, if you set a new width (for #sidebar, in this case) at the end of the file, that should override what's set before.
Absolutely true. Though it's also important to keep specificity of the selector in mind.
Or, simply always use "!important" (an exclamation mark "!" followed by the word "important") for each changed property for any rulesets appended to the very end of the CSS file. That always works to override any previous styles regardless of specificity as long as the selector actually matches the intended element.