Closed zzcgulm closed 8 years ago
Hi Leigh,
After considering this briefly my initial reaction would be to opt for a module for each box type and all the contextual variants contained in there. So individual modules like: BoxWarning, BoxInfo, BoxDanger and BoxSuccess, each with its own CSS file (e.g. BoxWarning.css, BoxInfo.css, BoxDanger.css and BoxSuccess.css).
Then namespace the classes to their context. So the variants for the warning boxes would all live in the BoxWarning module/css files:
.sw-BoxWarning {
}
If it was a site wide warning box. Or:
.doc-BoxWarning {
}
If it was a warning box in a document.
But, ECSS is intentionally loose enough to let you organise things a different way if you would rather, or you find it is more suitable.
Thanks for the quick reply Ben, I have been implementing your comments. The results are:
Looks good to me 👍
It's working well. The only downside I can find is using a .sw namespace = a loss of one layer of hierarchy in class name, ie an inability to describe the relationship between classes with same depth, as there are only 2 layers to play with instead of 3:
Hi @zzcgulm are you happy you have all the info you need? If so, I'll close this one down. Otherwise, feel free to ask any further questions. :)
Yup, sure am. Thanks.
Hi Ben,
Firstly thanks for inventing ECSS.
Secondly, following on from Site Wide micro-namespaces #5 (https://github.com/benfrain/ecss/issues/5), I have a question about how Alert boxes fit in ECSS methodology.
So, in ECSS, what should I do with:
Should they live in:
Thanks, Leigh