pandell / Spagety

Other
0 stars 0 forks source link

Better CSS identification creator #8

Open cjasinsk opened 10 years ago

cjasinsk commented 10 years ago

Currently a simple/demo-purposes (not-highly effective) strategy is used for creating a unique identifier for scoping css files to a module.

A better unique identifying strategy is required to ensure the css scoping will work properly

101100 commented 10 years ago

Knockout simply uses a global counter that increments for each unique item. These numbers would then need to be saved with the page somehow.

cjasinsk commented 10 years ago

@101100 That could work. A global dictionary would be best. The reason being if 2 different modules reference the same css file, then there is no point in adding it twice to the head.

So having a global dictionary, with an incremental counter to create the id, along with the css file path could work.

Currently I am storing the identifier on the <style id="identifier">.