
Show HN: USA.css – units set in inches, 1776 bytes - bennettfeely
https://bennettfeely.com/usacss/
======
chrismorgan
Feels strange to have single decimal places in your inch figures. I’d have
expected something like eighths, sixteenths and thirty-seconds of inches, even
though the decimal representation of them is unwieldy (1⁄32″ becomes
0.03125in). That also helps you avoid fractional pixels, which is worth doing
if convenient: 1⁄32″ is 3px, because 1in is defined as 96px.

(As an Australian, the main place I’ve ever seen fractions of inches is old
tools like spanners from before the adoption of the metric system, and that’s
all fractions with powers-of-two denominators. But maybe Americans use decimal
fractions of inches? I suppose I have seen laptop screens described in that
way, e.g. 13.1″, 15.4″ and 15.6″, though people typically truncate to the
inch.)

~~~
amyjess
All small measurements in the US are done in power-of-two fractions of an
inch. In fact, much of the initial opposition to the metric system here was
led by the construction industry, who has found from experience that 1/2" 1/4"
1/8" 1/16" etc. measurements are too convenient to ever give up.

~~~
skrause
How this that convenient when you then have to use something like 13/16?

Just look at the standard wrench sizes ([https://www.cnm.edu/programs-of-
study/programs-a-z/automotiv...](https://www.cnm.edu/programs-of-
study/programs-a-z/automotive-technology/tool-list)):

* Standard Combination Wrenches: 1/4, 5/16, 11/32, 3/8, 7/16, 1/2, 9/16, 5/8, 11/16, 3/4, 13/16, 7/8, 15/16, 1.

* Metric Combination Wrenches: 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19. Measured in millimeters.

~~~
mikecoles
Perfectly convenient.

The standard system excels when doing actual work. If you have a rod with 1"
diameter and you need to take it down to 13/16", you can use a lathe to make
3/32" cut. Or if you need to divide up 13/16 into 4 parts, for example, 13/64.

The metric system's strength is teaching in elementary schools where skills
with fractions are not as strong.

------
klyrs
Weirdly, bennettfeely had 1776 karma when I clicked their profile. Conspiracy?
Coincidence?

~~~
Stratoscope
And 1812 when I clicked just now.

This must mean something!

~~~
iliaznk
1812 – that's when Napoleon invaded Russia.

~~~
Svip
I think they were referring to the War of 1812. A war the US lost, and where
the song "The Star Bangled Banner" comes from.

~~~
adventured
> I think they were referring to the War of 1812. A war the US lost

The outcome of history indicates the US won that war. Technically it was
considered a stalemate. The US lost no territory, repelled a malevolent empire
again, kept its economy & trade fully intact, and won numerous major battles
throughout the war. In the following decades the US became an economic
juggernaut, while the British Empire began to fade into the history books.

A supposedly mighty empire failed twice in less than 40 years to bring a small
nation to its knees. Quite humiliating.

[https://en.wikipedia.org/wiki/War_of_1812](https://en.wikipedia.org/wiki/War_of_1812)

\- "In 1813, the US won the Battle of Lake Erie, gaining control of the lake,
and they defeated Tecumseh's Confederacy at the Battle of the Thames,
defeating Britain's largest Native American ally, a primary war goal."

\- "In 1814, the British burned Washington, but the US later repulsed British
attempts to invade New York and Maryland, ending invasions from Canada into
the northern and mid-Atlantic states."

\- "Attempts to smother American maritime trade failed, however, and soon both
sides began to desire peace."

\- "In early 1815, after a peace treaty had been signed, but before this news
had reached the Americas, the US defeated the British Army near New Orleans,
Louisiana."

\- "Peace negotiations began in August 1814, and the Treaty of Ghent was
signed on December 24, 1814. News of the peace finally reached America in
February 1815 about the same time as news of the victory at New Orleans. The
Americans triumphantly celebrated the restoration of their national honor,
leading to the collapse of anti-war sentiment and the beginning of the Era of
Good Feelings, a period of national unity. The treaty was unanimously ratified
by the US Senate on February 17, 1815, ending the war with no boundary
changes"

~~~
swilliamsio
> repelled a malevolent empire again

That's just straight up wrong. The US started the war when they invaded
Canada. The British Empire did not want to fight the war. To them, the United
States was just a sideshow of the much larger and much more important
Napoleonic Wars.

If anything, it was the British and Canada that repelled a malevolent United
States, who had had eyes on annexing Canada since independence.

> In the following decades the US became an economic juggernaut, while the
> British Empire began to fade into the history books.

Uh, what. The 19th century was the golden age of the British Empire, whilst
the US remained a small player on the world stage. You must be confusing the
War of 1812 to the first or second world wars.

I know its the Fourth of July for you yanks, but this comment is just straight
up propaganda.

And quoting Wikipedia to prove that it was a victory for the US is ironic
given that Wikipedia states that the war resulted in stalemate and status quo
ante bellum. The only real losers were the Native Americans.

------
gerikson
Metric inches or survey inches?

[https://en.wikipedia.org/wiki/Foot_(unit)#International_foot](https://en.wikipedia.org/wiki/Foot_\(unit\)#International_foot))

~~~
OJFord
Huh, I didn't know about this, that feet and inches used to differ across the
world. If only they'd done pints, fluid ounces, and cups, etc. too!

(Cups are particularly annoying: there's British, US, US Legal, and metric.
The best recipe-following advice is that it's never going to matter. But it's
annoying.)

~~~
petepete
I thought the whole point of cups was that the actual quantity didn't matter,
so long as your ratios were consistent.

~~~
irrational
Measuring by volume was from a time period before we had reliable digital
scales. These days all baking measuring should be done by weight since it is
far more accurate. I won’t even consider a recipe that goes by volume.
Fortunately those are all written by amateurs.

~~~
progman32
For where precision matters, 100% agree. For people like me who just want
something halfway tasty but also quickly, the convenience of volumetric scoops
is compelling.

~~~
joe5150
I have a lot of junk in my kitchen drawers (admittedly a personal problem) and
will opt for measuring directly from the bag into the bowl on a scale over
digging around for that quarter cup every time.

~~~
frank2
Replace "convenience" with "low cost of equipping the kitchen" then.

~~~
iainmerrick
A set of measuring cups and a digital kitchen scale probably cost about the
same.

Just checked this with a quick search on Amazon -- most results are in the
$15-20 range, with some available for $10 or less.

(I dare say there are probably very cheap measuring cups available, and for a
scale you’ll have to fork out occasionally for batteries, if you want to split
hairs.)

~~~
Symbiote
Mechanical scales were normal in the UK for most of the 20th century. Everyone
I knew had one in the 1990s, from around 2000 people started buying digital
scales, and I took my mum's mechanical scale when I left for university.

Measuring ingredients by weight has a long history on Britain. The old,
Victorian cookbooks use weights.

[https://archive.org/details/b20392758/page/698/mode/2up](https://archive.org/details/b20392758/page/698/mode/2up)

~~~
iainmerrick
I’m generally a fan of simple mechanical devices over electronics, but I think
digital scales are a good example where electronics really do makes things
simpler; and as it’s a commodity (like calculators and digital watches) the
electronic version is amazingly cheap too.

The ability to zero the count as you add each ingredient to a single bowl is
very useful.

------
dc_ist
[https://designsystem.digital.gov](https://designsystem.digital.gov)

~~~
bob1029
I think its really great that this exists. Bonus points for it being a public
project on GitHub that any American can contribute to. It's also really hard
to argue with the licensing terms.

------
zacksinclair
I didn't even know you could set inches!

Happy 4th!

~~~
mediumdeviation
Mostly useful for print stylesheets. On screens it seems to be defined as a
constant 96px[1], which means it has no correspondence to physical inches.

[1]: [https://hacks.mozilla.org/2013/09/css-length-
explained/](https://hacks.mozilla.org/2013/09/css-length-explained/)

~~~
CivBase
Welcome back to HNC News. Tonight's top story: US law makers have introduced a
new bill that would require all digital displays in the United States to
feature a pixel density of 96 ppi. White house officials say the new bill
represents "the first step on the march to bring freedom to the cyber world".
More on this after the break.

~~~
pcunite
I would scream from my office. Almost no one would understand my pain.

~~~
tempodox
But it would make screens great again! Especially retina screens.

------
novok
Definitely only tested on chrome. The .usa-conic item doesn't render at all in
firefox :)

------
elagost
I'm no web dev, so feel free to improve upon it. Think I got the proportions
right though.

<div class="usa-stars" style="height:134;width:190;float:left;"></div>

<div class="usa-stripes-horizontal" style="height:250;width:475;"></div>

------
noncoml
Coming to US after living in UK for a few years, what astonished me was not
the fact that US is using the imperial system, but the US Gallon is different
to the UK Gallon...!

------
bjourne
Cool! This is the kind of things that I love to see on HN.

------
max0563
This is fantastic. Happy Independence Day!

------
andrewnicolalde
Beautiful!

------
alexseman
As an European this is really cool and unlike others self-loathing Americans
here in the comments I understand the idea, humor and originality. Happy 4th
USA, you are great today due to the greatness of your forefathers and the men
that built this nation.

~~~
dang
Given your previous comments, this looks like trolling. Please stop posting
like this to HN.

------
nautilus12
Good to see some patriotism in a time when American patriotism has become faux
pas. We live in a great country that doesn't need to be completely
deconstructed in order to get better

~~~
nxc18
Patriotism is about fighting for the principles and values espoused in the
constitution, and working towards improving an imperfect republic, not
worshiping the flag.

It’s a fun project and I like the colors, but let’s not pretend that the flag
and the idea of ‘patriotism’ are anything other than distractions from the
work that needs to be done.

~~~
mazeltovvv
Interestingly, everytime I hear this I feel like the constitution is treated
like the bible, some holy book holding the truth. That is very dangerous imo

~~~
macinjosh
The Constitution is THE Supreme Law of the land. It literally is the ‘bible’
in how America is to be governed. The difference is that The Constitution has
mechanisms within itself for change. This is the opposite of dangerous. It is
the reason slavery was abolished, women have the vote, etc. It is a living
document and it serves the people.

~~~
Leherenn
I would say one of the tenet of the Bible and other holy books is that there
are immutable. It's the words of God, and he doesn't make mistakes. (In theory
at least, I've heard the Bible's translations haven't always been kind to the
original text.)

That's a huge difference with the constitution, a fundamental one I'd say.
And, most of the time, the people I see treating the constitution as gospel
denies this very important mutability. The founding fathers were right and
will always be right. The constitution must not be ammended, it is already
perfect.

------
themodelplumber
What are some reasons to use inch units in screen-based CSS, aside from this
kind of project?

Edit: Removed all sentiment to my profile, leaving a beautifully rational
shell of a comment.

~~~
klyrs
If you need to rive a 5cm length in twain and you don't like fractions. Or if
you're making a website devoted to larval geometer moths.

~~~
dragonwriter
> If you need to rive a 5cm length in twain and you don't like fractions

125/127 is as much of a fraction as 1/2.

------
anonytrary
It's cute that this library is 1776 bytes, but that's quickly going to change
as bugs are found and new features need to get added. It seems like coupling a
product's name to something that will likely change very shortly is just bad
product naming.

~~~
dylan604
meh, call it done. it's modifiable by the user, so leave it alone and let the
user mess with it. i have no idea what the author's intentions are/were for
the project, but it seems like 'mission accomplished'.

~~~
anonytrary
FWIW I'm not saying I dislike the project, I love when people post quirky
projects like this to HN for fun. I'm just saying that even the smallest
change to this project would cause the author to lose the "1776 USA" marketing
strategy. One could say it's an unstable strategy at a local maximum.

~~~
dylan604
What name are you concerned about? The file is called 'usa.css'. The file size
is specifically listed right next to the download link. Not unusual. If the
file size does change, it'll just be another number, yet the name of the
file/project is still 'usa.css'.

~~~
anonytrary
I'm talking about the cute fact that the library is 1776 bytes. It was obvious
that author deliberately tweaked the file size to be 1776 bytes, to aid in the
marketing of the library, and that expecting to keep the file size at 1776
bytes is an unrealistic goal if the author wishes to iterate on the code. I
don't get why this is being made into a huge issue. It's a simple observation.

------
Carpetsmoker
I can't tell if this is intended to be serious or a parody? "All units set in
inches" makes it sound like a parody, but the "God bless America" footer makes
it sound serious? Hmmm

~~~
swebs
It's just a bit of fun. Not everything has to be some sort of statement.

~~~
Carpetsmoker
I guess ... but "God Bless America!" seems like a statement to me.

~~~
kube-system
It’s Independence Day in the US. Patriotism is the theme of the day. This is
just a humorous holiday-themed style sheet with a readme to match. It is not a
serious style sheet that the author expects anyone to use.

~~~
Carpetsmoker
Perhaps this is a cultural difference, but the entire thing just seems strange
from my own (European) perspective. Only in the US do people seem to take
pride in their measurement system as some sort of patriotic symbol, which is
why I originally thought it was a parody _shrug_

I'm not even going to get started with all the problems I see with "God bless
America", which would be long, tedious, probably inflammatory, and fairly off-
topic.

~~~
swebs
You're reading way too into this. Someone just decided to have some fun and
share it with HN. It isn't really serious, but parody isn't the right
description. People aren't taking pride in the measurement system, that's
somewhat of a joke. "God bless America" is a common cheer taken from a popular
song. The UK has something similar with "God save the queen".

~~~
arp242
Yeah, maybe. Probably. I'm just not a fan of this kind of stuff _shrug_.

I also don't like "God save the Queen" by the way, or "God be with us" (short
for "If God is with us, who shall be against us?" from Romans) we have on the
Dutch Euro coins :-)

------
jacquesm
Trying to imagine someone from France, Australia or Brazil to do something
similar and failing.

~~~
mhh__
_Système international_? We already use french units

~~~
jacquesm
No, 'international' does not mean 'French'. Yes, the French came up with it
but since it now has international adoption it is the international standard
with the United States as one of the last hold-outs. That's what you get when
you have a country run by lawyers with very limited input from science.

~~~
2038AD
Inches are in fact an international standard to which multiple nations have
formally agreed

[https://en.wikipedia.org/wiki/International_yard_and_pound](https://en.wikipedia.org/wiki/International_yard_and_pound)

~~~
jacquesm
You'll notice that they are defined in terms of SI units.

~~~
2038AD
I do notice

------
mariofa
[https://www.theverge.com/2020/7/2/21311330/twitter-
engineers...](https://www.theverge.com/2020/7/2/21311330/twitter-engineers-
master-slave-github-programming-racism)

------
KKKKkkkk1
Only a true American patriot who is deeply devoted to the nation's ideals
would zealously protect a system of units that has been thrown in the dustbin
of history by the rest of humanity.

~~~
serf
Was your point against the user, the concept, the measurement standard, or
just triggered by any vague mentioning of the United States?

It's difficult to sort through the negative sentiments to get to real point.
Be more clear with your hostility and anger next time, would'ya?

~~~
KKKKkkkk1
> Be more clear with your hostility and anger next time, would'ya?

You're projecting.

~~~
serf
I'm projecting?

But I haven't even thrown out 'true', 'devoted', or 'zealot' yet!

