Web components and polymer solve this problem "completly" by full encapsulation.
With some css preprocessing + vulcanizing you can even use separate js/css files from your component templates if that is your thing - they can get inlined in the build process.