45 ms·
So a brief history: - <i> makes text italic - no, presentational elements are bad, use <em> instead - okay, fine, you’re all still using “i” so we’ll put it
by notatoad 4y ago
So a brief history:
- <i> makes text italic
- no, presentational elements are bad, use <em> instead
- okay, fine, you’re all still using “i” so we’ll put it back in the standard
- here’s a convoluted meaning to pretend that it’s in the standard for some reason other than “we tried to remove it and failed”
- sph 4y agoYou skipped "fuck semantic HTML and CSS, we use Tailwind now." <i> as italic was great like Tailwind is great: sometimes I just want to design something basic without having to context switch to CSS. I want italic, I use the <i> tag. What has semantic HTML ever done for us? Does the browser care that I used <i> instead of <em> for italic? Do screen reader even care?
- renewiltord 4y agoI wonder if AI screen readers will ever use the visual appearance of something to determine what it means. So even if you draw on a `<canvas>` it can still read the text. That would be sick.
- z3c0 4y agoYou have a fantastic idea there, and if you'd like to attempt to make it a reality, I'm happy to brainstorm it with you. You keep full ownership of the concept; I'm happy to contribute given the people it'd help. You can contact me directly using my handle at my domain, which is 21337.tech
- renewiltord 4y agoz3c0, much appreciated, but I am prioritizing other things at this time. Let me hit you up at a future time if no one has already built something with this feature already!
- z3c0 4y agoFine by me! We'll table this for then.
- mywittyname 4y agoBetter to use a div instead.
- z3c0 4y agoMore than just a witty name, I see
- suby 4y agoI feel that this is where accessibility needs to go. We cannot rely on toolkits to implement support for accessibility standards because there will always be people building apps in niche toolkits / homemade gui's which don't support accessibility, especially as wasm becomes more common on the web. We need to treat the screen like a PNG which an AI can parse to determine what the text is, what text is relevant to read to the user, where and what the buttons are, how to emphasize reading the text based on the visuals, etc. It's the only thing that will scale and while difficult it seems that creating something like this is within reach.
- layer8 4y agoI agree in principle, but good luck with AI interpreting flat-UI controls visually, it’s confusing enough for sighted users. This actually gives me a little hope that AI-interpreted UI could trigger a trend back to visually obvious and unambiguous controls.
- madeofpalk 4y agoNo. That’s like saying OS should use AI to try and figure out what buttons are to make them clickable, rather that developers actually building an interface for users. All operating systems and platforms have pretty fluent and in-depth APIs for exposing an “accessibility tree” for assistive technologies to use. It’s your responsibility as a developer to build interfaces for actual users, and there’s very little reason not to.
- ronsor 4y ago> That’s like saying OS should use AI to try and figure out what buttons are to make them clickable, rather that developers actually building an interface for users. That's actually a really good idea.
- maxwelljoslyn 4y agoEspecially now that designers are making buttons/clickable areas hard to distinguish ... I could totally use AI to highlight all the things that are actually, you know, interactive.
- cxr 4y agohttps://hn.algolia.com/?query=donhopkins%20morgan%20dixon&sort=byPopularity&type=comment https://hn.algolia.com/?query=donhopkins%20morgan%20dixon&so...
- warpech 4y agoThis is fascinating. Do you know what ever happened to these projects? Prefab[1] and especially Bubble Cursor [2] look like be super useful additions for the flat-UI era. [1] http://prefab.github.io/ http://prefab.github.io/ [2] https://www.tovigrossman.com/BubbleCursor/ https://www.tovigrossman.com/BubbleCursor/
- rikroots 4y agoIn my view all canvas-related JS libraries should treat accessibility as a foundational requirement. It's not "too difficult" to implement. Here's an explanation of the accessibility features I've added to my canvas library[1]. These features may not be the best approach, or even the most appropriate approach ... but at least they're there, and they can evolve into something better as/when people offer feedback. [1] - https://scrawl-v8.rikweb.org.uk/learn/eleventh-lesson https://scrawl-v8.rikweb.org.uk/learn/eleventh-lesson
- aylmao 4y ago> What has semantic HTML ever done for us? For us small things, like enable reader views. For people with disabilities, it lets them effectively use screen readers.
- cratermoon 4y agoThe accessibility aspect is huge and deserves more attention and kudos than it gets. Also, from a purely selfish aspect, I vastly prefer documents with at least a minimum of semantic organization, even if it's just header, footer, main, and meaningful heading levels. Without those, well, it's just a document full of undifferentiated text with various attributes to distinguish it visually or typographically, and usually inconsistently used. Is this piece of text styled "bold with fontsize 16" supposed to be a second or 3rd level header?
- imgabe 4y agoWhat stops screen readers from treating the <i> tag the same way they treat the <em> tag? If <em> functionally ends up doing the same thing that <i> did, what's the point?
- reaperducer 4y ago<i> for things that should be italic for visual reasons. For example, the titles of books. <em> for things that are emphasized, as in emphatic expressions within text. For example "You'll get nothing and you'll like it."
- gnubison 4y ago*<cite>
- Tomte 4y ago<cite> is also pure joy. From MDN: > It's worth noting that the W3C specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work's author. However, the WHATWG specification for <cite> says the opposite: that a person's name must never be included, under any circumstances.
- ramesh31 4y agoOnce upon a time, HTML was a document format, and there was a dream that these documents would be interconnected with deep meaningful semantics that would be machine readable. But then HTML became the rendering layer for a universal sandboxed VM, and all that went away.
- kazinator 4y ago> What has semantic HTML ever done for us? Why, it has liberated us from European colonialism. <i> being no longer italic, you can wrap it around any script from the world and enjoy the semantics of it.
- bioemerl 4y agoI'm confused, is this a joke? If it is, is there context here I'm missing?
- kazinator 4y agoFrom my end, it's intended that way, and I hope it is so.
- cercatrova 4y agoThe joke is that italic can also mean Italic, the ethnolonguistic group of those who spoke Italic languages and why Italy is named so. The phrase "What has semantic HTML ever done for us?" is a riff on the quote "What have the Romans ever done for us?" from the movie Life of Brian, about a Jewish-Roman man mistaken for another Messiah. The Romans are, of course, Italic peoples.
- kazinator 4y agoNo, that's not the joke, though for a brief split second, some moments after I wrote the comment, it occurred to me that the interpretation might arise. Italic type is derived from a form of semi-cursive writing, and is entrenched in the European printing tradition. No punning with Italy intended. So what does it mean if you have <i> around Chinese, or Devangari or what have you? Do you just apply shear to make the text slanted? I suspect that it bothered some "woke" types that HTML contains Euro-centric typographical directives, so they have been repurposed to have some sort of, culturally neutral semantics that is more inclusive of the planet's diversity (pardon me if I'm not nailing the terminology here). In short, <i> no longer belongs to whitey and his writing system.
- 4y ago
- notatoad 4y agoAh, I just decided to stop learning new things before tailwind came along
- krainboltgreene 4y ago> sometimes I just want to design something basic without having to context switch to CSS. I want italic, I use the <i> tag. Just use the <em> tag.
- marssaxman 4y agobut... what if the browser chooses to render emphasis in some fashion other than italic? How then could I force my design opinions on the reader, despite the contrary configuration of their user-agent? Surely we can't allow the end-user to control their experience when it's the designer's intention which really matters.
- klodolph 4y agoWhat if I want text that’s italic but not emphasized?
- a9h74j 4y agoYes, e.g. what if you are quoting something with italics in the original text? For older texts in English, italics might easily indicate a word or phrase in a non-English language. Showing that with semantic "emphasis" might convey the wrong impression -- e.g. without a note such as "emphasis added". The OP addresses "idiom in another language" as one case, but if it is within a scholarly quotation, can one change the typography to a different convention?
- paulmooreparks 4y agoThen there's the matter of languages such as Japanese that use a different set of characters (katakana) both to indicate emphasis and to mark foreign loan-words. Would katakana characters still be enclosed in an <i> element? Would styling be modified accordingly?
- naniwaduni 4y agoPerhaps you could add emphasis dots (https://en.wikipedia.org/wiki/Emphasis_mark https://en.wikipedia.org/wiki/Emphasis_mark)!
- dhc02 4y agoWait isn't Tailwind pushing the vast majority of its users to produce much more accessible websites than they would otherwise?
- eurasiantiger 4y agoIt’s just another Bootstrap.
- lewisflude 4y agoIt definitely looks like bootstrap in syntax. A lot of "css superfans" actually really enjoy tailwind in use. It solves more problems than it causes for some people.
- bananarchist 4y agoIt’s really convenient for prototyping but best to refactor to stylesheets before pushing all that bulk to production
- eurasiantiger 4y agoIt’s basically a return to the days of HTML without CSS. CSS classes are not applied as an abstraction of different visual styles or components, but purely as tools to define visuals in situ. I suppose it’s easier to reason about, but it feels like it was invented by that grug brain dude who likes solving lots of problems but hates thinking.
- dmitriid 4y ago> You skipped "fuck semantic HTML and CSS, we use Tailwind now." If look at Tailwind's website and examples, you'll see that it's one of the very few CSS frameworks that properly uses semantic HTML everywhere. And there's no such thing as "semantic CSS".
- sph 4y agoMost CSS best practices are based around semantic naming: you name your elements ".call_to_action" or ".sidebar". HTML5 introduced a lot of semantic elements such as <header> or <article>. Whereas with Tailwind or HTML < 5 you name you elements based on what they look like. ".font-bold" or "<b>"
- dmitriid 4y agoCSS purists will tell you that you shouldn't tie your CSS to specific structures in your code, and it should be as generic as possible :) > Whereas with Tailwind or HTML < 5 you name you elements based on what they look like. ".font-bold" or "<b>" No, you don't. With Tailwind you use the semantic elements in HTML. And you style them using generic primitives
- dimmke 4y agoSo with the @apply rule you can sketch things out in tailwind and put them behind semantic names if you have PostCSS running. It works quite nicely.
- xigoi 4y ago> And there's no such thing as "semantic CSS". I think the parent meant “[semantic HTML] and CSS”, not “semantic [HTML and CSS]”.
- vehemenz 4y agoThe screen reader cares about the big stuff, such as using headings, tables, and lists correctly. And of course, implementing ARIA attributes correctly. Other than that it doesn't matter too much.
- moritzwarhier 4y agoI find that Tailwind makes it a lot easier to use semantic HTML because it discourages element styling and provides an aggressive browser style reset. H2 or H3? A purely semantic distinction with Tailwind. Use an OL for a custom list of items? You start with a clean slate, no overrides required. And you are discouraged from writing custom CSS that causes unexpected styling as well. Every HTML tag with an empty class attribute is a clean slate. You only have to care about the default display mode and about allowed descendants.
- naniwaduni 4y agoMDN's "interpretation" of <i> has, in that span of that last one, also changed between "alternate voice"(?), "interesting", and now, apparently "idiomatic" text—I'm sure I've missed a few. I feel like it'd be a service to the world to just suck it up and let it be the "legacy italics" tag, though.
- alwillis 4y agoMDN's "interpretation" of <i> has… It’s not an MDN interpretation; this has been part of the HTML5 spec since day 1. I linked to a 12 year-old article earlier in this thread [1] describing this very thing when HTML5 was new. [1]: https://news.ycombinator.com/item?id=33556432 https://news.ycombinator.com/item?id=33556432
- naniwaduni 4y agoAs far as I know, the spec still calls it "alternate voice or mood"; it's MDN, not the spec, that now calls it "idiomatic" text. So I stand by it being the MDN interpretation that's changed, not the spec (to pretend that it's not "we tried to remove it and failed" by making it something that at least actually starts with an I now, I guess, twice).
- ezequiel-garzon 4y agoYou are correct: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-i-element https://html.spec.whatwg.org/multipage/text-level-semantics....
- alwillis 4y agoidiomatic is certainly in the spec [1]: The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts. [1]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-i-element https://html.spec.whatwg.org/multipage/text-level-semantics....
- samtho 4y ago> here’s a convoluted meaning I think the word you are looking for is “contrived”
- notatoad 4y agoindeed. thanks
- alwillis 4y agookay, fine, you’re all still using “i” so we’ll put it back in the standard Going from HTML/XHTML to HTML5/XHTML5, several elements were redefined, including <i> and <b>. It’s nothing new. Here’s an article from HTML5 Doctor explaining this more than 12 years ago [1]. I hope web developers serious about their craft aren’t just now discovering this. [1]: http://html5doctor.com/i-b-em-strong-element/ http://html5doctor.com/i-b-em-strong-element/
- Freebytes 4y agoIf they wanted people to use a different tag for such text, they should have created an idiomatic tag instead of attempting to repurpose existing ones. Adding alternative elements is usually the better solution.
- alwillis 4y agoIf they wanted people to use a different tag for such text, they should have created an idiomatic tag instead of attempting to repurpose existing ones. If you read the spec, it mentions several different uses for <i>, depending on the context. Otherwise, we’d need a different element for each context, bloating the spec by having special purpose elements instead of general ones. For example, <i> is used for ship names: <p>They came over on the <i>Mayflower</i>.</p> It wouldn’t make a lot of sense to have an element just for names of ships in a general purpose markup language like HTML. Turns out, if you look at the Wikipedia article about the Mayflower, the name is marked-up with the <i> element [1]. [1]: https://en.wikipedia.org/wiki/Mayflower https://en.wikipedia.org/wiki/Mayflower
- runarberg 4y agoI kind of like using <i> for other user’s names that appears in a sentence. For example if a joker calls them self, “you piece of shit” it would be kind of unfortunate for another user to open up a dialog and it says: “Are you sure you want to delete the user you piece of shit?” Now with the user’s name in italics, this is less ambiguous. In general I think many UXs are too shy about using italics.
- 1letterunixname 4y ago3 fewer letters than "span".
- Beltalowda 4y agoThe entire HTML standard process has traditionally been dominated by people with Very Strong Opinions and little sense of practicality. It's a little better now though. The practical thing to do was to just re-define <i> and <b> to mean what <em> and <strong> were defined as then add additional elements for when more fine-grained meaning if needed. Instead, countless of hours had to be lost on s/<b>/<strong>/g instead.
- deleted 4y ago[deleted]
- xigoi 4y agoThing is, not all uses of <b> are valid uses of <strong>.
- Beltalowda 4y agoBut everyone just did s/<b>/<strong>/, so... This is exactly the sort of "argument from purity" that lacks any practicality that I meant.
- jancsika 4y agoWe need to work on the following: 1. Add an "i" element to SVG for isometric path drawings 2. Update the HTML parser algo to special case this "i" for inline SVGs
- runarberg 4y agoDo you need to updated the parser though? I kind of thought SVG elements were implicitly namespaced. For example we have the two <a> tags. One HTMLElement <a> and another Element <a> with the namespace "http://www.w3.org/2000/svg http://www.w3.org/2000/svg". I don’t know of any meaningful difference between those two elements, except if you try to insert the former into an SVG DOM tree, then weird things might happen (though I haven’t tested it).
- denton-scratch 4y agoYeah, only a terminally-dumb parser could confuse an SVG <i> tag with an HTML <i> tag. A proper HTML parser should ignore anything inside tags it doesn't understand - such as the <svg> tag.
- jbverschoor 4y agoWhy isn't this deprecated and marquee is?
- ht85 4y ago<marquee> gives you too much power, cannot handle.
- Sharlin 4y agoTo be fair, <em> is semantically not appropriate for the use cases that <i> is these days recommended such as H. sapiens and RMS Titanic. These are not about emphasis but a typographical convention.