抽象远离CSS [英] Abstraction away from CSS

查看:196
本文介绍了抽象远离CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我说清楚一些。

我。 憎恨。 CSS。

这是一个永无止境的噩梦。每一个小的布局变化感觉像一个黑客。问题的解决方案似乎经常涉及到像一些厨师想准确地计算出多少肉豆蔻放入他即将成名的大米布丁的数字。然后是多个浏览器问题,多个解决问题..

It is a never-ending nightmare. Every minor layout change feels like a hack. Solutions to problems seem to often involve jiggering numbers around like some chef trying to work out exactly how much nutmeg to put in his soon-to-be famous rice pudding. Then comes the multiple browser issue, the multiple resolution issues..

..以削减一个长的故事短,这是一个痛苦。 PITA,如果愿意。

.. to cut a long story short, it's a pain. A PITA, if you will.

许多框架试图从HTML(自定义标签,JSF组件系统)中抽象出来,以便处理那个特定的水壶更容易。

Many frameworks seek to abstract away from HTML (custom tags, JSFs component system) in an effort to make dealing with that particular kettle of fish easier.

你们有什么你已经使用的有类似的概念应用于CSS?为你做一堆跨浏览器的魔法,支持像变量(为什么我必须键入#3c5c8d每次我想要的颜色),支持caclulated字段(它们被编译成CSS和JS)等。

Is there anything you folks have used that has a similar concept applied to CSS? Something that does a bunch of cross-browser magic for you, supports like variables (why do I have to type #3c5c8d every time I want that colour), supports caclulated fields (which are 'compiled' into CSS and JS), etc.

或者,我甚至可以正确地考虑这个问题吗?我试图通过一个非常圆的洞推一个很正方形的块?

Alternatively, am I even thinking about this correctly? Am I trying to push a very square block through a very round hole?

推荐答案

您可以随时使用模板引擎将变量和计算字段添加到CSS文件。

You can always use a template engine to add variables and caclulated fields to your CSS files.

这篇关于抽象远离CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