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
Option to load calendar CSS from an external file instead of injection #7220
Comments
I have the same issue with React and Fullcalendar 6 version. Version 5 worked fine. It happens only in production version. Here is an example of how the styles are injected to the I see that there is related issue which was closed #7167 |
We have the same problem, so we downgraded to V5 until we find a solution for this |
I can see how that could be useful. As a workaround, you could load (inject) your CSS after the calendar is loaded. For example, this shows the CSS not working initially, but after making some edit in the CSS, codepen will live reload the CSS and it then gets applied. |
@acerix Thank you for the work-around. Unfortunately that does not work for us. I would still prefer an option to load the CSS file outside of JS. |
@artnikbrothers Thank you for referencing my previous ticket, which was closed unfortunately. +1 on this ticket now to bring back the functionality from v5 to properly load external stylesheets. |
I could find a workaround. However, this will not work with CSS preprocessors.
|
Since I didn't want to spend time on finding the best solution and at the same time didn't want to use .my-cool-calendar {
// calendar styles which I want to overwrite
.fc {
....
}
} |
Version v6.1.5 now ensures FullCalendar's styles load higher-up in the
Is this sufficient for people? I know people were hoping FullCalendar stops injecting its own styles and instead provides a stylesheet to include, however, this comes with a lot of complexity for the developer, namely that each plugin provides its own styles, some plugins are inter-dependent, and thus the developer would need to understand the dependency graph and import styles in an exact order. This is what we had in v4 and people were constantly screwing it up. |
Works great for me |
Why can't the fullcalendar css be injected as a |
@arshaw Thank you for handling this topic so quickly! |
This doesn't work in nextjs production out of the box. I think ti's having trouble inject those style tags in production, but does work in localhost. Any pointers? |
To echo what @trollbot38 said – since upgrading to v6 from v5, I've noticed that after a client-side route with Next.js, the styles don't get injected properly. Refreshing the page works, but navigating from a different client-side route breaks it. Does this seem like something reasonable that could happen? Thanks! |
@trollbot38 and @nandorojo , please see this ticket: |
[Issue is now closed but in Todo(?) I'm guessing comments here are still considered.]
I feel your pain, but isn't this issue about providing standard CSS as an option? I assume this means a toggle setting of some sort. The KISS option could come with "here be dragons" warnings and we'll have to figure out the correct CSS inclusion order to make it all work. With no guarantees either. Is that reasonable? Not sure if most library consumers are using framework modules or simply pulling from the CDN. As more of a back end developer not using frameworks or wanting to get into JS builds, I prefer this option as it's more intuitive and standard. (Also I'm grateful for it!) I suppose in your effort/reward equation, you'll want to consider how common my type of library user is. |
Checklist
Is this feature for a specific connector (React/Angular/etc)?
No connector in particular
Feature Description
Hi,
I am seeing that the CSS is getting injected upon calendar initialization. I am wondering if there is a way to have an external CSS file that I could use instead?
!important
. With an external CSS file I can just load my overrides afterwards.Thank you!
Art
The text was updated successfully, but these errors were encountered: