-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Put buttons in calendar cells #24171
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use 'sass:math'; | ||
@use '../core/style/button-common'; | ||
@use '../../cdk/a11y'; | ||
|
||
$calendar-body-label-padding-start: 5% !default; | ||
|
@@ -31,13 +32,24 @@ $calendar-range-end-body-cell-size: | |
padding-right: $calendar-body-label-side-padding; | ||
} | ||
|
||
.mat-calendar-body-cell { | ||
.mat-calendar-body-cell-container { | ||
position: relative; | ||
height: 0; | ||
line-height: 0; | ||
} | ||
|
||
.mat-calendar-body-cell { | ||
@include button-common.reset(); | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
Comment on lines
+43
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this really need to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, that was the only way I could find to get that layout to be correct after spending an hour wrangling the CSS. It seemed liked the easiest way to me. We're already using absolute position to layout the other content inside the cell like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @crisbeto the container being There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this is our only option. The problem is that we set |
||
background: none; | ||
text-align: center; | ||
outline: none; | ||
cursor: pointer; | ||
font-family: inherit; | ||
margin: 0; | ||
} | ||
|
||
// We use ::before to apply a background to the body cell, because we need to apply a border | ||
|
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.
What are these two attrs for?
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.
They are used only in our js.
_getCellFromElement
uses them to map a dom element back to theMatCalendarCell
it corresponds to.https://github.com/angular/components/blob/master/src/material/datepicker/calendar-body.ts#L357