Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add styling of unloaded (inactive) tabs #258

Closed
ReporterX opened this issue Oct 28, 2021 · 8 comments
Closed

Add styling of unloaded (inactive) tabs #258

ReporterX opened this issue Oct 28, 2021 · 8 comments
Labels
Component::Tabbar Tab or tabbar Issue::Enhancement New feature or request

Comments

@ReporterX
Copy link

ReporterX commented Oct 28, 2021

Is your feature request related to a problem?
Yes, currently we can't recognize which tabs are unloaded (inactive) when using your CSS styling.

The solution I'd like
Add styling on the following:
Unloaded tabs
When hovering on unloaded tabs

@ReporterX ReporterX added the Issue::Enhancement New feature or request label Oct 28, 2021
@ReporterX ReporterX changed the title Add styling of unloaded tabs Add styling of unloaded (inactive) tabs Oct 28, 2021
@black7375 black7375 added the Component::Tabbar Tab or tabbar label Oct 29, 2021
@black7375
Copy link
Owner

black7375 commented Oct 29, 2021

Is there a proper way to display it?
And is there a way to create an unloaded tab?

@ReporterX
Copy link
Author

It happens when you restore a session. Let's say you restore a session with 10 tabs in a window. Firefox won't load all tabs at once. Only the selected tab will be loaded (active). The rest are unloaded (inactive).

There are some addons which manage tab (un)loading. A tab will be unloaded if it is not selected and idle for some time, so as to release some memory.

Here are the CSS for loaded and unloaded tabs:

@media (-moz-proton)  {

    /* Loaded tabs */
    #tabbrowser-tabs .tabbrowser-tab:not([pending]) {

    }
    /* When hovering on loaded tabs */	
    #tabbrowser-tabs .tabbrowser-tab:not([pending]):hover {

    }
	
    /* Unloaded tabs */
    #tabbrowser-tabs .tabbrowser-tab[pending] {

    }
    /* When hovering on unloaded tabs */
    #tabbrowser-tabs .tabbrowser-tab[pending]:hover {

    }
  }	

@black7375
Copy link
Owner

black7375 commented Nov 1, 2021

Which one is better?

Solution 1 - Circle content

image

#tabbrowser-tabs .tabbrowser-tab[pending] .tab-text.tab-label::before {
  content: '•';
}

Solution 2 - Itelic label

image

#tabbrowser-tabs .tabbrowser-tab[pending] .tab-text.tab-label {
  font-style: italic;
}

Solution 3 - zzz with Itelic label

image

#tabbrowser-tabs .tabbrowser-tab[pending] .tab-text.tab-label::before {
  content: '💤 ';
}
#tabbrowser-tabs .tabbrowser-tab[pending] .tab-text.tab-label {
  font-style: italic;
}

@Nomes77
Copy link
Contributor

Nomes77 commented Nov 1, 2021

Solution 2 is better

@black7375 black7375 mentioned this issue Nov 2, 2021
31 tasks
black7375 added a commit that referenced this issue Nov 2, 2021
@black7375
Copy link
Owner

Solution 2 applied to the dev branch.

@Nomes77
Copy link
Contributor

Nomes77 commented Nov 2, 2021

I propose a forth solution:

  #tabbrowser-tabs .tabbrowser-tab[pending] .tab-content {
    opacity: 0.7;
  }

afbeelding

@black7375
Copy link
Owner

LGTM
It looks consistent

@ReporterX
Copy link
Author

ReporterX commented Nov 4, 2021

I propose a comprehensive solution for both light and dark themes. I use "grey-out" effect to represent unloaded (inactive) tabs.

@media (-moz-proton)  {

    /* =====================================================
       Light theme
       ===================================================== */

    /* Loaded tabs */
    :root[lwtheme-mozlightdark]:not([lwthemetextcolor="bright"]) #tabbrowser-tabs .tabbrowser-tab:not([pending]) {
      opacity: 0.9 !important;
      color: black !important;
      background-color: rgb(230, 230, 230) !important;
    }
    /* When hovering on loaded tabs */
    /* :root[lwtheme-mozlightdark]:not([lwthemetextcolor="bright"]) #tabbrowser-tabs .tabbrowser-tab:not([pending]):hover {
    } */
  
    /* Pending (unloaded) tabs */
    :root[lwtheme-mozlightdark]:not([lwthemetextcolor="bright"]) #tabbrowser-tabs .tabbrowser-tab[pending] {
      opacity: 0.6 !important;
      color: rgb(60, 60, 60) !important;
      background-color: rgb(180, 180, 180) !important;
    }
    /* When hovering on pending (unloaded) tabs */
    :root[lwtheme-mozlightdark]:not([lwthemetextcolor="bright"]) #tabbrowser-tabs .tabbrowser-tab[pending]:hover {
      opacity: 0.9 !important;
      color: black !important;
      background-color: rgb(210, 210, 210) !important;
    }

    /* =====================================================
       Dark theme
       ===================================================== */

    /* Loaded tabs */
    /* :root[lwtheme-mozlightdark][lwthemetextcolor="bright"] #tabbrowser-tabs .tabbrowser-tab:not([pending]) {
    } */
    /* When hovering on loaded tabs */
    :root[lwtheme-mozlightdark][lwthemetextcolor="bright"] #tabbrowser-tabs .tabbrowser-tab:not([pending]):hover {
      background-color: rgb(90, 90, 90) !important;  
    }
    :root[lwtheme-mozlightdark][lwthemetextcolor="bright"] #tabbrowser-tabs .tabbrowser-tab:not([pending]):hover .tab-background {
      background: rgb(90, 90, 90) !important;        
    }
      
    /* Pending (unloaded) tabs */
    :root[lwtheme-mozlightdark][lwthemetextcolor="bright"] #tabbrowser-tabs .tabbrowser-tab[pending] {
      opacity: 0.6 !important;
      color: rgb(210, 210, 210) !important;
    }
    /* When hovering on pending (unloaded) tabs */
    :root[lwtheme-mozlightdark][lwthemetextcolor="bright"] #tabbrowser-tabs .tabbrowser-tab[pending]:hover {
      opacity: 0.75 !important;
      color: rgb(230, 230, 230) !important;
      background-color: rgb(90, 90, 90) !important; 
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component::Tabbar Tab or tabbar Issue::Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants