Read the statement by Michael Teeuw here.
How to set Font in Alarm Clock
-
@nobita the alarm clock sends a notification to the alert module which displays this, so you have to change the css for the alert module:
custom.css
.alert span.light { //Here you can change the title } .alert span.thin { //Here you can change the message }
-
@strawberry-3.141 not work, thanks
-
@nobita ok it doesnt render in the module itself try
.ns-box-inner span.light
-
@strawberry-3.141 said in How to set Font in Alarm Clock:
@nobita ok it doesnt render in the module itself try
.ns-box-inner span.light
I installed the module just to test it, I also noticed the .ns-box-inner
but, something is overwritingfont-size, font-color
I’ve managed to change the color by using.ns-box-inner span.light {color: #00F;}
but changing that tofont-color
will go back to the original colors. -
@strawberry-3.141 & @broberg I believe that default alert module has inline styles for alerts and notifications that would override any CSS that is set outside of it.
For example take a look at https://github.com/MichMich/MagicMirror/blob/master/modules/default/alert/alert.js#L39
if (message.title) { msg += "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span>"; } if (message.message){ if (msg != ""){ msg+= "<br />"; } msg += "<span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>"; }
and https://github.com/MichMich/MagicMirror/blob/master/modules/default/alert/alert.js#L81
if (params.title) { message += "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span>" } if (params.message) { if (message != ""){ message += "<br />"; } message += "<span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>"; }
I believe that most elegant way of fixing it is to move those styles into CSS file and have ability to override it in
custom.css
or other file. -
@morozgrafix thats correct, another possibility could be
!important
-
@morozgrafix I actually tried changing the font-size in the .js file, but no go, still the size is unaffected,
adding!important
tofont-size
worksEdit, it works when you change the correct line. sorry my mistake, so we can conclude that it is as morozgrafix says, the inline style overwrites the css files.
So a quick fix would be to just use !important in the cssAnd Then someone can make a pull request on the default module to remove the inline styles and add it to the css file instead
-
@morozgrafix was totally right, edited my post above
-
@broberg I agree with you and think that getting rid of those inline styles is the best long term solution