DEV Community

loading...

HTMLCSS 10 Concept

Ivan Jeremic
Web/Software Developer
・1 min read

Just an idea... One language for Elements/Style/Logic and no XML.

@W3C :D

{
  type: HTMLCSS10
  {
   type: head;
   meta: ....;
   meta: ....;
   use: './main.css'
  },
  {
    type: body;
    children: [
      {
       type: rect;
       width: 500px;
       height: 500px;
       bgColor: rgb(0,0,0,0)
       children: [
        {
          type: button;
          width: 150px;
          height: 30px;
          onClick: () => {
           alert('clicked')
          }
          bgColor: green;
        },
        {
          type: button;
          width: 150px;
          height: 30px;
          onClick: () => {
           alert('cancel')
          }
          bgColor: red;
        }
      ]
    }
   ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Discussion (4)

Collapse
afif profile image
Temani Afif

if you read the history of the Web you will find that everything started with one language and later they decided to split the thing into HTML and CSS for many reasons (I cannot list all of them in the comment section). I doubt getting back to the initial state would be a good idea unless you develop your own language that will compile into HTML and CSS at the end (I am pretty sure there is a lot pseudo-language like this)

Collapse
ivanjeremic profile image
Ivan Jeremic Author

Yes I know that but there is a reason why people have built things like tailwindcss and react in these concepts you can see that a lot of people really like doing layout/style/logic in one place, maybe the split up was a mistake?

Collapse
alohci profile image
Nicholas Stimpson

Both TailwindCSS and React try to solve the do-not-repeat-yourself (DRY) problem in different ways to the non-intrusive separation of concerns solutions provided by vanilla CSS and JS, albeit with differing levels of success. Your idea should consider how to address the same problem.

Thread Thread
ivanjeremic profile image
Ivan Jeremic Author

I'm not a huge fan of separation of concerns, writing UI is one concern and everything needed for that should be in one language this is only my opinion.