When writing a theme, is there a way to remove or prevent all default styling?

When I try to write my own theme, I’m confronted with the fact, that a lot of CSS is applied before my own, eg. for many of the .dijit and .claro classes.

Is there a way to configure my theme so these styles don’t get set? I’d like to start with the raw, unstyled HTML, like I often do with Wordpress themes or other websites, basically like a CSS reset.

I have not found a page documenting the process of making themes. If it exists, it would help me as well. Thanks in advance!

(Also, is there a way for themes to affect page HTML and Javascript, or is it only CSS and images?)

are you trying to @import default.css or use customize css? because otherwise no stock css is included.

see default themes in themes/ for more information.

Thanks for your reply!

As of now, I’m not importing any other file in my theme’s CSS file. When I check the site in the browser though, I see that claro.css is loaded and applied anyway. Is there a way to prevent that?

I looked at the other themes in the themes/ directory, but wasn’t able to learn whether they started from scratch or built on claro themselves.

oh right, that’s dojo base css, you won’t be able to prevent that from loading i’m afraid

i can suggest wrapping your stuff into body.claro and going from there.

ok, thanks for your help.

I have been reading up on it, but it seems dojo has a lot of styles from the start, so I have to do a lot of overriding and !important to do, sadly.

I solved this for my particular installation by modifying index.php, which is unelegant and messes up future releases, but I saw it as my only option here.

I added a few lines that check whether the theme’s CSS file has a second line with a comment /* load-default-css:0 */
If it does, it skips loading Dojo’s clara theme file. Beware, if you go down this path you have a lot of work ahead of you, redeclaring all interface CSS.

From line 63 of index.php

<?php if ($_SESSION["uid"]) {
    $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
    $load_default_theme = true;
    if ($theme && theme_valid("$theme")) {

        /* check whether we're loading the default dojo CSS */
        $fh = fopen(get_theme_path($theme), "r");
        $line2 = '';
        if ($fh) {
            fgets($fh);
            $line2 = fgets($fh);
            fclose($fh);
        }
        if(!strpos($line2, "load-default-css:0") !== FALSE) {
            echo stylesheet_tag("lib/dijit/themes/claro/claro.css");
        } else {
            $load_default_theme = false;
            echo("<!-- skipped loading of dojo CSS -->\n\t");
        }

        echo stylesheet_tag(get_theme_path($theme));
    } else {
        echo stylesheet_tag("lib/dijit/themes/claro/claro.css");
        echo stylesheet_tag("css/default.css");
    }
}
?>

and further down, on the <body> element:

<body class="<?php if($load_default_theme) echo 'claro ' ?>ttrss_main">

as far as i’m concerned this is out of scope for themes, so i’m not going to.