Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[ HELPERS ] Solução para calcular o PX e REM

  1. Pessoal acebei de desenvolver um atalho pra somar os REM e PX rapido e Facilmente!!!
  2. Youtube sobre REM e PX: https://www.youtube.com/watch?v=UXu450EK4_w
  3. Download da Função no GitHub pro VSCODE 'ATALHOS : https://github.com/lipeomiguel/AluraTools
  • ATALHOS VS CODE SNIPPETS [ JSON ]
{
    "HELPERDOCCSSREM": {
        "prefix": "HELPERDOCCSSREM",
        "body": [
            "function HELPERDOCCSSREM(calc_px_for_rem,config_rem=0.06){",
            "	/** ",
            "		 * ! ESSA FUNÇÃO DE HELPER PARA CALCULAR A SOMA DOS [ REM PX ];",
            "        * ! DOC DA FUNÇÃO NO GITHUB: https://github.com/lipeomiguel/AluraTools",
            "	*/",
            "			var calc_px_for_rem = calc_px_for_rem.replace(/[^0-9]+/g, '');",
            "			var result = calc_px_for_rem * config_rem;",
            "			console.log('o RESULTADO DO SEU CALCULO DE REM É: '+result+'rem');",
            "			return result+'rem';",
            "}",
            "HELPERDOCCSSREM('$1');",
        ],
        "description": "THIS HELPER FUNCTION TO CALCULATE THE SUM OF [ REM <|> PX ]"
    }
}
  • CÓDIGO SOURCE JAVASCRIPT
function HELPERDOCCSSREM(calc_px_for_rem,config_rem=0.06){
  /** 
     * ! ESSA FUNÇÃO DE HELPER PARA CALCULAR A SOMA DOS [ REM PX ];
     * ! DOC DA FUNÇÃO NO GITHUB: https://github.com/lipeomiguel/AluraTools
  */
      var calc_px_for_rem = calc_px_for_rem.replace(/[^0-9]+/g, '');
      var result = calc_px_for_rem * config_rem;
      console.log('o RESULTADO DO SEU CALCULO DE REM É: '+result+'rem');
      return result+'rem';
}
HELPERDOCCSSREM('$1');
1 resposta
solução!

Olá Felipe, tudo bem?

Você desenvolveu uma ferramenta muito útil para converter pixels em REM rapidamente! A função HELPERDOCCSSREM que você compartilhou tá bem estruturada e prática para quem precisa fazer essas conversões frequentemente no desenvolvimento web.

Obrigada por compartilhar!

Um abraço e bons estudos.