Fossil

Check-in [a21e2668]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Removed doc/help references to "overriding" CSS rules, as that no longer applies in this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | style-css-revamp
Files: files | file ages | folders
SHA3-256: a21e26684f76a3685ea03511ee596e4ba2264a2a2becca03e41f477093700488
User & Date: stephan 2020-05-18 03:38:16
Context
2020-05-18
12:32
Reverted [5abc0f6e7] because testing has shown the referrer to simply be too fragile and subject to browser-side whims (which also includes the option to send only the scheme and host, without the path, as the referrer, which breaks what that commit did). Now style.css supports both style.css/pagename and style.css?page=name, preferring the former, pending a decision on which one of those syntaxes the other devs prefer. Leaf check-in: 45341a28 user: stephan tags: style-css-revamp
03:38
Removed doc/help references to "overriding" CSS rules, as that no longer applies in this branch. check-in: a21e2668 user: stephan tags: style-css-revamp
02:59
style.css now checks for a builtin file named after the first path component of the referer (sic), rather than PD("name"), however, we still have to emit style.css/PAGENAME in $stylesheet_url in order to pick up the the page-specific CSS, otherwise /style.css?id=... is the same for all pages and a page with its own style may pick up a cached copy without its own styles, or with the styles from another page. check-in: 5abc0f6e user: stephan tags: style-css-revamp
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/skins.c.

706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
/*
** Emits the list of built-in default CSS selectors. Intended
** for use only from the /setup_skinedit page.
*/
static void skin_emit_css_defaults(){
  struct strctCssDefaults const * pCss;
  fossil_print("<h1>CSS Defaults</h1>");
  fossil_print("If a skin defines any of the following CSS selectors, "
               "that definition replaces the default, as opposed to "
               "cascading from it. ");
  fossil_print("See <a href=\"https://fossil-scm.org/fossil/"
               "doc/trunk/www/css-tricks.md\">this "
               "document</a> for more details.");
  /* To discuss: do we want to list only the default selectors or
  ** also their default values? The latter increases the size of the
  ** page considerably, but is arguably more useful. We could, of
  ** course, offer a URL param to toggle the view, but that currently







|
<
<







706
707
708
709
710
711
712
713


714
715
716
717
718
719
720
/*
** Emits the list of built-in default CSS selectors. Intended
** for use only from the /setup_skinedit page.
*/
static void skin_emit_css_defaults(){
  struct strctCssDefaults const * pCss;
  fossil_print("<h1>CSS Defaults</h1>");
  fossil_print("Fossil's list of its own CSS classes follows. ");


  fossil_print("See <a href=\"https://fossil-scm.org/fossil/"
               "doc/trunk/www/css-tricks.md\">this "
               "document</a> for more details.");
  /* To discuss: do we want to list only the default selectors or
  ** also their default values? The latter increases the size of the
  ** page considerably, but is arguably more useful. We could, of
  ** course, offer a URL param to toggle the view, but that currently

Changes to www/css-tricks.md.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
This is a "living document" - please feel free to suggest
additions via [the Fossil forum](https://fossil-scm.org/forum/).

This document is *not* an introduction to CSS - the web is
full of tutorials on that topic. It covers only the specifics
of customizing certain CSS-based behaviors in a Fossil UI. That said...

# Overriding Default Rules

One behavior of the skinning system works considerably differently
from the cascading nature of CSS: if a skin applies a CSS selector for
which Fossil has a built-in default value, Fossil elides the entire
default definition for that rule. i.e., the skin's definition is the
only one which is applied, rather than cascading the definition from
the default value.

For example, if Fossil has a default CSS rule which looks like:

```css
div.foo {
  font-size: 120%;
  margin-left: 1em;
}
```

And a skin has:

```css
div.foo {}
```

Then Fossil will *not* emit its default rule and the user's copy will
become the only definition of that CSS rule. This is different from
normal CSS cascading rules, in which the above sequence would result
in, effectively, the top set of rules being applied because the second
(empty) one does not override anything from the first.

If a skin applies a given selector more than once, or imports external
style sheets which do, those cascade following CSS's normal rules.

## Is it Really `!important`?

By and large, CSS's `!important` qualifier is not needed when
customzing Fossil's CSS. On occasion, however, particular styles may
be set directly on DOM elements when Fossil generates its HTML, and
such cases require the use of `!important` to override them.








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







8
9
10
11
12
13
14

































15
16
17
18
19
20
21
This is a "living document" - please feel free to suggest
additions via [the Fossil forum](https://fossil-scm.org/forum/).

This document is *not* an introduction to CSS - the web is
full of tutorials on that topic. It covers only the specifics
of customizing certain CSS-based behaviors in a Fossil UI. That said...


































## Is it Really `!important`?

By and large, CSS's `!important` qualifier is not needed when
customzing Fossil's CSS. On occasion, however, particular styles may
be set directly on DOM elements when Fossil generates its HTML, and
such cases require the use of `!important` to override them.