components icon indicating copy to clipboard operation
components copied to clipboard

Class names could cause confusion between breakpoints and sizing

Open bsteffl opened this issue 8 years ago • 4 comments

Bug, feature request, or proposal:

Proposal, Have separate naming schemes for sizing vs. breakpoints

What is the expected behavior?

Class names between breakpoints and sizing class names should be discernibly different so consumers know the difference.

What is the current behavior?

When using the small badge you get a class name mat-badge-small. When using mat-bottom-sheet you get classes relating to breakpoints mat-bottom-sheet-container-medium and may cause confusion understanding if this is a class for sizing vs. class for breakpoints when overriding styles. image
image

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV

What is the use-case or motivation for changing an existing behavior?

To have a clear and concise class naming system.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material 6.3.3

Is there anything else we should know?

I realize this is a very minuscule detail and maybe isn't a concern, but thought I should mention it.

bsteffl avatar Jul 18 '18 16:07 bsteffl

I can see how this could be confusing at first glance.

Do you have any thoughts on what naming scheme we could use? Also worth noting that this would be a breaking change and have to happen over time.

josephperrott avatar Jul 18 '18 17:07 josephperrott

You could separate your classes out using the BEM method and anything relating to size as a modifier. I liked that you were also using -size in some instances in the code and thought that helped clarify. I don't have any concrete ideas on naming specific to breakpoints.

Here is one example: mat-badge--small-size

bsteffl avatar Jul 18 '18 18:07 bsteffl

Closing this since we consider our CSS classes to be internal/implementation details. Despite that, changing the class names at this point would cause unnecessarily churn for people that override the CSS anyway.

jelbourn avatar May 26 '20 21:05 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.