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
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