iamvdo / Reveal-liveCoding

Live coding in Reveal.js
17 stars 6 forks source link

LiveCoding pastes ID before/after every curly bracket #2

Open korbinianfritsch opened 8 years ago

korbinianfritsch commented 8 years ago

Look at the code, I write plain CSS in the code-Tag that is assigned to data-livecoding-id "#buttonLive". The ID is then injected not only before selectors, but also within animation keyframes and after closing tag of ".button".

Am I doing anything wrong or is this a bug? Thanks in advance.

201509272_200920-capturfiles
jesperorb commented 6 years ago

@korbinianfritsch Not sure how helpful this is after more than 2 years after the issue was opened. The code doesn't detect that the nested brackets inside of the @keyframes isn't a selector but a value. My solution for my case is just naively checking if the selector is a class or id on this line: https://github.com/iamvdo/Reveal-liveCoding/blob/master/live-coding.js#L54 because that fits my use case:

if(selectors[j].substr(0,1) === "." || selectors[j].substr(0,1) === "#"){
    selectors[j] = '#' + demoElementId + ' ' + selectors[j];    
}