New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: change the naming of status indicator classes to follow BEM #2204
Conversation
changing the BEM to the status indicator and adding link css
Deploy preview for fundamental-styles ready! Built with commit 819d615 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Lokanathan-k Could you add [ci visual]
text to your commits message? Just to trigger chromatic. Also you need to indicate that it's BREAKING CHANGE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lokanathan-k , you checked in the template that you updated the breaking changes in the wiki but you didn't. The checks in the PR templates are not there just to be checked :)
Also there's something wrong with the BEM structure in the case of Status indicator with Label.
The structure should be something like:
then you rely on specificity to overwrite the children properties:
and
|
on using with the parent level the svg size gets reduced on add the label content. or the label has to be kept as a separate component. since the label size vary from sm to xl and the margin size is different for different size.
|
BEM change to the css classes and adding testing storyshots
@Lokanathan-k ,
Then in case you want to have a label that has bigger font-size you create a MODIFIER class and overwrite ONLY the font-size:
But you need to always apply both, because if you apply only
|
updating the BEM and test cases [ci visual]
<span class="fd-status-indicator--lg__text fd-status-indicator--critical__text">100%</span> | ||
<svg id="__shape0__box9-24" class="fd-status-indicator--lg" data-sap-ui="__shape0-__box21-24" version="1.1" xlmns="http://www.w3.org/2000/svg" viewBox="0 0 26 25" preserveAspectRatio="xMidYMid meet" x="0" y="0" width="100%" height="100%"> | ||
<div class="fd-status-indicator fd-status-indicator--critical fd-status-indicator--lg" aria-roledescription="Status Indicator" role="progressbar" aria-valuetext="100%" tabindex=0 aria-label="Euro Status Indicator With Labelled On Top" focusable="true" title="100% with label on top"> | ||
<span class="fd-status-indicator__label--lg">100%</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
<span class="fd-status-indicator__label fd-status-indicator__label--lg">100%</span>
@@ -330,14 +330,14 @@ export const StatusIndicatorLabels = () => ` | |||
</path> | |||
</svg> | |||
</svg> | |||
<span class="fd-status-indicator--lg__text fd-status-indicator--positive__text">100%</span> | |||
<span class="fd-status-indicator__label--lg">100%</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
<span class="fd-status-indicator__label fd-status-indicator__label--lg">100%</span>
<span class="fd-status-indicator--lg__text fd-status-indicator--critical__text">100%</span> | ||
<svg id="__shape0__box12-24" class="fd-status-indicator--lg" data-sap-ui="__shape0-__box21-24" version="1.1" xlmns="http://www.w3.org/2000/svg" viewBox="0 0 36 25" preserveAspectRatio="xMidYMid meet" x="0" y="0" width="100%" height="100%"> | ||
<div class="fd-status-indicator fd-status-indicator--critical fd-status-indicator--horizontal-label fd-status-indicator--lg" aria-roledescription="Status Indicator" role="progressbar" aria-valuetext="100%" tabindex=0 aria-label="Euro Status Indicator With Labelled On Left" focusable="true" title="100% with label on left"> | ||
<span class="fd-status-indicator__label--lg">100%</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
<span class="fd-status-indicator__label fd-status-indicator__label--lg">100%</span>
@@ -396,7 +396,7 @@ export const StatusIndicatorLabels = () => ` | |||
</path> | |||
</svg> | |||
</svg> | |||
<span class="fd-status-indicator--lg__text fd-status-indicator--positive__text">100%</span> | |||
<span class="fd-status-indicator__label--lg">100%</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
<span class="fd-status-indicator__label fd-status-indicator__label--lg">100%</span>
we already discussed that a modifier class like fd-status-indicator__label--lg
should not be used alone but with a base element class like fd-status-indicator__label
. In this case fd-status-indicator__label--lg
is modifying the props set in fd-status-indicator__label
.
694b491
to
819d615
Compare
sorry to dismiss, but need to merge this PR
Related Issue
Closes SAP/fundamental-styles#
Description
changing the BEM to the status indicator and adding link css
Screenshots
Before:
fd-status-indicator--lg__text and fd-status-indicator--critical__text.
After:
fd-status-indicator__text--lg fd-status-indicator__text--critical
Please check whether the PR fulfills the following requirements
rem
fd-*
class is used in the filefd-rtl
,fd-ellipsis
,fd-flex
,fd-selected
,fd-focus
, ect.)fd-reset()
mixin is applied to all elementsnormalize
optionunnormalize
option[ci visual]
so it can trigger chromatic visual regression (e.g.test: run chromatic visual regression [ci visual]
)