Skip to content

[CSS-SELECTORS-4]#defines - like in programming language #2298

@Nadya678

Description

@Nadya678

I propose add to CSS specification "defines" known from pascal or C++.

I propose:

for selectors:

@define selector textish 
{
   input[type="text"], input[type="mail"], input[type="url"]
}

usage in code:
body>$textish will be equivalent of:
body>input[type="text"], body>input[type="mail"], body>input[type="url"]

$textish.mainform will be equivalent of:
input[type="text"].mainform, input[type="mail"].mainform, input[type="url"].mainform

for properties:

@define block framed
{
   border: 2rem solid #000;
   border-radius:10rem; 
}

usage:

body>ul
{
   block: framed;
   background: white;
}

will be equivalent:

body>ul
{
   border: 2rem solid #000;
   border-radius:10rem; 
   background: white;
}

What do you think about this proposal? Is it possible to add this or similar solution to selectors level 4?

It is my proposal for innovation in CSS (for people that use SCSS an SASS) and for needs of developers to write less code like here #2296

I think that creation more specific pseudoclasses is no innovation and it make the solution less flexible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions