Search code examples
cssfirefoxtree-style-tabs

how to improve Firefox' Tree Style Tabs' CSS for multiline tabs?


Jusy as the title says: how to improve Firefox' Tree Style Tabs' CSS for multiline tabs?

The relevant part of the custom CSS that TST allows you to specify is:

/*multi line tabs*/
tab-item {
  max-height: 4em !important;
  overflow: hidden !important;
  text-align:top;
}
tab-item tab-label {
  overflow-y: hidden !important;
  text-align:top;
  white-space: wrap !important;
  display: inline !important;
  padding-top: 10px;
  padding-bottom: 10px;  
}

Their suggested CSS as can be seen here does seem to be enough.

The most I've achieved with the aforementioned CSS looks like thisl I would like to limit the text to 3 lines and keep readability: enter image description here


Solution

  • What about -webkit-line-clamp?

    /*multi line tabs*/
    tab-item {
      max-height: 4em !important;
      overflow: hidden !important;
      text-align:top;
    }
    tab-item tab-label {
      overflow-y: hidden !important;
      text-align:top;
      white-space: wrap !important;
      display: -webkit-inline-box !important;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      padding-top: 10px;
      padding-bottom: 10px;  
    }
    

    demo of line clamping on tree style tabs