Fossil Forum

CSS /setup_skin process is very buggy
Login

CSS /setup_skin process is very buggy

CSS /setup_skin process is very buggy

(1) By anonymous on 2023-12-30 01:35:09 [source]

I've been trying to make the page narrower so that it's not taking up the entire width of my screen. I modified the CSS as follows (this could be for any skin):

/* General settings for the entire page */
body {
  margin: 0 auto;
  max-width: 800px;
  padding: 0px;
  background-color: white;
  font-family: sans-serif;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  -mx-text-size-adjust: none;
}

I get a whole host of different behaviors when I do this and preview the results, and sometimes see the shortened max-width take effect, but I'm not able to actually apply the changes to the site. Dunno what's going on, this is my first time trying fossil. If someone can replicate the problem and fix this that would be great; I want to customize my page and make it look fancy.

(2) By Stephan Beal (stephan) on 2023-12-30 01:48:35 in reply to 1 [link] [source]

I get a whole host of different behaviors when I do this and preview the results, and sometimes see the shortened max-width take effect

The first thing to try when editing skins is to open up the browser's dev tools and check the "disable cache" button (in the "Network" tab in both Chrome and Firefox), and keep the dev tools open for the remainder of your style-editing session. Browsers are typically aggressive about caching stylesheets, often requiring multiple reloads to force them to update to newer CSS. The "disable cache" option works around that.

I want to customize my page and make it look fancy.

If i may offer two hints to that end:

  • Remove the vendor-prefixed CSS styles (-moz-..., -webkit-..., -mx-...). Modern browsers will often emit warnings in the dev console proclaiming that such prefixes are no longer supported.

  • Do not set a fixed max width for the site. Let the user set the width by sizing the window how they would like it. Forcing a fixed max width on a user mocks the user by effectively telling them, "we know better than you do how your screen space needs to be used."

(4) By anonymous on 2023-12-30 19:05:36 in reply to 2 [link] [source]

Thanks for the tips!

After I posted this issue I poked through the docs some more and found a workaround: I cloned the fossil-scm repository and found the skins directory with the css.txt file and other files. I then copied the files I wanted to my repository, edited them, and then ran fossil ui --skin /my-skin-directory. This produced the desired result.

I also modified the css, setting max-width: fit-content (which was helpfully suggested by my IDE) and this produced exactly the result I was looking for.

I don't think that my previous issue was due to browser caching because moving the css files to my local repository, running the ui and refreshing my page immediately reflected my changes each time, so I think there is something strange going on with the current functionality. Let me know if you need more details.

By the way, max-width: fit-content really looks a lot better. I recommend trying it out.

(6) By Stephan Beal (stephan) on 2023-12-30 19:13:25 in reply to 4 [link] [source]

and then ran fossil ui --skin /my-skin-directory.

Note that using --skin ... has one side-effect which may not be obvious: users will not be able to select their own skin using the /skins page. Whether that's a feature or a bug is left for you decide, but IMO it's a feature.

(3) By Warren Young (wyoung) on 2023-12-30 05:46:54 in reply to 1 [link] [source]

If all you're after is to inject a bit more "air" into the page, the "Modern" skin from the Inskinerator project does that, and it's ready to be copied. You don't even have to run Inskinerator itself; you can swipe the generated CSS directly from that linked page; it's demoing Modern.

Compared to the current Fossil default skin, Modern adds:

  • hierarchical indents on the left to make the page structure clearer
  • semi-hierarchical margins on the right (nearly fixed at all levels, but wider than default)
  • more line spacing
  • default font size

As to your solution of a fixed-width page, I'm in agreement with Stephan. Fixed widths that look fine on the desktop break down on mobile, and they're further likely to be unhelpful on pages like /dir and /vdiff`.

(5) By anonymous on 2023-12-30 19:08:15 in reply to 3 [link] [source]

Thanks for the tip! The Insinkerator changes do look nice.

By the way, I found that max-width: fit-content achieved the result I was looking for. I recommend giving it a try.