-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat(styles): added an optional Calendar legend section [ci visual] #5707
Conversation
✅ Deploy Preview for fundamental-styles ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Screen.Recording.2024-10-21.at.2.45.31.PM.mov
On focus elements "jump". Element's states (hover, focus, active) should not affect the element's dimensions. In this case, the focus outline should be shown without a change in the element height, which causes the "jump"
| \` fd-calendar--legend__item--circle\` | Makes the legend item representation a circle | ||
| \` fd-calendar--legend__item--square\` | Makes the legend item representation a square | ||
| \` fd-calendar--legend__item--text\` | Adds a descriptive title to the legend item | ||
| \` fd-calendar--legend__item--text-description\` | Adds any additional information to the legend item |
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.
These class names are not following the BEM rules.
fd-calendar
is the block element, because the entire element can be "extracted" from a project and used in another project, aka it's an independent unit. The elements inside this blocks have the double underscore in their class names.
For example: fd-calendar__row
, fd-calendar__item
, fd-calendar__date
, etc.
When you look at these classes you can immediately tell that it's a row/item/date, etc. that belong to the calendar component (block).
The double dash notation is a modifier. If you have an item, or date, that are a variation of the common one, you use a modifier class to add specifics for it. For example, if the weekend dates and the work days have different background, then you do something like this:
fd-calendar__date fd-calendar__date--weekend
or fd-calendar__date fd-calendar__date--work
, fd-calendar__date fd-calendar__date--vacation
.
When you read the class fd-calendar__date--vacation
it basically says: "it's a vacation variation of date element that belongs to calendar".
If you have to read this class fd-calendar--legend__item--circle
, you can't tell what is an element and what is a modifier.
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.
packages/styles/stories/Components/calendar/legend.example.html
Outdated
Show resolved
Hide resolved
packages/styles/stories/Components/calendar/legend.example.html
Outdated
Show resolved
Hide resolved
packages/styles/src/calendar.scss
Outdated
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); | ||
grid-gap: 0.5rem; | ||
margin-top: 0.5rem; |
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.
packages/styles/src/calendar.scss
Outdated
@include fd-flex(); | ||
|
||
align-items: center; |
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.
@include fd-inline-flex-center()
packages/styles/src/calendar.scss
Outdated
border: 0.0625rem solid var(--sapContent_ForegroundBorderColor); // 0.125rem if not ForegroundBorderColor | ||
border-radius: 0.125rem; | ||
background-color: none; | ||
margin: 0; |
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.
margin-inline: 0;
margin-block: 0;
packages/styles/src/calendar.scss
Outdated
&-description { | ||
@include legendTextBase(); | ||
|
||
position: absolute; |
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.
absolute positioning should be your last option. Try with flex.
packages/styles/src/calendar.scss
Outdated
position: absolute; | ||
vertical-align: middle; | ||
white-space: pre-line; | ||
text-overflow: ellipsis; |
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.
@mixin fd-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
packages/styles/src/calendar.scss
Outdated
white-space: pre-line; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
padding-top: 0; |
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.
padding-block-start: 0;
packages/styles/src/calendar.scss
Outdated
} | ||
|
||
@include fd-focus(){ | ||
padding: 0.125rem; |
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.
padding-inline: 0.125rem;
padding-block: 0.125rem;
7c8a3d9
to
d55aa1c
Compare
d55aa1c
to
9554e7d
Compare
0140703
to
bc91537
Compare
bc91537
to
7694890
Compare
The styling needed for the calendar legend: SAP/fundamental-ngx#12403
Example: