Odd/specific SCSS/SASS question Working on a client website, I often use similar...

@lukeharby@infosec.exchange

Odd/specific SCSS/SASS question

Working on a client website, I often use similar scaffolding for my projects, especially with SASS.

I had a variable defined as $red with a hex value.

When I passed this to a component file, it was iterating up the parent directories and then down into a specific directory where the same variable name was in use.

Not sure I understand the scoping here.

I have since updated all my variable names in the local repo to be a bit more BEM-ish.

Anyone know how/why this happens?

My client repo is several subfolders deep from the one being called in the file, but its not a direct child/grand child.

I hope this makes sense, assuming it is to do with name spacing.

First image shows the iteration up the tree to the incorrect folder, second one shows the updated filename which is referencing the local variable correctly.

#FrontEnd #FrontEndDevelopment #SCSS #CSS #SASS #Scoping #Variables