Check out example codes for "css set property with data attribute". It will help you in understanding the concepts better.

Code Example 1

div::after {
  content: attr(data-whatever);
}

Learn ReactJs, React Native from akashmittal.com