Git Product home page Git Product logo

Comments (8)

stubbornella avatar stubbornella commented on August 17, 2024

Nope, that's something I'm working on which will eventually have support either via browser vendors/w3c or preprocessing.

from oocss.

JimmyVolatile avatar JimmyVolatile commented on August 17, 2024

Ok. Thanks for quenching my curiosity.

IMHO this is certainly worth mentioning in your FAQ to prevent any confusion. Or, at least as a comment in the CSS-file right after the selector containing the extends-rule. Maybe: "/* 'extends:' is a possible future CSS feature */" or something of a similar meaning.

Do you have a draft or suggestion for its rule definition the same way W3C has?

/Jimmy

from oocss.

anthonyshort avatar anthonyshort commented on August 17, 2024

Thought I'd mention I've added this ability, using this syntax, to my CSS preprocessor - http://github.com/anthonyshort/csscaffold/tree/master

It allows one selector to take on all the properties of another selector in all instances.

from oocss.

martinklepsch avatar martinklepsch commented on August 17, 2024

@anthonyshort the rendered result would be the same but the problem is that your preprocessor creates (x * y - x) lines/rules of overhead when
x = number of lines/rules the definition has you want to include with 'extend:'
y = number how often you use 'extend:'

to be correct you have to add y rules/lines in the end because 'extend:' is one too.

from oocss.

anthonyshort avatar anthonyshort commented on August 17, 2024

The overhead is very little, as it compresses/optimizes the css at the end, so duplicate selectors, like what could be created with 'extends', would be merged. For the selectors it can't merge, gzipping should take care of the rest of the overhead.

from oocss.

martinklepsch avatar martinklepsch commented on August 17, 2024

but you dont have duplicate selectors... you have duplicate properties or? (im not quite sure how you implemented that)
the only style of writing css that could remove duplicate properties is the one-property-per-line style as google uses it.

from oocss.

stubbornella avatar stubbornella commented on August 17, 2024

@mklappstuhl I've written up how I think this should work here: http://www.slideshare.net/stubbornella/css-wish-list

@anthonyshort Ideally this would be in the browser, a significant portion of users have gzip disabled (often due to antivirus software), so relying on compression isn't enough.

In a preprocessor, extends adds a new selector string at the same place in the code as the rule being extended. This means you can make use of CSS built in comma delimited selector string to share rulesets. Only a small portion of the code is duplicated.

from oocss.

stubbornella avatar stubbornella commented on August 17, 2024

Closing this as I've removed that bit of code, we can move any discussion to the google group going forward.

from oocss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.