您的位置:首页 > Web前端 > BootStrap

Susy与Bootstrap提供的网格系统有何不同

2020-08-06 12:53 1031 查看

Comparison of Susy and Bootstrap. Susy and Bootstrap comparison. Ever since the inception of grid system layouts, they are widely used in website designs to arrange graphical elements like images and text. With the rising popularity of grid layouts, there are myriads of grid frameworks available in the market today. One of the most popular frameworks – Bootstrap, offers brilliant features and functions that have made web designing a breeze. It supports both fixed grid and responsive grid to display the content. Susy is another framework that augments grid layout building.

Susy和Bootstrap的比较。 Susy和Bootstrap比较。 自从网格系统布局问世以来,它们就广泛用于网站设计中,以排列图像和文本等图形元素。 随着网格布局的日益普及,当今市场上有无数的网格框架可用。 最受欢迎的框架之一– Bootstrap,提供了出色的功能,使网页设计变得轻而易举。 它支持固定网格和响应网格来显示内容。 Susy是另一个增加网格布局构建的框架。

Let’s explore the two frameworks Bootstrap and Susy and understand the difference between them.

让我们探索Bootstrap和Susy这两个框架,并了解它们之间的区别。

引导程序–前言 (Bootstrap – A Foreword)

Bootstrap is a full fledged framework that embraces highly resourceful tools. It not only offers a grid system, but also facilitates one to style the web elements like icons, navigation, alerts, etc., in a desired fashion. Moreover, it also includes jQuery plugins that can be implemented to design even complex UI elements like carousels.

Bootstrap是一个成熟的框架,包含资源丰富的工具。 它不仅提供了一种网格系统,而且还方便了人们以所需的方式对Web元素(如图标,导航,警报等)进行样式设置。 此外,它还包括jQuery插件,可以实现这些插件来设计甚至复杂的UI元素(例如轮播)。

Susy –前言 (Susy – A Foreword)

The traditional grid system is rigid in nature and not appropriate in the age of agile development and great customization. Susy framework offers tools to support asymmetric grid system that users can proficiently use to tailor the grid as per their needs and create a desired layout with a breeze.

传统的网格系统本质上是僵化的,不适用于敏捷开发和高度定制的时代。 Susy框架提供了支持非对称网格系统的工具,用户可以根据需要灵活地定制网格,并轻松创建所需的布局。

Susy framework, thus, gives a great control to web designers to efficiently create a personalized grid to meet their site’s requirements.

因此,Susy框架可以很好地控制Web设计人员,以有效地创建个性化的网格来满足其站点的要求。

While Susy is a asymmetric grid framework, Bootstrap is a complete framework that supports the entire website design. Thus, fundamentally, it is illogical to compare them. However, it will be interesting to delve deep into these frameworks and determine how the bootstrap’s grid system is different from Susy.

Susy是一个不对称的网格框架,而Bootstrap是一个支持整个网站设计的完整框架。 因此,从根本上来说,将它们进行比较是不合逻辑的。 但是,深入研究这些框架并确定引导程序的网格系统与Susy有何不同将很有趣。

Susy和Bootstrap网格系统比较 (Comparing Susy And Bootstrap Grid System)

To compare these two grid frameworks, I will take a few grid design aspects into account. Let’s begin.

为了比较这两个网格框架,我将考虑一些网格设计方面的内容。 让我们开始。

1.多个断点支持 (1. Multiple Breakpoints Support)

With the Bootstrap grid system, you can handle up to four breakpoints for your grid, and these are written in the Bootstrap classes.

使用Bootstrap网格系统,您最多可以为网格处理四个断点,这些断点是在Bootstrap类中编写的。

Let’s create a grid design for smaller a viewport (that is less than 991 pixels) with half of the screen displaying .content and rest half is for the .sidebar. For this design, the HTML will include multiple breakpoint arguments.

让我们为较小的视口(小于991像素)创建一个网格设计,其中一半的屏幕显示.content,另一半用于.sidebar。 对于此设计,HTML将包含多个断点参数。

Code Snippet of HTML while using the Bootstrap Grid System:

使用Bootstrap网格系统时HTML的代码片段:

