- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目前我正在为一些使用 QT(多平台框架)开发的应用程序开发 GUI。 QT 中的 GUI 可以像普通 CSS 一样设置样式。
因此,我将 GUI 开发为一个基本的网络应用程序(HTML5、CSS3 和 JS),并且出于某些原因我使用 LESS 预处理器进行样式设置和创建 OOCSS(面向对象的 CSS)...
由 LESS 生成:
.button {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
}
.button.button-big {
font-size: 20px !important;
width: 200px !important;
}
.button.button-green {
background-color: green !important;
color: white !important;
}
是否有任何工具或任务(grunt/gulp)可以将 OOCSS 转换为老式样式(长版)?
预期结果:
.button {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
}
.button-big {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
font-size: 20px !important;
width: 200px !important;
}
.button-green {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
background-color: green !important;
color: white !important;
}
当然,我必须清理类(class),但该工具可以节省我很多时间。
原因:我的客户在 CSS 方面并不先进。所以,OOCSS 可能对他有点困惑。
感谢您的回复亚当
最佳答案
首先,我认为您正在努力让您的客户尽可能轻松地完成这项工作,这很棒。太好了!
其次,我认为这是您的客户学习 CSS 基础知识的绝佳机会。是的,长版本不使用 OOCSS,但它现在需要管理更多的声明,从长远来看,这可能会更难管理。
话又说回来,你的客户让你帮忙解释事情。这是建立牢固的客户关系和开展良好业务的绝佳机会。
如果您的客户也能学习 LESS 就太好了,但如果他们不能,您可以随时使用 Pleeease .它完成了我们喜欢的预处理器的所有工作,但使用了 vanilla css。
祝你好运!保持真棒!
关于css - OOCSS 到 Long CSS 生成器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32291716/
等等 OOCSS , 他们概述了他们的网格版本。我不明白到底发生了什么。我知道它应该解释导致最后一个元素落到下一行的流体布局的舍入错误。每条规则对此有何帮助? 我的 OOCSS last-child
我相信使用 Nicole Sullivan 的 Object-Oriented CSS 的好处哲学/编码方法/等等。特别是,我热衷于在我目前正在构建的站点中使用诸如“media block”之类的原则
在我问问题之前,这是我指的代码: 盒子对象 用于在 Bootstrap 中将 Island 或 Islet 等内容框起来。 .box { margin-bottom: 24px; padding: 1
我的问题不同于 this one ,但它是关于相同的原则,所以这句话在这里也相关: 来自 https://github.com/stubbornella/oocss/wiki Essentially,
这些天我正在学习更多关于 OOCSS 的知识,但我并不完全了解如何编写代码以允许扩展 CSS 对象。 假设我有一个名为 icon-text 的 CSS 对象,它使图标与文本对齐。 HTML
我正在阅读 Nicole Sullivan关于 Object-Oriented CSS 的理论.简而言之,基本思想是,与其每次设计网站样式时都从头开始,不如使用一些已经编写好的基本构建 block 作
通常我在我的元素中使用 LESS 但现在我尝试使用 SASS。 在 LESS 中我做这样的事情 .module { background-color: blue; &-title {
目前我正在为一些使用 QT(多平台框架)开发的应用程序开发 GUI。 QT 中的 GUI 可以像普通 CSS 一样设置样式。 因此,我将 GUI 开发为一个基本的网络应用程序(HTML5、CSS3 和
我知道这是在要求一个非常自以为是的答案,我想所有与命名约定相关的问题也是如此。 我正在使用 Harry Roberts BEMIT naming convention ,它使用面向对象的 css 的前
我刚刚开始了解 OOCSS 方法。因为我认为这让一切都更容易理解,所以我也在尝试使用 BEM 命名约定。 使用这个原则,我正在尝试为主页创建一个导航——基本上只是一个内联列表。由于 OOCSS 是关于
我知道 SASS/SCSS 并且我知道什么是面向对象,但我可以说 SASS 是一种使 CSS 面向对象的方法吗?如果我错了,请纠正我。 最佳答案 这是一个有趣的问题,因为 SASS/SCSS 并不能完
所以我对 OOCSS 有疑问。它应该更便携,但与我通常做事的方式相比,我发现它不那么便携。 我的例子: 我有一个小部件推荐。在主要内容正文(具有白色背景)中,推荐使用黑色字体。但在页脚(具有蓝色背景)
我正在创建受 ITCSS、BEM 和 OOCSS 启发的样式表,但不确定如何将结构属性与装饰属性分开。 我理解 ITCSS 和 OOCSS 的一个例子: //First the structure.
我今天正在阅读关于 OOCSS 的内容这表示使用该方法有两个好处 更短的 CSS = 更好的性能 更好的可维护性 我同意第二点,但第一个好处是通过向 html 添加更多类来缩短 css,这增加了可重用
在我的 CSS 文件中,作为“重置”的一部分,我将所有链接设置为如下样式: a { color: blue; &:visited { color: violet; } &:ho
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 8 年前。 Improve
我是一名优秀的程序员,十分优秀!