Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Dr_jAcKaSS

    (@dr_jackass)

    A closer look to CSS reveals that the following CSS is not generated:

    .mc-main .mc_custom-category-name .event-title a {
    background: #fffdd4;
    }

    So there must be some sort of scripting error that should generate this CSS, but it does not.

    (It is not the CSS issue such as overriding a CSS rule with my style sheet).

    Plugin Author Joe Dolson

    (@joedolson)

    The mini calendar does not include an anchor element in the event title by default, so that CSS does not apply. You can configure the event title to include a link (such as to an event details page), in which case the CSS will apply automatically.

    Thread Starter Dr_jAcKaSS

    (@dr_jackass)

    Thanks Joe!

    I have get back to this after a while, since I was short on time then.

    I would suggest changing the line 156 in my-calendar-core.php:
    from
    $category_styles .= "\n.mc-main .$class .event-title a { $type: $color; $inv }";
    to
    $category_styles .= "\n.mc-main .$class .event-title { $type: $color; $inv }";

    I have removed the anchor element from CSS. If you use {title_link} in settings for event title, the link is generated only if there is an URL set, which is a correct behaviour. But I believe the category background color should be set to title irrespective of whether the title is a link or not.
    Presently the background is coloured only if title is a link, otherwise not.

    Plugin Author Joe Dolson

    (@joedolson)

    I won’t be making that change, because the majority case for this output is that the event titles are links — and the example you provide would only apply when they aren’t links, because the style sheet cascade doesn’t descend to anchors for color.

    I will look into automatically detecting whether there’s a link or not, to switch that, but definitely can’t just make the assumption that there’s no link, since it’s the more unusual case.

    Thread Starter Dr_jAcKaSS

    (@dr_jackass)

    According to my test, by making this little change the background color is set for both cases – whether it is a link or not.

    Well, next line may also be slightly altered if you want to change the background on mouseOver (focus), but this is more or less a CSS thing, depends on what effect would you like to have.

    Personally I use different effect for hover, so I have turned off background-color change by adding the following CSS to my stylesheet:
    #jd-calendar.mc-main .event-title a {
    background-color: inherit !important;
    }
    #jd-calendar.mc-main .event-title a:hover {
    background-color: inherit !important;
    }

    But the later is of course adjusted to my template needs.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mini calendar – Event titles with category color as background’ is closed to new replies.