diff --git a/src/renderTopLanguages.js b/src/renderTopLanguages.js index a233a094..25987a2f 100644 --- a/src/renderTopLanguages.js +++ b/src/renderTopLanguages.js @@ -41,10 +41,12 @@ const renderTopLanguages = (topLangs, options = {}) => { }, 0); // hide langs - langs = langs.filter((lang) => { - if (!hide_langs_below) return true; - return (lang.size / totalSize) * 100 > hide_langs_below; - }); + langs = langs + .sort((a, b) => b.size - a.size) + .filter((lang) => { + if (!hide_langs_below) return true; + return (lang.size / totalSize) * 100 > hide_langs_below; + }); // returns theme based colors with proper overrides and defaults const { titleColor, textColor, bgColor } = getCardColors({