Better than CSS : what is the root limitation of CSS and how we can build better alternatives?
-
It's often frustrating to see CSS fails even on the simplest and most intuitive layout, for example, like http://css-tricks.com/float-center/ Which makes me wonder, what's wrong with current CSS? Are there anything foundamentally clumsy by design in CSS? If we were about to create something as a whole new layout DSL for interactive digital zines, highly dynamic content for all screen sizes and orientations, and native widgets for OS, what would it be like?
-
Answer:
One of the non-optimal features of CSS is that it controls both the arrangement of elements and they way they're styled. It's totally fine for setting things like font color and borders and all that, but let's be honest: For a system that was supposed to replace layout tables, CSS2 is remarkably bad at actually replicating what layout tables let us do. Instead of creating grids and gutters and snapping elements into place, we have this awkward combination of floats and margins, pixel- and percentage-based units we can't combine[1], and absolute/relative/absolute-but-relative positioning that do counterintuitive things even when browser bugs don't break them. If you look at what the major CSS frameworks do, it's never about making it easier to make things look good[2]รขit's about increasing productivity and solving layout problems that wouldn't exist if there were a grid system built in. It might help to separate the functions of CSS into two domains: A true styling language that sets fonts, colors, backgrounds, and so on A layout language that specifies where elements go and how the the page flows, preferably with a grid system (which CSS3 has) That seems to be the solution designers want, and it's the one they've already come up with while we wait for CSS3 to be widely deployed. Just adding a grid layout mechanism on its own might work well enough, but realistically it'll be years until it's actually implemented widely. Given that lag, I think the W3 might as well take the opportunity to deprecate most of the awkward layout features we have or shunt them into a separate sub-language where they can't interfere with grid features as the one way to do things. (I'm not saying there's no use for floats and positioning in CSS with a grid system, but they should never be allowed to mess with the layout of grid-positioned blocks.) ---- [1] There's no such thing as width: 50% + 2px. [2] Except maybe normalizing features that aren't quite cross-browser.
Bulat Bochkariov at Quora Visit the source
Other answers
I know that AXRproject tried providing an alternative to HTML&CSS, but it's deserted now, sadly... the last update was in January 2014... http://axrproject.org/ I, for one, would have used it, if it had a browser plugin for any browser, but it started focused on software development, having the web development on the second place. This is, I think, why it failed so hard. I think that would make the webdesign process simpler and more intuitive. Mostly if we add JS and a server-side language (php, for example). You can see here, a few examples of how the final product could be used, and I have to say that I like what they tried to do. Tutorials/Examples: http://axrproject.org/resources/tutorials/introduction, http://axrproject.org/resources/tutorials/the-basics, http://axrproject.org/resources/tutorials/a-fancy-button Also, for some reason, my answer auto-collapsed, so if noone upvotes it, it will forever be hidden!
Sapioit Deicider
Although I think Bulat has provided an outstanding answer I would add that the syntax to CSS could do with improving. Something along the lines of lessCSS that allows the creation of variables and nested statements would improve the writing (and reading) of the language and could reduce the amount of code required by reducing repeat statements. Nesting also makes sense as it related directly to the objects we are styling
Callum Rexter
I'm also in the camp that believes that the CSS box model has some fundamental flaws. The Flexible Box Model, if it ever becomes widespread, goes a long way towards addressing at least the layout part of the problem.
Brian Locicero
Related Q & A:
- What is TSN number in free lotto, and how i can find this number?Best solution by Yahoo! Answers
- How to you build a rail that you can grind with a snowboard?Best solution by Yahoo! Answers
- How can I better advertise my art?Best solution by Yahoo! Answers
- What are better alternatives than advertising with Google Adwords?Best solution by Yahoo! Answers
- What are attap houses? How do they build attap houses?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.