• Community
    • Community
    • Vivaldi Social
    • Blogs
  • Forum
    • Vivaldi Forum
    • Categories
    • Recent
    • Popular
  • Themes
    • Vivaldi Themes
    • My Themes
    • FAQ
  • Contribute
    • Contribute
    • Volunteer
    • Donate
  • Browser
    • Vivaldi Browser
    • Latest News
    • Snapshots
    • Help
Register Login

Vivaldi

  • Community
  • Themes
  • Contribute
  • Browser

Navigation

    • Home
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Desktop
    3. Customizations & Extensions
    4. Modifications
    5. Tab Color per Workspace

    Tab Color per Workspace

    Scheduled Pinned Locked Moved Modifications
    21 Posts 8 Posters 2.5k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MasterLeo29
      M
      MasterLeo29 Ambassador
      last edited by MasterLeo29

      Greetings,

      This is a quick, simple css mod for a simple idea : Change tab color for a specific workspace

      Here's the css code:

      div#browser:has(div.tabbar-workspace-button button[title="Workspace Name Here"]) {
          --colorTabBar: magenta !important;
      }
      

      Just switch the color and the button title to fit your needs.

      Edit:
      Also had the idea to make a JS mod to swap themes according to the workspace, but that idea is still "cooking" ๐Ÿ™‚

      oudstand
      O
      1 Reply Last reply
      Reply Quote 8
    • RadekPilich
      R
      RadekPilich
      last edited by

      I would like to do a different text / background color for workspaces in the workspace chooser drop down list,, it's hard to navigate visually having more than 10 workspaces. Do you by any chance know how?

      Win 11 with latest Vivaldi snapshot, OnePlus 9 Pro Android 14 with latest regular Vivaldi update.

      barbudo2005
      B
      2 Replies Last reply
      Reply Quote 0
    • barbudo2005
      B
      barbudo2005 @RadekPilich
      last edited by barbudo2005

      @RadekPilich

      Use this code:

      button.workspace-item-wrapper.draggable[title*="VARIOS"] .avatar.picker  svg
      
      {filter: brightness(50%) sepia(100) saturate(60) hue-rotate(200deg) !important;}
      
      button.workspace-item-wrapper.draggable[title*="VARIOS"]  .title p
      
      {color: #0a57a7 !important;}
      
      
      
      button.workspace-item-wrapper.draggable[title*="HISTORICA"] .avatar.picker  svg
      
      {filter: brightness(50%) sepia(100) saturate(60) hue-rotate(100deg) !important;}
      
      button.workspace-item-wrapper.draggable[title*="HISTORICA"] .title p
      
      {color: #008b00 !important;}
      
      
      button.workspace-item-wrapper.draggable[title*="SERIES, IMDB & YT"] .avatar.picker  svg
      
      {filter: brightness(50%) sepia(100) saturate(60) hue-rotate(360deg) !important;}
      
      button.workspace-item-wrapper.draggable[title*="SERIES, IMDB & YT"]  .title p
      
      {color: #e72f04 !important;}
      
      

      8793349b-5184-4999-b0ca-db0952752cd7-image.png

      thelinuxtube
      T
      1 Reply Last reply
      Reply Quote 4
    • barbudo2005
      B
      barbudo2005 @RadekPilich
      last edited by barbudo2005

      @RadekPilich

      Better code for you:

      button.workspace-item-wrapper.draggable[title="VARIOS"] .avatar.picker  svg
      
      {filter: brightness(50%) sepia(100) saturate(60) hue-rotate(200deg) !important;}
      
      button.workspace-item-wrapper.draggable[title="VARIOS"]  .title p
      
      {color: blue !important; 
      font-weight: 700 !important;}
      
      button.workspace-item-wrapper.draggable[title="VARIOS"]
      
      {background: white !important;}
      

      da30f929-cf52-4c76-838b-0863b079a2f0-image.png

      To get a specific color for the svg assume that the red instead of being 360ยฐ is 0ยฐ (is the same) and follows this pattern:

      d981cfec-8365-4f3c-82f9-d4f6c1b69859-image.png

      1 Reply Last reply Reply Quote 4
    • RadekPilich
      R
      RadekPilich
      last edited by

      @barbudo2005 awesome, appreciated, thanks a lot!

      Win 11 with latest Vivaldi snapshot, OnePlus 9 Pro Android 14 with latest regular Vivaldi update.

      barbudo2005
      B
      1 Reply Last reply
      Reply Quote 2
    • barbudo2005
      B
      barbudo2005 @RadekPilich
      last edited by

      @RadekPilich

      You will have to ask your children or grandchildren to lend you this tool. ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜

      6ded29fd-b277-4531-8281-f803926e15e0-image.png

      1 Reply Last reply Reply Quote 1
    • oudstand
      O
      oudstand Supporters @MasterLeo29
      last edited by

      @MasterLeo29 said in Tab Color per Workspace:

      Also had the idea to make a JS mod to swap themes according to the workspace, but that idea is still "cooking" ๐Ÿ™‚

      Do you know how to detect if a workspace is changed in JS code?

      MasterLeo29
      M
      nomadic
      N
      2 Replies Last reply
      Reply Quote 0
    • MasterLeo29
      M
      MasterLeo29 Ambassador @oudstand
      last edited by

      @oudstand I've come back to this idea a few days ago and im still figuring that piece. I checked the modders api (from lomn if I'm not mistaken) and haven't found a simple "on workspace change".
      My current idea is to just use the regular "on tab updated" + a query selector to check the current selected workspace + some local variable to keep track of changes and go from there (but I haven't put that many hours into this mod in particular lately)

      1 Reply Last reply Reply Quote 0
    • nomadic
      N
      nomadic Soprano @oudstand
      last edited by nomadic

      @oudstand @MasterLeo29 You could always use a mutation observer to monitor the workspace button's title.

      Here is an example that prints the current workspace's title to the devTools console:

      (function () {
        function workspaceChangeDetector() {
          const workspaceButton = document.querySelector(".button-toolbar.workspace-popup > button");
      
          // mutation Observer for workspace Changes
          const workspaceButtonObserver = new MutationObserver(function (mutations) {
            mutations.forEach(function (mutation) {
              const workspaceTitle = mutation.target.title;
              console.log(workspaceTitle);
            });
          });
      
          workspaceButtonObserver.observe(workspaceButton, { attributes: true, attributeFilter: ["title"] });
        }
      
        // Loop waiting for the browser to load the UI
        const intervalID = setInterval(function () {
          const browser = document.getElementById("browser");
          if (browser) {
            clearInterval(intervalID);
            workspaceChangeDetector();
          }
        }, 300);
      })();
      
      MasterLeo29
      M
      oudstand
      O
      2 Replies Last reply
      Reply Quote 1
    • MasterLeo29
      M
      MasterLeo29 Ambassador @nomadic
      last edited by MasterLeo29

      @nomadic oh, I like your approach. Been a while since I used mutation observers (and, since I only code JS every now and then, I forgot xD).

      Thanks for the idea ๐Ÿ™‚

      Edit : small note on the code above, it only "works" if you have the workspace names showing. so, if anyone else uses it as a base, take that in consideration

      1 Reply Last reply Reply Quote 2
    • oudstand
      O
      oudstand Supporters @nomadic
      last edited by

      @nomadic Good idea. My problem is, that I don't show the default workspace switcher, because I've created separate buttons.

      @MasterLeo29

      "on tab updated" + a query selector to check the current selected workspace

      What query selector do you use to get the current workspace? Currently I fail to get the selected workspace ๐Ÿ˜…

      MasterLeo29
      M
      2 Replies Last reply
      Reply Quote 0
    • MasterLeo29
      M
      MasterLeo29 Ambassador @oudstand
      last edited by

      @oudstand The selector I was thinking about would also "require" having the switcher (either full version or icon only) visible.
      I still haven't found a good way to do it without any kind of 'visual anchor', so to say

      1 Reply Last reply Reply Quote 0
    • MasterLeo29
      M
      MasterLeo29 Ambassador @oudstand
      last edited by

      @oudstand I was thinking ... Since you've created separate buttons, you could get away with chain commands for your scenario, I think.
      I've done a similar thing (in fact, I'm sure I read the idead on a vivaldi blog post about this) where you map every scenario on chain commands

      oudstand
      O
      1 Reply Last reply
      Reply Quote 0
    • oudstand
      O
      oudstand Supporters @MasterLeo29
      last edited by

      @MasterLeo29 Yeah I also read about it in a Vivaldi blog post XD
      Sad that there isn't a possibility at the moment to check this without having a HTML element to reference (or we just didn't found it). Of course it would be possible to show the workspace switcher but hide it with CSS then we could query it.

      1 Reply Last reply Reply Quote 1
    • RadekPilich
      R
      RadekPilich
      last edited by RadekPilich

      Is it possible in CSS to somehow substitute for example title="ABC 001" with something similar to SQL title like '%ABC%', so that I don't have to do explicit definition for each workspace, but instead use some grouping code in the workspace naming scheme, to colorize workspaces according to the group they belong to?

      Win 11 with latest Vivaldi snapshot, OnePlus 9 Pro Android 14 with latest regular Vivaldi update.

      nomadic
      N
      1 Reply Last reply
      Reply Quote 0
    • nomadic
      N
      nomadic Soprano @RadekPilich
      last edited by

      @RadekPilich Yep, by including different symbols in front of the the equals sign, you can set different matching rules.

      https://www.w3schools.com/css/css_attribute_selectors.asp

      ^= for "starts with" or $= for "ends with" might be the best to avoid accidental matches, but if you aren't worried about that, then *= for "contained anywhere within" would work. You could also use ~= for an exact word match.

      1 Reply Last reply Reply Quote 2
    • thelinuxtube
      T
      thelinuxtube @barbudo2005
      last edited by

      @barbudo2005 where is this added to.. ive tried googling it, but find nothing on this.. could you please explain.. im stupid-ish to coding... thank you so much in advanced

      Zalex108
      Z
      barbudo2005
      B
      2 Replies Last reply
      Reply Quote 0
    • Zalex108
      Z
      Zalex108 Moderator @thelinuxtube
      last edited by Zalex108

      @thelinuxtube said in Tab Color per Workspace:

      @barbudo2005 where is this added to.. ive tried googling it, but find nothing on this.. could you please explain..

      Hi,

      Large explanation
      https://forum.vivaldi.net/topic/10549/modding-vivaldi

      Short Explanation
      ๐ŸŽฅ...
      Click above Up Arrow 16px.gif

      --
      Avoid https://vivaldi.com Data loss
      Follow the Backup | Reset links below


      Vivaldi Backup | Reset + Extra Steps

      "You cannot know the meaning of your life until you are connected to the power that created you" ยท Shri Mataji Nirmala Devi

      1 Reply Last reply Reply Quote 0
    • barbudo2005
      B
      barbudo2005 @thelinuxtube
      last edited by

      @thelinuxtube

      Look this post:

      https://forum.vivaldi.net/topic/80446/about-vivaldi-s-most-profound-philosophy/14

      1 Reply Last reply Reply Quote 0
    • RadekPilich
      R
      RadekPilich
      last edited by

      Has anyone figure out how to hide the workspace avatar button?

      I don't want it there, as I place it into the name of the workspace, so it is visible in the context menus as well.

      image.png

      This doesn't work (yes, I don't know what am I doing)

      image.png

      Win 11 with latest Vivaldi snapshot, OnePlus 9 Pro Android 14 with latest regular Vivaldi update.

      Hadden89
      H
      1 Reply Last reply
      Reply Quote 0
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    • 1
    • 2
    • 1 / 2
    • First post
      Last post

    Copyright © Vivaldi Technologies™ โ€” All rights reserved. Privacy Policy | Code of conduct | Terms of use | Vivaldi Status