<div class="container-fluid">
<div class="row">
<div class="col-sm-8 col-md-9 content"><h2>Content</h2></div>
<div class="col-sm-4 col-md-3 sidebar"><h2>Sidebar</h2></div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-8 col-md-9 content"><h2>Content</h2></div>
<div class="col-sm-4 col-md-3 sidebar"><h2>Sidebar</h2></div>
</div>
</div>
[/code]

While for creating the same design in Susy, we need to make appropriate changes in the CSS file rather than the HTML file. Therefore, nothing is needed to be added in the HTML file while working with the Susy framework.

在Susy中创建相同设计时,我们需要在CSS文件而不是HTML文件中进行适当的更改。 因此,使用Susy框架时,无需在HTML文件中添加任何内容。

Code Snippet of HTML while using Susy:

使用Susy时HTML代码段:

<div class="wrap">
<div class="content"><h2>Content</h2></div>
<div class="sidebar"><h2>Sidebar</h2></div>
</div>
<div class="wrap">
<div class="content"><h2>Content</h2></div>
<div class="sidebar"><h2>Sidebar</h2></div>
</div>
[/code]

However, the breakpoints are required to be included in the Sass file. Here you may choose to start with a mobile-first approach. For this, you just need to allot half of the screen to both .content and .sidebar. And, when the screen size increases 980 pixels, you can make the .content to occupy nine columns and .sidebar to occupy three columns.

但是,断点必须包含在Sass文件中。 在这里,您可以选择从移动优先的方法开始。 为此,您只需要将屏幕的一半分配给.content和.sidebar。 并且,当屏幕尺寸增加980像素时,您可以使.content占据9列,使.sidebar占据3列。

.content {
@include span(12 of 12);
@media (min-width: 768px) {
@include span(8 of 12);
}
@media (min-width: 980px) {
@include span(9 of 12);
}
}
.sidebar {
@include span(12 of 12);
@media (min-width: 768px) {
@include span(4 of 12);
}
@media (min-width: 980px) {
@include span(3 of 12);
}
}
.content {
@include span(12 of 12);
@media (min-width: 768px) {
@include span(8 of 12);
}
@media (min-width: 980px) {
@include span(9 of 12);
}
}
.sidebar {
@include span(12 of 12);
@media (min-width: 768px) {
@include span(4 of 12);
}
@media (min-width: 980px) {
@include span(3 of 12);
}
}
[/code]

Unlike Bootstrap that demands a lot of precision while working with breakpoints (specified via peculiar acronyms) in the HTML classes, Susy framework has not much to do with HTML for defining breakpoints, as they are defined in Sass file. Thus, only the stylesheet is required to be managed carefully. Therefore, Susy facilitates secure decoupling of HTML and CSS, which is paramount for any consequential website.

与Bootstrap在处理HTML类中的断点(通过特殊的首字母缩写指定)时需要很高的精度不同,Susy框架与用于定义断点HTML无关,因为它们在Sass文件中定义。 因此,只需要仔细管理样式表。 因此,Susy促进了HTML和CSS的安全解耦,这对于任何相应的网站都是至关重要的。

2.语言 (2. Language)

It is imperative to have your hands on the featured preprocessor languages of the framework, as it helps one to streamline his workflow and accomplish the task with ease.

必须先使用框架的精选预处理器语言,因为它有助于简化工作流程并轻松完成任务。

If we consider the recent version of Susy, that is Susy 2.2.3, it works with Sass 3.3 or higher versions. This is because it needs to implement Sass maps. And, it doesn’t support Less.

如果我们考虑Susy的最新版本,即Susy 2.2.3,则可与Sass 3.3或更高版本一起使用。 这是因为它需要实现Sass映射。 而且,它不支持Less。

On the contrary, Bootstrap support both Sass and Less. Therefore, you can easily work on Bootstrap, without getting restricted by the preprocessor language.

相反,Bootstrap同时支持Sass和Less。 因此,您可以轻松地在Bootstrap上工作,而不受预处理器语言的限制。

3.定制支持 (3. Customization Support)

