How to place custom background on tab bar?



  • I'm trying to place an image on tab bar.
    This code works, but obviously is shown in tabs too.
    Wondering how to exclude showing the background when there is a tab there - activated or not.

    .tab-strip  { /*or should be used #tabs-container?*/
        background-image: url(/hooks/vlogover.png);
        background-size: 100%; 
    } 
    


  • I used code for this once, right in the beginning, can't find it thought atm. But yeah, try tabs-container, tab strip can't be right.



  • Works with container
    0_1498408343148_Screenshot 2017-06-25 18.31.42.png



  • @luetage Switched to #tabs-container.
    Actually, #tabs-container, .tab-strip or both #tabs-container .tab-strip produce the same.

    Well, I've to do some code cleanup :D



  • .tab-header {
        background-image:linear-gradient(hsla(0,0%,100%,.4),hsla(0,0%,100%,.2));
    } 
    
    #tabs-container {
        background-image: url(/hooks/vlogover.png);
        background-size: 100%; 
    }
    

    Ok, this worked after changing theme once (ah, the silly things I never try)
    ;)

    Only have to reduce the gap between tabs (it's 1/2px) as the background is seen between them.



  • edit: ninjad :/
    Instead I say this: Try it with a transparent pattern, I used to do this and it looks quite nice if you get the right combination together.



  • @luetage Thanks :)
    Feel free to link me some reference to tweak background image - probably the only I know is no-repeat xD
    Vivaldi UI will make me buy a css manual one day XD
    Of course, transparent tabs should be off in themes or... you'll see the background :P



  • @Hadden89 https://www.w3schools.com/cssref/pr_background-repeat.asp

    This is a good resource for css in general.



  • @luetage I'm looking also here; for a css noob it explains a lot of each command style ^^

    Ehm, what is and how to a transparent pattern?

    Other little experiment-variant on code above with simple svg texture - I like using them as are small in size and are rendered fast - for tab bar but following themes.

    .acc-light #tabs-container,
    .theme-light.color-behind-tabs-off #tabs-container {
        background-image: url(/hooks/graph-light.svg);
        background-size: 150%; /* as the squares in pattern were too small */
    }
    .acc-dark #tabs-container,
    .theme-dark #tabs-container {
        background-image: url(/hooks/graph-dark.svg);
        background-size: 150%;
    }
    


  • Try this:

    #tabs-container {
    	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABZCAMAAAD7LaEoAAAAGXRFWHRTb2Z0d2FyZQBBZG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NkLXwdzS9DqOqSpd4YhfefA49l9YPMJvWKspjvhzDYWmaWHAds3Q8Ak2hehoGBwYThvCOpbN4K7/MYlqOgVia3tYRIbauDCfX+/wrv/wkwAErXCouVGjItAAAAAElFTkSuQmCC) !important;
    }
    


  • @luetage
    Nice.
    There are substantial differences between encode images in base64 or hooking the image files directly?



  • @Hadden89 Images in text form load faster, and you don't have to place an additional file. But if you are using VivaldiHooks already, linking to images is probably more comfortable. I'm just trying to keep everything in a single css file, that's why ^^



  • @luetage
    It has sense.
    I use some .css instead - panel, tabs, controls, speed dial, toolbar - so probably I prefer the \hooks\img way to keep the files with less lines and characters and as I can easily put "experimental" codes.
    I have a lot of ugly /* comments */ and even some working-but-no-more-used-codes there :D

    Before I had one .css for every hook... but they were a nightmare to handle, so I merged them in sections lol


Log in to reply
 

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.