css - 无论如何不要在 WebStorm 中格式化 CSS 新断线以更好地支持 Flexbox Grid

标签 css intellij-idea flexbox webstorm

有没有办法不格式化 CSS 断行 WebStorm?由于使用 Flex Grid 可以更好地处理多行...

例如,这是我喜欢的保存方式:

@media (max-width: 1200px) {
  .cardInner {
    grid-template-areas:
      "header"
      "sideA"
      "sideB"
      "sideC"
      "sideD" !important;
    grid-template-columns: 99% 1%!important;
    grid-template-rows: repeat(5, 45px) !important;
  }
  .justifyToStart {
    justify-self: normal !important;
  }

  .justifyToEnd {
    justify-self: normal !important;
  }
}

.cardInner {
  display: grid;
  //justify-content: end;
  //justify-items: end;
  grid-template-areas:
    "header header"
    "sideA sideB"
    "sideC sideD";

但是 cont-alt-L 会删除我的网格空间,这是使用 Flex-Grid 在 CSS 中保持事物组织化的便捷方式。

肖恩

最佳答案

你可以在这里使用格式化标记:

  • 设置中 |编辑|代码风格 | Formatter Control,勾选Enable formatter markers in comments复选框

  • 用格式化程序注释包围您的代码:

.grid {
  display: grid;
  /*@formatter:off*/
   grid-template-areas: 
          "header header header"
           "sidebar content right"
           "footer footer footer"
  /*@formatter:on*/
}

我们有一个为网格布局属性提供特殊格式的功能请求,WEB-10013 ;更新请关注

关于css - 无论如何不要在 WebStorm 中格式化 CSS 新断线以更好地支持 Flexbox Grid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58220842/

相关文章:

java - 在 intelliJ IDE 中出现编译器错误

json - IntelliJ IDEA 如何正确地将 $NODE_DEBUG_OPTION 传递给 npm-run-all

html - Flexbox 粘性页脚和溢出的内容区域

css - 将文本旋转 90°,生成的 div 在父级中有位置

asp.net - 评论背景颜色

jquery - jquery ui可调整大小的奇怪错误

html - 将图像按钮粘贴到 iframe 覆盖的右边缘

git - 我需要 Git 才能在 JetBrains IntelliJ IDEA 中使用 Github 吗?

css - Flexbox:保持带换行符的文本水平居中

html - 带有 fullpage.js 的水平滚动条