【问题标题】:how to remove bootstrap css from spree frontend如何从 spree 前端删除引导 css
【发布时间】:2016-06-10 10:22:34
【问题描述】:

最近,我尝试通过覆盖 frontend_boostrap.css.scss 从 Spree 前端删除所有 Bootstrap 实例

我刚刚将此文件包含在 app/assets/stylesheets/spree/frontend/frontend_boostrap.css.scss 中并将其保留为空白,但应用程序仍会加载引导 css。请指导我如何从前端删除它。

【问题讨论】:

    标签: css twitter-bootstrap spree


    【解决方案1】:

    最好的方法是添加文件夹:

    # app/views/spree/shared/_head.html.erb then remove bootstrap:
    
    <meta charset="utf-8">
    <title><%= title %></title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1" name="viewport">
    <%== meta_data_tags %>
    <%= canonical_tag(current_store.url) %>
    <%= favicon_link_tag 'favicon.ico' %>
    
    <%# Remove below %>
    <%= stylesheet_link_tag 'spree/frontend/all', media: 'screen' %>
    
    <%= csrf_meta_tags %>
    <%# Remove below %>
    <%= javascript_include_tag 'spree/frontend/all' %>
    
    <!--[if lt IE 9]>
      <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script>
    <![endif]-->
    <%= yield :head %>
    <%= render 'spree/shared/translations' %>
    

    Spree's head

    如果你这样做,你有很多工作要做,因为很少有 JavaScript 代码附加了引导类。

    【讨论】:

      【解决方案2】:

      从您的 html 页面中删除 &lt;link href="/assets/bootstrap.css" rel="stylesheet"&gt;

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-07-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-04-26
        • 2010-11-12
        • 1970-01-01
        相关资源
        最近更新 更多