命名Bootstrap和Foundation CSS框架 [英] Namespacing the Bootstrap and Foundation CSS frameworks

查看:79
本文介绍了命名Bootstrap和Foundation CSS框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 Foundation CSS框架注入到现有项目中. Foundation的许多类名与基础代码中的类冲突.如何将Foundation JavaScript和CSS文件封装在它们自己的名称空间中?

I'm injecting the Foundation CSS framework into an existing project. Many of Foundation's class names conflict with classes in the underlying code. How can I encapsulate the Foundation JavaScript and CSS files in their own namespace?

这些是导致冲突的特定文件:

These are the specific files that cause the conflicts:

  • foundation.css
  • foundation.js
  • foundation.reveal.js

我正在使用Foundation v5.

I'm using Foundation v5.

我在这个问题上添加了twitter-bootstrap标记,因为我还尝试将Bootstrap CSS和JavaScript文件放在它们自己的名称空间中(例如,使用

I've added the twitter-bootstrap tag to this question because I've also tried to put the Bootstrap CSS and JavaScript files in their own namespace (e.g., with these instructions), but with no success. I suspect that the right namespacing approach would work for both Foundation and Bootstrap.

推荐答案

我最终将Foundation换成 Ink框架,它具有我所需的功能,并且还包含其大多数类的名称空间.我意识到这并不能直接回答问题,但可以解决我的问题,因此我将其发布,以防其他人遇到相同的问题.

I ended up swapping Foundation for the Ink framework, which has the features I need and also namespaces most of its classes. I realize that this doesn't directly answer the question, but it solved my problem, so I'm posting it in case others have the same issue.

这篇关于命名Bootstrap和Foundation CSS框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