Style.css vs tribe-event.css

Home Forums Calendar Products Events Calendar PRO Style.css vs tribe-event.css

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #118558
    pickleshy
    Participant

    The Themer’s Guide at https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/ instructs us to put our custom styles in tribe-events/tribe-events.css, but I’ve wanted to use some of my custom styles on both event pages and non-event pages (like tag.php). To allow non-event pages to use these styles, I’ve moved them to my child theme’s style.css page and so far I haven’t seen any problems with the event pages using styles defined in style.css.

    Now, I currently have styles defined in style.css and tribe-event.css and I got to wondering whether the tribe-event.css style is strictly necessary. I tried putting the Themer’s Guide’s code snippet to change the metabox of a single event into style.css and it worked, so I’m wondering why the guidance is to put styles in tribe-events/tribe-events.css instead of style.css. I think in my case, it makes the most sense to keep all styles in one place. Are there downfalls to that, or is the recommendation of using the tribe-event.css file basically to promote separation of concerns?

    -> @Andy: That’s sort of what I was wondering. So far, evidence shows that the style.css file gets precedence, so is the file load order deterministic? Have you seen evidence that the event stylesheet sometimes gets loaded after style.css?

    #118940
    Casey
    Participant

    pickleshy,
    Thanks for getting in touch! Essentially, you can put styles in other file, but sometimes it’s helpful to organize your styles into separate files. The main reason for splitting your styles into different files like this, is because upgrading your theme will overwrite any modifications you’ve made to your style.css file.

    I hope that helps to answer your questions, but let me know if I can help further. Thanks! 🙂

    -Casey-

    #119004
    Andy Fragen
    Moderator

    pickleshy, be careful about putting CSS overrides in your theme’s styles.css as the load order of the Events Calendar stylesheets may be later than your theme’s stylesheet and then all of your overrides will be overridden.

    #119212
    Andy Fragen
    Moderator

    pickleshy, it appears that the theme style.css is loaded later and therefore has precedence. However, I wouldn’t count on that. It also appears that TEC and ECP will now autoload tribe-events.css stylesheets after their respective plugin’s stylesheets. Unfortunately that means that if you have overrides for both TEC and ECP your ECP override might not work as ECP appears to load it’s stylesheets after TEC loads it’s stylesheets as well as your overrides.

    I have created a plugin, The Events Calendar User CSS which will load your overrides as close to dead last as possible. What that means your /{my-theme}/tribe-events/tribe-events.css will take precedence over the built-in TEC and ECP stylesheets.

    #119879
    Casey
    Participant

    Thanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to go ahead and close it out.

    By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://wordpress.org/support/view/plugin-reviews/the-events-calendar?filter=5

    Thanks in advance. 🙂

    Cheers,
    Casey

    P.S. – Thanks for the help on this one Andy! 😀

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Style.css vs tribe-event.css’ is closed to new replies.