3 ms·
I would like to see a version for those of us that structure our documents. What is this structure you speak of? Most people assume HTML has a 'head' and a 'b
by Theodores 8y ago
I would like to see a version for those of us that structure our documents.
What is this structure you speak of?
Most people assume HTML has a 'head' and a 'body'. The head has script and tag things in it, the body is just free-form open-fire zone of content.
But there is more to it than this.
The body should have some structure to it. That means a 'header', a 'main' and a 'footer'. In the 'header' you are going to want a 'nav' and the same for the 'footer', you are going to want a 'nav'. Even if the links are to your social media sites there is still something to go in the respective areas.
Then when it comes to your 'main' content, if you believe in structure, you are wanting to have 'article' or 'section' with a possible 'aside' or two.
Then there are images. Images don't have to be in random 'div' elements. They should be in 'figure' or 'picture' elements.
Anyone who is not writing HTML this way, using the structural elements and structuring their document might as well just be writing in .txt format or posting jpgs of their pages to the internet. You have got to be organised. Ignorance of the HTML elements is not helpful, knowing them is. They shape how you think and how you organise your code.
A default stylesheet for people that write this way - structured - could have many useful touches. So CSS grid for the 'header'/'main'/'footer' could include the best way to ensure a sticky footer with the row definitions and align-self: end for the footer bit.
Images in picture/figure elements could be set to be done properly, if in a containing 'figure' then set to 100% width. If the main has a 'grid' setup then you could easily have well structured HTML show neatly with anything 'not structured' evident because it wouldn't be fitting in the boxes.
Document outline is important and a basic stylesheet needs to do badly at styling things that are not going to outline well. So the headings styles should only apply to headings that are in 'article', 'section' or 'aside' blocks.
There is also a small matter of pixels. When was the last time a pixel meant anything? 2007? Nowadays pixels are virtual. So it really has to be em/rems and viewer units all the way. The pixel is outmoded.
For your forms you want to think differently and more structured. So 'form' needs to be 'display: grid' and then your labels be column 1 with inputs on column 2. Then have a css variable in the responsive media query to set the inputs to column 1 if on mobile. Done this way you can get rid of the hacky margins and paddings on the buttons and just use 'grid gap'.
This means forms can then be a straight list of label/input pairs in well organised structured code that looks fantastic and is fully mobile out the box.
As it is the stylesheet is a good idea but it does not really bring any benefits to structured documents in the post-pixel world where CSS grid does all the heavy lifting of simple layout tasks.
- taspeotis 8y agoTacit [1] does a little bit of this. https://yegor256.github.io/tacit/ https://yegor256.github.io/tacit/
- Theodores 8y agoYes that is what I like to see - no classes! So long as one structures the content then it looks good. Or at least not 'unstyled'. Tacit is behind the times when it comes to CSS Grid, I don't see the point in jiggling with floats, again it is one of those things that constrains how you think. With CSS Grid you can write content in a natural order and then position blocks of it according to design and, with a few CSS variables get it working in all viewports. Interesting that tacit does not show default styles with structural elements. Maybe the HTML5 spec has been worked through rather than the starting point assumed to be structured content. I can remember the days of Microsoft Word when some people would use templates and styles. Some people just did not get it and would make a title a title by hitting the 'bold' button and pushing the font size up, maybe using blank lines for spacing. I feel that the web is full of people who never understood styles in Word and didn't have a clue as to why you might need them.
- vertis 8y agoWhat could have been good feedback is ruined by tone. This is someone who has in good faith decided to show the HN community. The fact that he's 13 doesn't even really enter into it. Here is someone who has created something new and has come to share and the first thing you say is: > I would like to see a version for those of us that structure our documents. > What is this structure you speak of? Let's try: --- I love what you've done. I know that this is still new but I would really love to see some additional support for more structured documents. <Insert more details about what you mean about structure> I will try, if time allows, to create a pull request for these features. ---
- black-tea 8y agoWhat bad tone? Wow, you people are sensitive. I bet the OP will read and learn from that post, as I did, and won't give a hoot about the "tone".