-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
make event colors optional #473
Conversation
43c9c44
to
55fbebc
Compare
Not sure about the ejs was missing for me. Installed the module but now the package-lock went crazy. Shall I remove the commit again? Do you have any thoughts on how to treat this line: Not sure if we just go with |
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.
Sorry about the late reply on this one, am just getting ready to move country at the moment and things are a bit hectic while I sort things out 😄
re https://github.com/mattlewis92/angular-calendar/blob/master/src/modules/month/calendar-month-view.component.ts#L315 I would just set it to #005cbf
by default (same logic as is in the CSS)
src/defaults.scss
Outdated
@@ -0,0 +1,6 @@ | |||
|
|||
.cal-event { |
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.
Rather than having defaults.scss
I think it's better to just have the CSS copied under each of the views, it also prevents adding the global cal-event
rule to the whole app
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.
Also for the month view the background color is the primary color, and for the day / week views its the secondary color, and the border color is the primary one
src/defaults.scss
Outdated
.cal-event { | ||
background-color: #0062cc; | ||
border-color: #005cbf; | ||
color: #fff; |
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.
How come this is needed?
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.
If there is no color specified it will use the font set on a parent. It may doesn't fit to the background and needs extra Styling. That was my thought.
package.json
Outdated
@@ -124,6 +124,7 @@ | |||
"core-js": "^2.5.1", | |||
"create-plunker": "^1.4.0", | |||
"css-loader": "^0.28.9", | |||
"ejs": "^2.5.7", |
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.
This shouldn't be needed - are you running the latest version of npm? If you copy the package-lock.json from master and rm -rf node_modules
first before doing npm i
it should do the trick.
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.
I checked out the project from scratch and did npm I. When running the tests it complained that ejs was missing. I'll give it another try and update my npm to latest.
fixture.nativeElement.querySelector('.cal-event') | ||
); | ||
expect(computedStyles.getPropertyValue('background-color')).to.equal( | ||
'rgb(0, 98, 204)' |
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.
That's a clever way of testing this change, nice idea! 😄
6095060
to
ba0ab58
Compare
use correct color scheme for views use blue scheme from existing demos apply fallback color if none specified when toggling daylight remove default.scss apply currentColor to links within cal-event-title
ba0ab58
to
5027de3
Compare
} | ||
|
||
.cal-event-title:link { | ||
color: currentColor; |
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.
sorry for this additional change. I can also remove it again but it was strange to see dots from ellipsis in the specified color and the link in blue (bootstrap) in the demos..
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.
I learnt something new today from this, thanks! 😄
I changed the colors to use the existing blue scheme from the demos. Bootstrap was using grey as secondary color... Hope that this addresses all your concerns. |
Codecov Report
@@ Coverage Diff @@
## master #473 +/- ##
==========================================
- Coverage 96.82% 96.66% -0.17%
==========================================
Files 34 34
Lines 599 600 +1
Branches 61 62 +1
==========================================
Hits 580 580
Misses 1 1
- Partials 18 19 +1
Continue to review full report at Codecov.
|
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.
I think the week view component template needs to override the border color with the primary one (if set). Currently the week view events don't have borders (I think they should for consistency with the day view)
On the month view, I think the event titles are more readable in white, you still have the colored dot so you know the color. WDYT?
Thanks for your hints! The event-title color is already white, it was the link color again. Border-color on the week view will now update according to the color specified in the event. |
Perfect, thanks a lot Tim! Have an awesome easter weekend! 😄 |
Whoops, sorry I completely forgot to release this, done now in |
/cc @mattlewis92
relates to #468