diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html
index bf2c52733..c8a307628 100644
--- a/sphinx_rtd_theme/layout.html
+++ b/sphinx_rtd_theme/layout.html
@@ -29,7 +29,11 @@
{%- endif %}
{%- for css_file in css_files %}
- {{ css_tag(css_file) }}
+ {%- if css_file|attr("filename") %}
+ {{ css_tag(css_file) }}
+ {%- else %}
+
+ {%- endif %}
{%- endfor %}
{# "extra_css_files" is a theme option and it's always a string #}