Susy offers a great flexibility to designers by letting them customize the grid in a desired fashion. Whether one wants to personalize the number of columns, each column size, gutter size, number of breakpoints, size of breakpoints, and so forth.

Susy通过让设计师以所需的方式自定义网格,为设计师提供了极大的灵活性。 是否要个性化列数,每列大小,装订线大小,断点数,断点大小等。

Whereas, the Bootstrap grid system is not as flexible as Susy. Although it offers grid customization, it also employs certain limitations. With Bootstrap framework, you can change the number of columns, size of 4 breakpoints and gutter size. And, these changes can be made via the customize tab or by amending the variables with desired values in the _variables partial within your preprocessor (Less or Sass whichever you are using).

而Bootstrap网格系统不如Susy灵活。 尽管它提供了网格自定义功能,但它也具有某些限制。 使用Bootstrap框架,您可以更改列数,4个断点的大小和装订线大小。 而且,可以通过“定制”选项卡或通过在预处理器中的_variables部分中用所需值修改变量(使用的是Less或Sass)来进行这些更改。

4.处理列数 (4. Manipulating the number of columns)

Although there are default settings included in Susy, you can modify them in an appropriate manner to create a requisite grid. However, its default settings are perfect to get started, but you will still need to update three of its properties, including columns, container and global-box-sizing, within the $susy map.

尽管Susy中包含默认设置,但您可以以适当的方式修改它们以创建必需的网格。 但是,它的默认设置非常适合上手,但是您仍然需要在$ susy映射中更新其三个属性,包括列,容器和global-box-sizing。

Code Snippet of CSS for Susy – to create a grid:

SusyCSS代码段–创建网格:

@import "susy"
/* Changing the default settings*/
$susy: (
/* Assigning value to the column property */
columns: 12,
/* Assigning max-width for the container */
container: 980,
/* for using the border-box */
global-box-sizing: border-box
);
/* To make border-box property*/
@include border-box-sizing;
.wrap {
@include container;
}
.content {
@include span(9 of 12);
}
.sidebar {
@include span(3 of 12);
}
@import "susy"
/* Changing the default settings*/
$susy: (
/* Assigning value to the column property */
columns: 12,
/* Assigning max-width for the container */
container: 980,
/* for using the border-box */
global-box-sizing: border-box
);
/* To make border-box property*/
@include border-box-sizing;
.wrap {
@include container;
}
.content {
@include span(9 of 12);
}
.sidebar {
@include span(3 of 12);
}
[/code]

By updating the properties with the suitable values and defining the content and sidebar in terms of columns, (unlike Bootstrap Grid system) Susy will automatically calculate the corresponding percentages and pixels required for the defined layout. Thus, you don’t need to spend time in doing these calculations on your own.

通过使用适当的值更新属性并根据列定义内容和侧边栏(与Bootstrap网格系统不同),Susy将自动计算已定义布局所需的相应百分比和像素。 因此,您无需花费时间自行进行这些计算。

Moreover, you are not bound to adhere stringent rules while working with Susy while increasing or decreasing the number of columns. On the contrary, it is not that easy to change the number of columns in the Bootstrap Grid System, without impacting the rest of the grid layout.

此外,在增加或减少列数的同时与Susy合作时,您不必遵守严格的规则。 相反,在不影响其余网格布局的情况下,更改Bootstrap网格系统中的列数并不容易。

These are a few of the differences between Bootstrap Grid System and Susy. With these differences, it can be concluded that though Susy is not as popular as Bootstrap framework, but it offers a great flexibility and remarkable performance to web designers for creating grid layouts. However, there are also certain limitations like preprocessor language, that can’t be ignored. To end, it is completely an individual’s choice to choose Susy or Bootstrap.

这些是Bootstrap Grid System和Susy之间的一些区别。 鉴于这些差异,可以得出结论,尽管Susy不如Bootstrap框架流行,但是它为Web设计人员创建网格布局提供了极大的灵活性和出色的性能。 但是,还有一些不可忽视的限制,例如预处理器语言。 最后,选择Susy或Bootstrap完全是个人的选择。

翻译自: https://www.script-tutorials.com/susy-vs-bootstrap/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: