Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

235
Vistas
How to create css class in imported css file with vanilla javascript

i want to figure out how to add new class to css file, when i've got that file imported into javascript:

import "./styles.css"

//add class to that file

I don't want to insert new file to 'link' tag, only to modify that imported file

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You will need to create the CSS class in styles.css and then using javascript add that class to the HTML element. You can also add new data attributes using javascript as shown in the image below, like this:

yourElement.dataset.myDatasetName = 'datasetValue';

Read all about how to use data-* attributes here: https://javascript.plainenglish.io/quick-guide-to-using-data-attributes-f1f2c3161d5f

Adding new dataset attribute

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda