首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角质材料有网格系统吗?

角质材料有网格系统吗?
EN

Stack Overflow用户
提问于 2017-07-26 21:43:56
回答 4查看 21.4K关注 0票数 29

我要开始一个用棱角材料做的项目。它是否有一个本机系统,用于像引导引导一样在响应网格中定位元素?

否则,可以将材料设计和引导结合起来作为网格系统的实践吗?

也许我对这个问题采取了错误的态度。

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2017-07-27 14:11:09

如果使用的是Material2,则可以使用角度Flex布局进行响应。它很好的赞扬了Angular2,并且是轻量级的。

基本上,Material2 +Flex-布局相当于Bootsrap库。

下面是一个关于如何使用弹性布局来使用角度/材料2的网格系统/响应的示例

示例代码显示了使用flex-layout API:

代码语言:javascript
复制
<div fxShow.xs="true" fxShow="false" >Screen size <h1>XS</h1></div>
    <div fxShow.sm="true" fxShow="false" >Screen size <h1>SM</h1></div>
    <div fxShow.md="true" fxShow="false" >Screen size <h1>MD</h1></div>
    <div fxShow.lg="true" fxShow="false" >Screen size <h1>LG</h1></div>
    <div fxShow.xl="true" fxShow="false" >Screen size <h1>XL</h1></div>

    <div fxLayout="row" 
         fxLayout.xs="column"
         fxLayoutGap="10px"
         fxLayoutAlign.xs="center center"
         fxLayoutWrap>
      <div class="sample-div" fxFlexOrder.lt-md="7">Div 1</div>
      <div class="sample-div" fxFlexOrder.lt-md="6">Div 2</div>
      <div class="sample-div" fxFlexOrder.lt-md="5">Div 3</div>
      <div class="sample-div" fxFlexOrder.lt-md="4">Div 4</div>
      <div class="sample-div" fxFlexOrder.lt-md="3">Div 5</div>
      <div class="sample-div" fxFlexOrder.lt-md="2">Div 6</div>
      <div class="sample-div" fxFlexOrder.lt-md="1">Div 7</div>
      <div class="sample-div" fxFlexOrder.lt-md="0">Div 8</div>
    </div>
票数 19
EN

Stack Overflow用户

发布于 2019-01-23 09:25:12

本网站描述如何将引导网格添加到角材料项目:https://www.amadousall.com/the-good-parts-of-bootstrap-4-you-are-missing-in-your-angular-material-projects/

本条所述步骤摘要:

向项目中添加引导程序:

npm安装引导程序--保存

src/styes.scss:

代码语言:javascript
复制
@import '~@angular/material/prebuilt-themes/indigo-pink.css';

@import 'variables';

// Imports functions, variables, and mixins that are needed by other Bootstrap files
@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/mixins';
// Import Reboot
@import '~bootstrap/scss/reboot';
@import '~bootstrap/scss/grid'; // add the grid
@import '~bootstrap/scss/utilities'; // add css utilities

@import 'reset';

src/_variables.scss:

_variables.scss Sass部分允许我们自定义引导-更准确地说,我们将要使用的引导带的部分

代码语言:javascript
复制
$link-color: #3f51b5;
$link-hover-color: currentColor;
$link-hover-decoration: none;

$grid-breakpoints: (
  xs: 0, // handset portrait (small, medium, large) | handset landscape (small)
  sm: 600px, // handset landscape (medium, large) | tablet portrait(small, large)
  md: 960px, //  tablet landscape (small, large)
  lg: 1280px, // laptops and desktops
  xl: 1600px // large desktops
);

$container-max-widths: (
  sm: 600px,
  md: 960px,
  lg: 1280px,
  xl: 1600px
);

src/_reset.scss:

_reset.scss Sass部分允许我们覆盖一些我们不想要的引导样式

代码语言:javascript
复制
* {
  &:active,
  :focus {
    outline: none !important;  // 1
  }
}

label {
  margin-bottom: 0; // 2
}


a:not(.mat-button):not(.mat-raised-button):not(.mat-fab):not(.mat-mini-fab):not([mat-list-item]) {
  color: #3f51b5; // 3
}
票数 15
EN

Stack Overflow用户

发布于 2018-11-12 08:55:28

看起来像角材料(7.0.3)仍然没有像引导一样的固体网格系统,否则他们会把它包括在他们的正式文件

我们仍然需要使用Anuglar的材料,因为更丰富的UI/UX。

解决方案是只从引导中获取网格部件。

样式表bootstrap-grid.css可以像引导文档中提到的那样使用,也可以使用相应的cdn来利用引导提供的网格功能。

票数 13
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45337959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档