¿Hay alguna manera de hacer este código css con javascript langage o jquery y obtener el mismo resultado? No encuentro ninguna muestra para esto.
#readonlyEmail_label:lang(fr)::before{ content: 'Adresse courriel vérifiée. Vous pouvez continuer.'; font-family: 'Open Sans', sans-serif; font-weight: bold; font-size: 14px; width:650px; padding-bottom: 24px; display: block; } #readonlyEmail_label:lang(en)::before{ content: 'Email address verified. You can now continue.'; font-family: 'Open Sans', sans-serif; font-weight: bold; font-size: 14px; width:650px; padding-bottom: 24px; display: block; }Gracias
Esto se puede hacer editando la hoja de estilo del documento desde JavaScript, así:
const lang = { fr: { text: `content: 'Adresse courriel vérifiée. Vous pouvez continuer.'`, color: `color: #F00` }, en: { text: `content: 'Email address verified. You can now continue.'`, color: `color: #0F0` } }; const css = document.styleSheets[0]; css.addRule('.readonlyEmail_label:lang(fr)::before', lang.fr.text); css.addRule('.readonlyEmail_label:lang(fr)::before', lang.fr.color); css.addRule('.readonlyEmail_label:lang(en)::before', lang.en.text); css.addRule('.readonlyEmail_label:lang(en)::before', lang.en.color); .readonlyEmail_label:lang(fr)::before {} .readonlyEmail_label:lang(en)::before {} <div class="readonlyEmail_label" lang="en"><q>This English quote has a <q>nested</q> quote inside.</q></div> <div class="readonlyEmail_label" lang="fr"><q>This French quote has a <q>nested</q> quote inside.</q></div>