Skip to content
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

Add support for css variables to mixin #497

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions ember-power-calendar/less/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
box-sizing: border-box;
}

.ember-power-calendar-days, .ember-power-calendar-days * {
.ember-power-calendar-days,
.ember-power-calendar-days * {
box-sizing: border-box;
}

Expand Down Expand Up @@ -93,20 +94,20 @@
@cell-size: null,
@cell-width: @cell-size,
@cell-height: @cell-size,
@cell-with-spacing-width: @cell-width + 2px,
@cell-with-spacing-width: calc(~"@{cell-width} + 2px");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

";" is not correct, should be like before ","

@row-padding-top: 0,
@row-padding-bottom: 0,
@row-padding-left: 0,
@row-padding-right: 0,
@row-width: @cell-with-spacing-width * 7 - 2px + @row-padding-left + @row-padding-right,
@row-height: @cell-height + 2px,
@row-width: calc(~"(@{cell-with-spacing-width} * 7) - 2px + @{row-padding-left} + @{row-padding-right}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

";" is not correct, should be like before ","

@row-height: calc(~"@{cell-height} + 2px");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

";" is not correct, should be like before ","

@primary-color: #0078c9,
@nav-button-color: @primary-color,
@nav-button-color--focus: lighten(@nav-button-color, 20%),
@day-default-text-color: #bbb,
@day-current-month-color: #F5F7FA,
@day-weekday-text-color: #333333,
@day-current-month-text-color: #656D78,
@day-current-month-text-color: #656d78,
@day-other-month-text-color--hover: @day-current-month-text-color,
@day-focus-shadow-color: @primary-color,
@day-today-color: #eee,
Expand All @@ -118,58 +119,59 @@
@day-range-end-background-color--hover: @day-range-end-background-color,
@day-selected-color: lighten(@primary-color, 50%),
@day-selected-color--hover: @day-selected-color,
@day-selected-text-color: #656D78,
@day-selected-text-color: #656d78,
@day-selected-text-color--hover: @day-selected-text-color
) {

width: @row-width;
.ember-power-calendar-week:first-child {
&[data-missing-days="1"] {
padding-left: @cell-with-spacing-width * 1;
&[data-missing-days='1'] {
padding-left: calc(~"@{cell-with-spacing-width} * 1");
}
&[data-missing-days="2"] {
padding-left: @cell-with-spacing-width * 2;
&[data-missing-days='2'] {
padding-left: calc(~"@{cell-with-spacing-width} * 2");
}
&[data-missing-days="3"] {
padding-left: @cell-with-spacing-width * 3;
&[data-missing-days='3'] {
padding-left: calc(~"@{cell-with-spacing-width} * 3");
}
&[data-missing-days="4"] {
padding-left: @cell-with-spacing-width * 4;
&[data-missing-days='4'] {
padding-left: calc(~"@{cell-with-spacing-width} * 4");
}
&[data-missing-days="5"] {
padding-left: @cell-with-spacing-width * 5;
&[data-missing-days='5'] {
padding-left: calc(~"@{cell-with-spacing-width} * 5");
}
&[data-missing-days="6"] {
padding-left: @cell-with-spacing-width * 6;
&[data-missing-days='6'] {
padding-left: calc(~"@{cell-with-spacing-width} * 6");
}
}
.ember-power-calendar-week:last-child {
&[data-missing-days="1"] {
padding-right: @cell-with-spacing-width * 1;
&[data-missing-days='1'] {
padding-right: calc(~"@{cell-with-spacing-width} * 1");
}
&[data-missing-days="2"] {
padding-right: @cell-with-spacing-width * 2;
&[data-missing-days='2'] {
padding-right: calc(~"@{cell-with-spacing-width} * 2");
}
&[data-missing-days="3"] {
padding-right: @cell-with-spacing-width * 3;
&[data-missing-days='3'] {
padding-right: calc(~"@{cell-with-spacing-width} * 3");
}
&[data-missing-days="4"] {
padding-right: @cell-with-spacing-width * 4;
&[data-missing-days='4'] {
padding-right: calc(~"@{cell-with-spacing-width} * 4");
}
&[data-missing-days="5"] {
padding-right: @cell-with-spacing-width * 5;
&[data-missing-days='5'] {
padding-right: calc(~"@{cell-with-spacing-width} * 5");
}
&[data-missing-days="6"] {
padding-right: @cell-with-spacing-width * 6;
&[data-missing-days='6'] {
padding-right: calc(~"@{cell-with-spacing-width} * 6");
}
}
.ember-power-calendar-day, .ember-power-calendar-weekday {
.ember-power-calendar-day,
.ember-power-calendar-weekday {
max-width: @cell-width;
max-height: @cell-height;
width: @cell-width;
height: @cell-height;
}
.ember-power-calendar-weekdays, .ember-power-calendar-week {
.ember-power-calendar-weekdays,
.ember-power-calendar-week {
height: @row-height;
padding-left: @row-padding-left;
padding-right: @row-padding-right;
Expand Down
59 changes: 30 additions & 29 deletions ember-power-calendar/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@
$cell-size: null,
$cell-width: $cell-size,
$cell-height: $cell-size,
$cell-with-spacing-width: $cell-width + 2px,
$cell-with-spacing-width: calc(#{$cell-width} + 2px),
$row-padding-top: 0,
$row-padding-bottom: 0,
$row-padding-left: 0,
$row-padding-right: 0,
$row-width: (
$cell-with-spacing-width * 7 - 2px + $row-padding-left + $row-padding-right,
),
$row-height: $cell-height + 2px,
$row-width:
calc(
#{$cell-with-spacing-width} * 7 - 2px + #{$row-padding-left} + #{$row-padding-right}
),
$row-height: calc(#{$cell-height} + 2px),
$primary-color: #0078c9,
$nav-button-color: $primary-color,
$nav-button-color--focus: lighten($nav-button-color, 20%),
Expand All @@ -123,54 +124,54 @@
width: $row-width;

.ember-power-calendar-week:first-child {
&[data-missing-days="1"] {
padding-left: $cell-with-spacing-width * 1;
&[data-missing-days='1'] {
padding-left: calc(#{$cell-with-spacing-width} * 1);
}

&[data-missing-days="2"] {
padding-left: $cell-with-spacing-width * 2;
&[data-missing-days='2'] {
padding-left: calc(#{$cell-with-spacing-width} * 2);
}

&[data-missing-days="3"] {
padding-left: $cell-with-spacing-width * 3;
&[data-missing-days='3'] {
padding-left: calc(#{$cell-with-spacing-width} * 3);
}

&[data-missing-days="4"] {
padding-left: $cell-with-spacing-width * 4;
&[data-missing-days='4'] {
padding-left: calc(#{$cell-with-spacing-width} * 4);
}

&[data-missing-days="5"] {
padding-left: $cell-with-spacing-width * 5;
&[data-missing-days='5'] {
padding-left: calc(#{$cell-with-spacing-width} * 5);
}

&[data-missing-days="6"] {
padding-left: $cell-with-spacing-width * 6;
&[data-missing-days='6'] {
padding-left: calc(#{$cell-with-spacing-width} * 6);
}
}

.ember-power-calendar-week:last-child {
&[data-missing-days="1"] {
padding-right: $cell-with-spacing-width * 1;
&[data-missing-days='1'] {
padding-right: calc(#{$cell-with-spacing-width} * 1);
}

&[data-missing-days="2"] {
padding-right: $cell-with-spacing-width * 2;
&[data-missing-days='2'] {
padding-right: calc(#{$cell-with-spacing-width} * 2);
}

&[data-missing-days="3"] {
padding-right: $cell-with-spacing-width * 3;
&[data-missing-days='3'] {
padding-right: calc(#{$cell-with-spacing-width} * 3);
}

&[data-missing-days="4"] {
padding-right: $cell-with-spacing-width * 4;
&[data-missing-days='4'] {
padding-right: calc(#{$cell-with-spacing-width} * 4);
}

&[data-missing-days="5"] {
padding-right: $cell-with-spacing-width * 5;
&[data-missing-days='5'] {
padding-right: calc(#{$cell-with-spacing-width} * 5);
}

&[data-missing-days="6"] {
padding-right: $cell-with-spacing-width * 6;
&[data-missing-days='6'] {
padding-right: calc(#{$cell-with-spacing-width} * 6);
}
}

Expand Down
Loading