Exploring a scenario where I have a string containing CSS selectors, similar to the format below:
.u-br {
blah blah
}
.u-tr {
blah .blah
}
....
.u-mr { }
The task at hand is to validate the selectors (specifically the .u-tr
part) to ensure there are no collisions or duplicates.
This process can be initiated as follows:
let selectorArray = process(stringOfCSS);
Upon completion of this step, the selector array should include:
['u-br', 'u-mr', etc]
Subsequently, it becomes crucial to verify that all entries within the array are unique, which can be achieved with existing methods.