Css is different between logged-in and logged-out users?

I have no idea that causes this? Like over half of the css values disappear suddenly when I log out and everything starts to look very ugly.

  • is probably something to do with a plugin being active, or css only being called if the user is logged in

     

  • Any idea how to fix this? For example...

    I've got a looong css-file that contains almost all the css-rules. It extends the view of "css/elgg"
    elgg_extend_view('css/elgg','customize_css/css', $priority);

    There I've got a rule like this:

    /***** TOPBAR ******/
    .elgg-page-topbar{
        position: fixed;
        height: 38px;
        left: 0;
        right: 0;
        z-index: 10000;
    background-image: linear-gradient(bottom, rgb(15,189,47) 43%, rgb(0,41,0) 72%);
    background-image: -o-linear-gradient(bottom, rgb(15,189,47) 43%, rgb(0,41,0) 72%);
    background-image: -moz-linear-gradient(bottom, rgb(15,189,47) 43%, rgb(0,41,0) 72%);
    background-image: -webkit-linear-gradient(bottom, rgb(15,189,47) 43%, rgb(0,41,0) 72%);
    background-image: -ms-linear-gradient(bottom, rgb(15,189,47) 43%, rgb(0,41,0) 72%);

    background-image: -webkit-gradient(
        linear,
        left bottom,
        left top,
        color-stop(0.43, rgb(15,189,47)),
        color-stop(0.72, rgb(26,26,26))
    );
       -moz-box-shadow: 0px 0px 10px #00CC33;
       -webkit-box-shadow: 0px 0px 10px #00CC33;
       box-shadow: 0px 0px 10px #00CC33;
    }

     

    The rule works only if I have been logged in while the other rules work fine! Where should I investigate? Or where/how can I fix that the rule is only being called if the user is logged in?

  • Where's it: elgg_extend_view('css/elgg','customize_css/css', $priority); ?

    What's a file? And what's a code of it?

     

  • I'm using "customize css" plugin that simply creates an empty css file in mod/customize_css/css folder that extends the view of views/default/css/elgg.php

    Here's the code

    <?php
    /**
     * Customize CSS
     * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
     * @author Matt Beckett
     * @copyright Matt Beckett 2012
     *
     * This plugin does nothing by itself.  It is simply meant as a starter plugin for those unfamiliar with
     * Elgg that need to make small adjustments to the css.
     * It provides the correct method of extending the css view, changing the core files is highly discouraged
     */

    // the init function contains all of our code that we want the Elgg system to do during system initialization
    function customize_css_init() {
     
        // Set the priority of the css - this tells Elgg when to include your rules
        // The higher the number, the later in the sequence your css is included
        // order for plugins with the same priority is determined by their order on the plugin page
        // plugins are loaded top-to-bottom
        // so if you want to force your css to be the last thing included (to override everything else)
        // you should set the priority to 1000 and move this plugin to the very bottom of the list
        $priority = 1000;

        // Extend system CSS with our own styles
        // this function is extending the view called "css/elgg" with our own custom view
        // called "customize_css/css"
        // this means that Elgg's css can remain unchanged, and our css will be included afterward
        // so any changes we want to make will overwrite the default styles
        elgg_extend_view('css/elgg','customize_css/css', $priority);

        // the view name indicates where the file can be found
        // our customize_css/css view will be found in our plugin at
        // views/default/customize_css/css.php
        // it is in this file you can safely make changes
    }

    // registering the event handler tells Elgg to execute a specific function at a specific time
    // in this case it will execute the function customize_css_init()
    // and it will do so during the initialization of the system
    elgg_register_event_handler('init','system','customize_css_init');
    ?>

  • 1 - Topbar doesn't display for NON logged users

    2 - For checking, add this code:

    .elgg-page-header {
        position: relative;
        background: #333 url(<!--?php echo elgg_get_site_url(); ?-->_graphics/header_shadow.png) repeat-x bottom left;
    }

    in

    views/default/customize_css/css.php

    then run Flush cache\Upgrade via Administration->Dashboard

    and finally check it as logged in\logged out user

  • AARGH, so after tweaking the css for days everything will still look like unreadable shit for non-logged-in users!

  • maybe screenshots/links would help us to see what you're seeing?

    I somehow doubt that the presence/absence of the topbar suddenly makes everything unreadable.

  • First, and I know it is hard when you don't know where to look, but take a deep breath.

    look at your site using Google Chrome or FireFox and use their Inspect Element feature. Using this tool you can see which css is being called. 

    I like Google Chrome myself FireFox seems very complicated from a beginner's point of view. Once you learn Google Chrome then FireFox will make more sense to you.

  • Well, I might have been a little dramatic and I already managed to fix the topbar and a few other misbehavings but I'm really stuck on how to fix this: image

    The 'remember me' radio button is near unreadable so as the 'register' and 'lost passwors' buttons, which are also aligned strangely wrong?

    Also can't seem to change the black text color of the form field into something visible against the black BG

  • Yes, that is horrendous I'll give you that.  Are you familiar with css selectors and precedence?  If so it shouldn't be much of an issue if you inspect the markup.