Skip to content

Discord Toolbar Adjustment by xiaopanpankevinpan

Details

Authorxiaopanpankevinpan

LicenseNo License

Categorydiscord

Created

Updated

Size6.9 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Minsize toolbar and hide some redundant button.

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name           Discord Toolbar Adjustment
@namespace      https://openuserjs.org/users/kevin_pan_940506
@author         XiaoPanPanKevinPan
@description    `
    Minsize toolbar and hide some redundant button.

    This userstyle is developed in Mozilla Firefox. Should errors occurred under Google Chrome or others, please tell me and I'll try my best.

`
@version        1.2.0
@preprocessor   uso

var     <type>      <name>          <label>                                         <default value>
@var    text        duration        "Transition Duration"                           0.25s
@var    text        delay           "Transition Delay (e.g. before close)"          0.75s
@var    select      sSel            "Servers - Toolbar - Minimize"                  {
    "Yes*": "",
    "No":   "*:not(*)"
}
@var    select      sIndi           "Servers - Show indicator after expanned"       {
    "Yes '<'": `"<"`,
    "Yes '︙'*": `"︙"`,
    "No": `""`
}

@var    select      sBtn1           "Servers - Widget 1 (Threads)"                  {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn2           "Servers - Widget 2 (Notification Settings)"    {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn3           "Servers - Widget 3 (Pinned)"                   {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn4           "Servers - Widget 4 (Member List)"              {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn5           "Servers - Widget 5 (Search)"                   {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn6           "Servers - Widget 6 (Inbox)"                    {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      sBtn7           "Servers - Widget 7 (Help)"                     {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
---
@var    select      hBtn1           "Home - Widget 1 (New Group DM)"                {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      hBtn2           "Home - Widget 2 (Inbox)"                       {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      hBtn3           "Home - Widget 3 (Help)"                        {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
---
@var    select      dSel            "DMs - Toolbar - Minimize"                      {
    "Yes*": "",
    "No":   "*:not(*)"
}
@var    select      dIndi           "DMs - Show indicator after expanned"           {
    "Yes": `"<"`,
    "Yes '︙'*": `"︙"`,
    "No": `""`
}

@var    select      dBtn1           "DMs - Widget 1 (Voice Call)"                   {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn2           "DMs - Widget 2 (Video Call)"                   {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn3           "DMs - Widget 3 (Pinned)"                       {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn4           "DMs - Widget 4 (Add Friends to DM)"            {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn5           "DMs - Widget 5 (Search)"                       {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn6           "DMs - Widget 6 (Inbox)"                        {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
@var    select      dBtn7           "DMs - Widget 7 (Help)"                         {
    "Unchanged*":   "*:not(*)",
    "Hidden":       ""
}
==/UserStyle== */


@-moz-document domain("discord.com"){
    
}

@-moz-document regexp("https?://(ptb\\.|canary\\.)?discord.com/channels/[0-9]+.*"){
    /* :not([class*="video-"] *) is used to avoid video channel*/
    
    /*Minimize Toolbar*/ 
    /*[[sSel]]*/ [class^="toolbar-"]:not([class*="video-"] *){
        height: 100%;
    }
    /*[[sSel]]*/ [class^="toolbar-"]:not(:hover):not(:focus-within):not([class*="video-"] *){
        transition: max-width /*[[duration]]*/ /*[[delay]]*/;
        max-width: 40px;
    }
    /*[[sSel]]*/ [class^="toolbar-"]:hover:not([class*="video-"] *),
    /*[[sSel]]*/ [class^="toolbar-"]:focus-within:not([class*="video-"] *){
        transition: max-width /*[[duration]]*/;
        max-width: 100vw;
    }

    /*Menu Identifier*/
    /*[[sSel]]*/ [class^="toolbar-"]:not([class*="video-"] *)::before{
        content: "︙";
        font-size: 24px;
        margin: 0 8px;
    }
    /*[[sSel]]*/ [class^="toolbar-"]:hover:not([class*="video-"] *)::before,
    /*[[sSel]]*/ [class^="toolbar-"]:focus-within:not([class*="video-"] *)::before{
        content: /*[[sIndi]]*/;
        font-size: 24px;
        margin: 0 8px;
    }
    
    /*[[sBtn1]]*/  [class^="toolbar-"] > *:nth-child(1), 
    /*[[sBtn2]]*/  [class^="toolbar-"] > *:nth-child(2), 
    /*[[sBtn3]]*/  [class^="toolbar-"] > *:nth-child(3), 
    /*[[sBtn4]]*/  [class^="toolbar-"] > *:nth-child(4), 
    /*[[sBtn5]]*/  [class^="toolbar-"] > *:nth-child(5), 
    /*[[sBtn6]]*/  [class^="toolbar-"] > *:nth-child(6), 
    /*[[sBtn7]]*/  [class^="toolbar-"] > *:nth-child(7) {
        display: none;
    }
}
@-moz-document regexp("https?://(ptb\\.|canary.)?discord.com/channels/@me/?"){
    
    /*[[hBtn1]]*/  [class^="toolbar-"] > *:nth-child(1), 
    /*[[hBtn2]]*/  [class^="toolbar-"] > *:nth-child(2), 
    /*[[hBtn3]]*/  [class^="toolbar-"] > *:nth-child(3){
        display: none;
    }
}

@-moz-document regexp("https?://(ptb\\.|canary.)?discord.com/channels/@me/[0-9]+.*"){

    /*Minimize Toolbar*/
    /*[[dSel]]*/ [class^="toolbar-"]{
        height: 100%;
    }
    /*[[dSel]]*/ [class^="toolbar-"]:not(:hover):not(:focus-within){
        transition: max-width /*[[duration]]*/ /*[[delay]]*/;
        max-width: 40px;
    }
    /*[[dSel]]*/ [class^="toolbar-"]:hover,
    /*[[dSel]]*/ [class^="toolbar-"]:focus-within{
        transition: max-width /*[[duration]]*/;
        max-width: 100vw;
    }

    /*Menu Identifier*/
    /*[[dSel]]*/ [class^="toolbar-"]::before{
        content: "︙";
        font-size: 24px;
        margin: 0 8px;
    }
    /*[[dSel]]*/ [class^="toolbar-"]:hover::before,
    /*[[dSel]]*/ [class^="toolbar-"]:focus-within::before{
        content: /*[[dIndi]]*/;
        font-size: 24px;
        margin: 0 8px;
    }
    
    /*[[dBtn1]]*/  [class^="toolbar-"] > *:nth-child(1), 
    /*[[dBtn2]]*/  [class^="toolbar-"] > *:nth-child(2), 
    /*[[dBtn3]]*/  [class^="toolbar-"] > *:nth-child(3), 
    /*[[dBtn4]]*/  [class^="toolbar-"] > *:nth-child(4), 
    /*[[dBtn5]]*/  [class^="toolbar-"] > *:nth-child(5), 
    /*[[dBtn6]]*/  [class^="toolbar-"] > *:nth-child(6), 
    /*[[dBtn7]]*/  [class^="toolbar-"] > *:nth-child(7) {
        display: none;
    }
}

Reviews

No reviews yet.