zurb是什么网站_ZURB的Foundation 5入门

zurb是什么网站

Often, when you talk about front-end frameworks, Bootstrap, Foundation by ZURB, and uikit are usually the ones that are brought up.

A lot of people gravitate towards Bootstrap because of its ease of use, simple docs, great features, adoption in the industry, extensibility... I guess this list could go on and on. I've always seen Foundation as an alternative but never looked into what features they offered and if they could be a viable alternative to Bootstrap to be honest. There wasn't really a need to since Bootstrap did

通常,在谈论前端框架时,通常会提到 BootstrapZURB的Foundationuikit

许多人倾向于使用Bootstrap,因为它的易用性,简单的文档,强大的功能,在行业中的采用,可扩展性……我想这个清单可能还会持续下去。 我一直将Foundation视为替代方案,但从未研究过它们提供了哪些功能以及说实话它们是否可以替代Bootstrap。 由于Bootstrap可以完成我需要的 most of the things I needed from it. Recently, however, ZURB has been talking about Foundation for Apps. The way they are looking at modern applications really makes sense and fills a growing need that modern websites need to feel more interactive like their mobile counterparts. Foundation for Apps consists of three main parts: 大部分工作 ,因此实际上并不需要这样做。 但是,最近,ZURB一直在谈论Foundation for Apps。 他们看待现代应用程序的方式确实很有意义,并且满足了现代网站不断增长的需求,即现代网站需要像移动网站一样更具交互性。 Apps for Foundation由三个主要部分组成:
main-image-blog
horizontal-vertical-scroll

浏览网站 ( Navigating the Site )

zurb-homepage
Develop -> Add-ons and Develop-> Add-onsDocs. Docs

安装 ( Installation )

浏览他们的文档,我们可以进入三种不同的软件包: CSS, CSSSASS, and SASSBuilding an App. For more advanced uses, Foundation comes with a CLI that you can download and install so that you get Foundation commands from the command line. We won't be messing with that stuff today, just the CSS. Downloading the Building App 。 为了更高级的使用,Foundation附带了一个CLI,您可以下载并安装它,以便从命令行获取Foundation命令。 今天,我们不会再搞这些东西了,只是CSS。 下载 Foundation CSS is all we have to do. We'll get a sample site in Foundation CSS是我们要做的全部工作。 我们将在 index.html where we can test out CSS and JS features. index.html中提供一个示例站点,在其中可以测试CSS和JS功能。
zurb-foundation-5-preview

CSS设置 ( CSS Setup )

要启动Foundation网站,我们需要两个CSS文件: normalize.css and normalize.cssfoundation.css. Those will be enough to get the classes we need and then we can add our own stylings in a custom stylesheet that we'll call foundation.css 。 这些就足以获取我们需要的类,然后我们可以在自定义样式表中添加自己的样式,我们将其称为 app.css: app.css
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/app.css">    <!-- your custom styles -->
Now we have access to the classes that are necessary to build out all parts of Foundation. Let's say we needed buttons. The syntax isn't too far off of the Bootstrap way. You have .button, .button.tiny, .tiny.small, .small.large, .large.radius, .radius.round, .round.success, and .success.alert. We could create buttons by writing: .alert 。 我们可以通过编写以下内容来创建按钮:
<a href="#" class="button tiny primary">Tiny Primary</a>  
<a href="#" class="button large success radius">Radius Success</a>
<a href="#" class="button large alert round">Rounded Alert</a>

See the Pen Foundation 5 Button Showcase by Chris Sevilleja (@sevilayha) on CodePen.

见笔基金会5按钮展柜克里斯Sevilleja( @sevilayha上) CodePen

JS设置 ( JS Setup )

为了使JavaScript正常运行,我们需要三件事: jquery.js, jquery.jsfoundation.min.js, and we'll need to initialize Foundation like so: foundation.min.js ,并且我们需要像这样初始化Foundation:
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
    $(document).foundation();
</script>
By adding that $(document).foundation(); line, we'll be able to define our JavaScript elements just by using $(document).foundation(); 行,只需使用 HTML5 data-attributes. Here's an example of the dropdown split button and the tabs: HTML5 data-attributes就能定义JavaScript元素。 这是下拉拆分按钮和标签的示例:

See the Pen Foundation 5 JavaScript Demo by Chris Sevilleja (@sevilayha) on CodePen.

请参阅CodePen上Chris Sevilleja@sevilayha撰写的Pen Foundation 5 JavaScript演示

特征 ( Features )

