- 浏览: 849639 次
- 性别:
- 来自: lanzhou
文章分类
最新评论
-
liu346435400:
楼主讲了实话啊,中国程序员的现状,也是只见中国程序员拼死拼活的 ...
中国的程序员为什么这么辛苦 -
qw8226718:
国内ASP.NET下功能比较完善,优化比较好的Spacebui ...
国内外开源sns源码大全 -
dotjar:
敢问兰州的大哥,Prism 现在在12.04LTS上可用么?我 ...
最佳 Ubuntu 下 WebQQ 聊天体验 -
coralsea:
兄弟,卫星通信不是这么简单的,单向接收卫星广播信号不需要太大的 ...
Google 上网 -
txin0814:
我成功安装chrome frame后 在IE地址栏前加上cf: ...
IE中使用Google Chrome Frame运行HTML 5
I’ve seen a number of comments on blogs and twitter that amount to “You don’t need a new stylesheet syntax, CSS is simple and you’re a moron if you can’t do it.” I agree, CSS is simple. You assign style primitives to elements and some of those primitives cascade down to the elements contained within. I get it. It’s simple to understand. But CSS is not simple to use or maintain. It’s time for stylesheets to evolve so that we can take web design to the next level. Over the past few years the development of JavaScript frameworks have brought sanity to coding against the DOM – optimizing common coding tasks through the creation of abstractions than insulate us from the nitty-gritty details and providing a common platform for third-party libraries to rely on. As a result, it’s a very nice time to be a front-end programmer. It’s been a couple of years since I’ve bitched about DOM incompatibilities – long enough to almost forget how much work it used to be. It’s also a very nice time to be a user of the web, freed of the need to fuss with DOM primitives and JavaScript intricacies, developers have turned their spare time into much more sophisticated user interfaces. Creating and maintaining the styles of a website, by comparison, is a total pain in the ass. I’m not talking about the lack of a decent layout module for CSS. I’m talking about the fact that CSS lacks the expressive nature required to create abstractions. The simplicity of the CSS syntax creates complexity for the developer. Every time you have to copy and paste something within your stylesheet instead of reference that same information, you’ve missed an opportunity to make your stylesheets easier to maintain through abstraction. However, if you’ve ever tried to build a DRY stylesheet, you’ve found that the only tool at your disposal is the “class” construct. So the DRYest stylesheet will necessarily force you to put all kinds of presentation classes in your markup, thus making your website less maintainable. Case in point: Shared html partials & includes may need to be styled differently in different contexts. Let’s be frank, your designs are going to change. New features will be added that make you reevaluate things. You’ll decide you hate some color or font treatment. Your HTML is going to change. New browsers are going to come out with new quirks. Any every time something changes, you have to propagate that change across your stylesheets. If you’re lucky, you can search and replace for the change. But what if you want to change the color CSS is the weakest link in the web developers toolbox. The problem goes deeper than CSS’s lack of variables. Unlike the “function” in programming, CSS has no fundamental building block. Abstraction is the ability to define a new concept in terms of other, more simple concepts. It’s nothing to be scared of. When you define a CSS class, you are creating an abstraction. Despite what the name implies, abstractions don’t make things harder to understand – quite the opposite in fact. Just because a website is digital, doesn’t mean it is intangible. It is a real thing that users can see and interact with. And although there’s a lot of code sitting behind a web page to make it work, it is the act of designing that makes a website concrete. It is the designer’s job to build real objects that users intuitively understand. Search boxes, articles, advertisements, navigation, and so on. But the browser doesn’t know what these things are. The browser only understands primitives like font-size, border, padding, images, tags, etc. So it is the designer’s job to transform the primitive design concepts that a browser understands into real things. This is done by defining new abstractions that never existed before. They are not abstract to us, rather they are abstract to the browser. So when a language gives you the power of abstraction, it gives you the power to build real things. And that is your job. And that is why you should care about, nay, demand a stylesheet syntax that gives you the power of abstraction. No finished product of sufficient complexity is built without first creating intermediate parts. Let’s consider an automobile for example. There are belts, wires, alternators, gears, etc. When a car maker wants to build a car, they don’t build belts and gears. They specify what kind of belts and gears they need and they get them from a third party. No one would think less of BMW for doing so. We have the same in web design. Grids, buttons, tabs, menus, font rhythm, etc are all considered standard elements for a website. But for the most part, we don’t get their implementation from a third party. When we do, it’s generally viewed with disdain. I think this is unacceptable. Once certain design elements become commodity, there is no reason for you to waste your time building them anymore. You should focus your time on the unique aspects of your design. Unfortunately, with CSS it’s hard to compose a design from third-party parts. They are hard to customize and once customized, hard to upgrade if there are bugs that need to be fixed. Clearly there must be a better way.#000
to #333
? You can’t search and replace for #000
. First, you could have usedblack
or #000000
or rgb(0,0,0)
. Second, it’s likely that black is used for other things than what is changing. But what if you had named that color? Now that black is different from all the other blacks. It’s now the “article font color” and changing that abstraction can be done once and propagated for you by a smarter stylesheet syntax.
What Is Abstraction?
Why You Should Care About Demand Abstraction
Parts is Parts
发表评论
-
[图解]搞笑漫画图解几大浏览器的区别
2010-03-20 08:48 1331[图解]搞笑漫画图解几大浏览器的区别 ... -
Web 设计与开发终极资源大全
2010-03-20 08:41 1639Web 技术突飞猛进,Web 设计与开发者们可以选择的工具越来 ... -
超炫jQuery 运动特效展示
2010-03-08 10:30 19361. 流感导航菜单 下面 ... -
Apple removes over 5000 apps from iPhone app store
2010-02-23 08:04 924Apple is causing a stir in the ... -
RIP Google Gears
2010-02-22 07:56 780Back in December, we discussed ... -
美报称谷歌遭攻击源自中国两学校 校方否认
2010-02-20 08:04 640环球网2月19日消息 谷歌近期受到黑客攻击,美国媒体报道说,源 ... -
互联网现状(图片)
2010-02-18 08:34 873如图: -
下一个Twitter?
2010-02-18 08:21 1098也许很多人还不知道, ... -
北京电信推3G宽带新套装
2010-02-08 08:58 832中国电信北京公司(以下简称北京电信)近日宣布,已于2月1日全新 ... -
网友声音:我讨厌Chrome OS的五大理由
2010-01-18 14:55 1781自从Google公布Chrome OS的第一条信息,关于它的讨 ... -
Microsoft should follow Google and drop censorship in China
2010-01-14 09:10 879Kudos to Google for finally sta ... -
Gmail全面升级为https数据加密型邮箱服务
2010-01-14 09:04 964谷歌邮件服务Gmail的博客又发了新帖。该博客表示在2008的 ... -
Google 在首页号召大家帮助海地地震的幸存者
2010-01-14 09:01 734Google在海地发生7级地震后,迅速做出反应, 在英文首页 ... -
百度主页被黑11小时 黑客反击多家伊朗网站被黑
2010-01-14 08:44 980“伊朗网军”攻击说引质疑 从1月12日早上7点半开 ... -
看看老外是怎么评价操作系统的!
2009-12-20 11:29 903def this_is_really_funny ... -
Google推免费公共DNS服务 OpenDNS反击
2009-12-10 11:22 1095上周五Google宣布向所有的互联网用户提供一组快速,安全 ... -
BT网站被关后 最大电驴下载网陷“故障门”
2009-12-10 11:14 1393因没有获取广电总局颁发的《信息网络传播视听节目许可证》,BT ... -
电驴瘫痪网友纷纷“哀悼” 官网称线路故障10日恢复
2009-12-10 04:00 992针对P2P资源分享网站Very ... -
VeryCD网站无法正常访问 或遭广电总局关闭
2009-12-09 15:18 73912月9日下午消息,多名网友向腾讯科技反映,就在昨天还可以 ... -
外刊:投资暴雪股票十大理由
2009-11-22 05:41 849投资月刊《SINLetter》编 ...
相关推荐
StyleSheet、StyleSheet
**Qt5 样式表(Qt5 StyleSheet)详解** 在Qt框架中,样式表(StyleSheet)是一种强大的工具,用于自定义应用程序的外观和感觉。它类似于网页开发中的CSS(层叠样式表),允许开发者通过简单的语句来改变控件的视觉...
Qt 中使用 StyleSheet 实现控件外观自定义 Qt 是一个功能强大且灵活的 GUI 库,提供了丰富的样式表机制,允许开发者轻松地自定义控件的外观。通过使用 Qt StyleSheet,可以轻松地改变大部分默认控件的外观,从而...
在这样的背景下,"css转stylesheet插件,适用于鸿蒙、RN.zip" 提供了一个解决方案,帮助开发者更高效地在鸿蒙系统和React Native(RN)中应用CSS样式。 首先,我们要理解CSS(Cascading Style Sheets)在Web开发中...
安装WINCC勾选消息队列时需要安装的系统组件,下载下来和大家分享。
在"stylesheet.zip"这个压缩包中,包含了一个关于QSS界面美化的实例,这对于想要提升自己程序界面美观度的学习者来说是一个很好的起点。 QSS允许开发者用类似CSS的语法定义Qt控件的外观和布局,如颜色、字体、边框...
在Qt5环境中,`Qt5stylesheet`是一个强大的特性,它允许开发者通过CSS样式的语法来定制应用程序的界面外观。这使得Qt应用的界面设计变得更加灵活和多样化,可以轻松实现窗口背景色、控件背景色以及其他视觉元素的...
Qt样式表(StyleSheet)是Qt中的一个重要概念,类似于网页设计中CSS的作用,允许开发者通过声明式的方法来控制Qt应用程序中控件的样式。Qt样式表的使用能够大大提高界面的可定制性,而且有助于保持代码的清晰和组织...
Qt Stylesheet是Qt框架中一个强大的特性,它允许开发者通过CSS样式语法来定制Qt应用程序的外观和感觉。这篇详尽的介绍将深入探讨Qt Stylesheet的相关知识点,帮助新学习者快速掌握这一技能。 首先,Qt Stylesheet...
QT界面开发 样式挑战
bower install stylesheet --save-dev使用范例 var stylesheet = new StyleSheet ( ) ;// Specify the selector to work on.stylesheet . setSelector ( '.pause-hud' ) ;// Insert rules.stylesheet . insertRule ...
如果对这个默认样式不满意最简单的解决办法就是重新设置该样式的属性,因为user agent stylesheet优先级很低,会被覆盖,这样就不会影响到我们的样式了,比如这里我就讲form 的margin-bottom设为0px。 User Agent ...
react-native-extended-stylesheet, 用于本机响应的扩展样式表 本地扩展样式表 在替换的过程中,使用媒体查询,变量,动态主题,单位,百分比,算术操作,比例和其他样式元素来调整本地样式表。 演示工具安装工具...
标题中的“Stylesheet Count-crx插件”是指一种专门针对浏览器的扩展程序,其主要功能是统计并显示当前浏览页面中包含的样式表(CSS)数量。这种插件通常适用于前端开发者、网页设计师或者对网页性能有特殊关注的...
克隆存储库以获取文件和配置,在终端上输入 git git clone git@github.org:hackathongi/2015-stylesheet.git ,或使用您喜欢的 GIT 工具或 IDE。 或者,如果您必须使用样式表或脚本对前端文件做出贡献,则需要一些...
jQuery StyleSheet jQuery.stylesheet插件允许您动态添加,删除和更改CSS规则。 将更改应用于CSS规则比遍历匹配元素并对每个元素应用相同的更改更为有效,尤其是在元素很多或更改触发多次昂贵的绘制操作的情况下。 ...
在JavaScript中,改变样式表(Stylesheet)是前端开发中常见的任务,这涉及到动态更新页面的外观和布局。本教程将深入探讨如何在JavaScript中操作CSS样式表,以实现动态效果,尤其关注游戏场景中的应用。 首先,...
React本机扩展StyleSheet 用媒体查询,变量,动态主题,相对单位,百分比,数学运算,缩放和其他样式化内容直接替换 。 演示版 可以在浏览器或使用此与Extended StyleSheets一起玩。 安装 npm i react-native-...
在上述示例中,`<link rel="stylesheet" type="text/css" href="theme.css" />` 这行代码就是在文档头部引入了一个名为 "theme.css" 的外部 CSS 文件,这样,CSS 文件中的样式规则就会应用到整个 HTML 页面,从而...