Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

main layout style names have strange convention #126

Open
tmattsso opened this issue Nov 21, 2017 · 4 comments
Open

main layout style names have strange convention #126

tmattsso opened this issue Nov 21, 2017 · 4 comments

Comments

@tmattsso
Copy link
Contributor

main layout style names have strange convention; why not use the toplevel main-layout name in the styles instead?

@pleku
Copy link
Contributor

pleku commented Feb 1, 2018

@tmattsso can you please clarify what is strange ??

@pleku pleku reopened this Feb 1, 2018
@tmattsso
Copy link
Contributor Author

tmattsso commented Feb 1, 2018

I mean this:
title.addClassName("main-layout__title")

why not just set main-layout for the main layout itself, instead of those weird concatenations

@pleku
Copy link
Contributor

pleku commented Feb 1, 2018

@jouni can clarify, I was the reviewer and just trusted him

@jouni
Copy link
Member

jouni commented Feb 1, 2018

Yeah, they are probably strange to Java developers, and I should’ve discussed this with the team.

Front-end devs should recognize BEM when they see it. But, we should perhaps not use BEM in any of our products, and instead always use a new custom element with shadow dom when we want to ensure that styles are properly scoped and easier to maintain. After all, that’s what BEM tries to provide.

So, I’m okay if we want to update the class names. But, we should not encourage bad practices, and at least encapsulate the header/nav bar into a separate component with its own style scope.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants