Defining CSS specific Data
CSS specific data will execute on a specific file URL. To define CSS specific data, follow the steps below:
1. Create a CSS file
Create a CSS file to store CSS specific data.
/specific/intro.css
/* Your CSS Code for the specific file */
h1 {
color: blue;
}
2. Update the propose.json file
Define a specific CSS object where the key will be the specific file path of the HTML file, and the value will be an array of CSS files for this HTML file.
/propose.json
{
"css": {
"specific": {
"/articles/intro.html": ["/specific/intro.css"]
}
}
}
Note
- CSS specific data will execute only on a specific HTML file.
- You can execute multiple CSS files for one HTML file.
- CSS specific data will be removed from the webpage on state change.
How it works
CSS specific data will execute only on a specific URL. ProposeJS checks if the URL matches the proposed URL, then executes the CSS specific data. On state change, the CSS specific data will be removed from the webpage.