一处看一下所有功能。 ZURB制作了 Kitchen Sink to show off all of Foundation 5's goodness. We won't dive too far into many of these just yet. The CSS is easy enough (just copy and paste the classes), and we'll be going more in depth into the grid, JavaScript components, and other fun features in separate articles. 厨房水槽,以炫耀Foundation 5的所有优点。 到目前为止,我们不会深入探讨其中的许多内容。 CSS非常简单(只需复制和粘贴类),我们将在单独的文章中更深入地介绍网格,JavaScript组件和其他有趣的功能。

CSS功能 ( CSS Features )

Foundation的优点在于它努力做到完全响应。 本着这种精神,几乎所有内容都是 defined using ems or rems. Even the media queries and widths of the grid system use ems. This is a great practice since it ensures you are starting your sites with a responsive... umm foundation. The CSS classes that come with Foundation are easy enough to learn and understand. Just read through the docs and ZURB's great examples to see how to create buttons and whatnot. Here's a quick list of some CSS features. 使用ems或rems定义的 。 甚至媒体查询和网格系统的宽度都使用ems。 这是一个很好的做法,因为它可以确保您以响应Swift的umm基础来启动网站。 Foundation附带CSS类非常容易学习和理解。 只需阅读文档和ZURB的出色示例,即可了解如何创建按钮等。 这是一些CSS功能的快速列表。
图标栏 ( Icon Bar )

See the Pen Foundation 5 Icon Bar Showcase by Chris Sevilleja (@sevilayha) on CodePen.

见笔基金会5图标栏展示克里斯Sevilleja( @sevilayha上) CodePen

开关 ( Switches )

See the Pen Foundation 5 Switches Showcase by Chris Sevilleja (@sevilayha) on CodePen.

见笔基金会5开关展柜克里斯Sevilleja( @sevilayha上) CodePen

定价表 ( Pricing Tables )
我希望它的语法有点语义,但是仍然很酷。

See the Pen Foundation 5 Pricing Table Showcase by Chris Sevilleja (@sevilayha) on CodePen.

That's a giant list. The docs can definitely show all that off best, so head on over and check out the great CSS features. Foundation is very polished in all of its CSS elements and I like the additions of pricing table, icon bar, switches, and some useful visibility and utility classes that could be used often.

见笔基金会5的价格表展由克里斯Sevilleja( @sevilayha上) CodePen

那是一个巨大的清单。 这些文档绝对可以充分展现所有优势,因此请继续阅读并查看出色CSS功能。 Foundation的所有CSS元素都非常精致,我喜欢添加定价表,图标栏,开关以及一些经常使用的有用的可见性和实用程序类。

JS功能 ( JS Features )

Foundation附带JavaScript功能也很棒。 JS的主要功能之一是内置的非画布菜单。 我们已经详细介绍了如何 create off-canvas menus but it's good to have a solution built into the framework that you're using. 创建画布菜单,但是最好在您使用的框架中内置一个解决方案。
关闭画布菜单 ( Off Canvas Menus )

See the Pen Foundation 5 Off-Canvas Showcase by Chris Sevilleja (@sevilayha) on CodePen.

Here's a quick list of the other JS features:

请参阅CodePen上的Chris Sevilleja@sevilayha撰写的Pen Foundation 5 Off-Canvas展示

以下是其他JS功能的快速列表:
范围滑块 ( Range Sliders )

See the Pen Foundation 5 Range Sliders Showcase by Chris Sevilleja (@sevilayha) on CodePen.

请参阅CodePen上Chris Sevilleja@sevilayha撰写的Pen Foundation 5 Range Sliders展示

Should You Use Foundation 5?

Foundation is a solid framework that has been tested, has solid backing in ZURB, and continues to innovate (can't stress how much I like their Motion UI and new grid stuff). The syntax is easy to learn and get started with. There's no reason not to give it a try. Just spin up a CodePen and play around with the features. The addition of visibility classes and the work they've done with accessiblity are great additions as well. Take a look through their docs and see what you find. I think you walk away impressed. There's just so many features and components with ideas that make sense (Interchange is a big one).

Want More Foundation?

Here are some more articles to get you going with Foundation:

您应该使用Foundation 5吗?

Foundation是一个经过测试的坚实框架,在ZURB中具有坚实的后盾,并且会不断创新(无法强调我对他们的Motion UI和新的网格东西有多喜欢)。 语法易于学习和入门。 没有理由不尝试。 只需启动 CodePen试用这些功能即可。 可见性类的添加以及它们在可访问性方面所做的工作也很不错。 查看他们的文档,看看会发现什么。 我想你走开留下深刻的印象。 有如此多的功能和组件带有有意义的想法(互换是一个很大的想法)。

需要更多基金会吗?

这里有一些其他文章可以帮助您开始使用Foundation:

翻译自: https://scotch.io/tutorials/getting-started-with-foundation-5-by-zurb

zurb是什么网站

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值