Better HN
topnewbestaskshowjobs
Log inSign up

FrontAid

390 karma · joined Jul 13, 2020 (6y ago) · 80 submissions

Submissions

comment 5y ago · link · parent

bit (https://github.com/chriswalz/bit) is a somewhat similar CLI tool for this. It shows command completion alongside a description.

PS: We maintain a list of helpful Git CLI tools on https://github.com/frontaid/git-cli-tools

comment 5y ago · link · parent

Formatting (without "arbitrary format specifications") has been available for years:

- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

- https://caniuse.com/mdn-javascript_builtins_intl_datetimefor...

Parsing, however, is an entirely different topic. I assume the Temporal proposal authors learned from the Date.parse fiasco. To this day, there are browser inconsistiencies that make it largely unusable for anything else than the full-length ISO date format. Hence, it might be better to use a userland library that works consistently regardless of the browser (version). There are also some notes about parsing in https://tc39.es/proposal-temporal/docs/parse-draft.html:

> Temporal's approach to most operations—including parsing—is to encourage strong typing, e.g. Temporal.Instant.from vs. Temporal.PlainDateTime.from. A type-spanning "parse anything" API goes against that strongly-typed model.

comment 5y ago · link · parent

> As a side note, what do people think about JSON schema? I find it quite verbose and cumbersome

Agreed. But if you want to have validation and autocompletion in most editors, it is still the way to go. We use it to validate JSON content files for a CMS [1]. It is a little repetitive in our case (e.g. the `:name`/`:description` keys are repeated), but not that bad. Newer versions of JSON Schema [2] have improved in that respect, but most editors (or plugins) and tooling in general is still based on older versions. So we have to stick with those for a while.

[1] https://github.com/frontaid/schema/blob/master/frontaid-sche...

[2] https://json-schema.org/specification.html

If you have to deal with JSON a lot, you might want to checkout https://www.schemastore.org/json/ which has schemas for a large number of file types.

comment 5y ago · link · parent

That page broke tabbing through interactive elements by using nested focussable elements like this:

    <div tabindex="0"><input ...></div>
Because of that, it is sometimes necessary to tab twice to focus the next element. Not sure whether that is a problem of DaisyUI in general or just their website. But it is definitely annoying.

comment 5y ago · link · parent

No, I meant "expected by anyone who learned the language". Knowing the addition operator including its limitations is quite basic. I'm not saying you need to be able to solve all this "JavaScript is weird" puzzles as they are mostly non-sense. But you definetely have to know what you can us `+` for.

If someone does not like the ECMAScript specification, that is fine. But at least use a proper unofficial documentation like MDN.

comment 5y ago · link · parent

I understand where you are coming from. But the addition operator simply does not have any special handling of arrays. The specification [1] clearly defines what it should be used for: "The addition operator either performs string concatenation or numeric addition." As JavaScript is weakly typed, it is the programmer's responsibility to use proper value types with these operators. That limitation (or advantage?) is also well-known and applies to all weakly-typed languages.

[1] https://tc39.es/ecma262/multipage/ecmascript-language-expres...

comment 5y ago · link · parent

Both of these examples are well-known (and not unexpected) behaviours. I assume you already know why it behaves like that. If not, I can explain it.

> [1, 2, 3] + [4, 5, 6] // -> "1,2,34,5,6"

What would you expect instead?

> [,,,].length // -> 3

Is there any use case where you would want to deal with sparse arrays?

comment 5y ago · link · parent

> I wish for the day where I can really just write clean semantic html and then add the CSS afterwards on top of it.

What exactly is stopping you from doing just that today?

comment 5y ago · link · parent

Nesting is not possible in vanilla CSS. However, there is an Editor's Draft about it which has gained some momentum recently.

https://linkedlist.ch/ref/25/

comment 5y ago · link · parent

> Besides, none of these services (dropbox, onedrive) support ignore files, so they're constantly syncing node_modules folders, etc.

Tresorit has that feature and it works great. Aside from data encryption, it was the main reason why I switched from Dropbox.

https://support.tresorit.com/hc/en-us/articles/217103697-Exc...

comment 5y ago · link · parent

Container queries have been suggested for a while now, it is not a new idea. But it has gained a lot of momentum recently, for example [1]. So maybe it will not be years until all modern browsers might support it. Until then, you might want to try [2] (not a polyfill, but a workaround with JavaScript).

[1] https://github.com/w3c/csswg-drafts/issues/5796

[2] https://philipwalton.com/articles/responsive-components-a-so...

comment 5y ago · link · parent

Assume you have a number of cards organized in rows and columns. You could define how many columns to show between each breakpoint using several media queries. However, a better approach would be to use a flex container with `flex-wrap:wrap`. Specify `flex-basis` for its children and the browser will automatically wrap them accordingly. No break points needed.

comment 5y ago · link · parent

I agree with the general sentiment.

> What can the web designer do?

Completely disagree with this section.

Each of the suggested device categories (Desktop/laptop, Tablet, Phone) has many different screen sizes/resolutions. And all of them might have screens in landscape or portrait mode. All of these devices might support multi-tasking with varying split screen sizes. All of those devices support custom accessibility configurations for font-sizes, zooming or both. By detecting the UA and trying to shoehorn it into a certain category, you only increase the number of issues for the users.

One part of a solution to this problem is to use relative CSS units. Avoid hard breakpoints whenever possible. Only break columns into rows when there is no more space left.

comment 5y ago · link · parent

Small bullet point, but an important one. This release also combats tracking with `window.name`. Discussion here:

https://news.ycombinator.com/item?id=26863109

comment 5y ago · link · parent

OK, I see. The tool we are working on is similar but also not quite what you are looking for. In case you want to have a look, it is availale on <my-name> .io

comment 5y ago · link · parent

> 3. GUI/WebUI CMS for contributing to a shared versioned repository.

Did you have some specific tool in mind? Because I completely agree that this is a great way of working with content. We have been doing that for a couple of months with our own tool. It uses Git and stores content in a pretty-printed JSON file. Techies can update that directly and push it manually. Content editors can use our tool to edit and commit to Git with a simple Web UI. Would that go into a direction you were thinking of?

comment 5y ago · link · parent

Maybe you can take some inspiration from FrontAid CMS https://frontaid.io/

comment 5y ago · link · parent

Most browsers changed that to a site-based cache instead of a global one.

https://www.zdnet.com/article/firefox-to-ship-network-partit...

comment 5y ago · link · parent

Maybe https://globalprivacycontrol.org/ could change that.

comment 5y ago · link · parent

Maybe FrontAid CMS might be interesting to you, even though it is also proprietary. FrontAid CMS is similar to Forestry, but stores all your content in JSON instead of Markdown. It is therefore better applicable to (web) applications in addition to simple blogs. https://frontaid.io/

comment 5y ago · link · parent

Like what? I can't think of any "special behaviour" that I would not want to have in a button and that cannot be changed by CSS.

comment 5y ago · link · parent

Maybe you are referring to https://en.wikipedia.org/wiki/Mozilla_Prism

comment 5y ago · link · parent

That is great news! Thank you Florian, Robert, and everybody involved.

54.

Fluid Typography with two-dimensional CSS Locks(frontaid.io ↗)

3 points · by FrontAid · 5y ago · discuss

comment 5y ago · link · parent

Many good points in there. One that I run into on a regular base and that can't be fixed right now:

> Selectors have terrible future-proofing. We should have split on top-level commas, and only ignored unknown/invalid segments, not the entire thing.

That forces you to duplicate declarations for backward-compatibility. For example, you can't combine those two selectors:

    /* works */
    :user-invalid {}
    :-moz-ui-invalid {}

    /* breaks */
    :user-invalid, :-moz-ui-invalid {}
Somewhat related to the link: https://github.com/jensimmons/cssremedy tries to "fix" some of those issues.

comment 5y ago · link · parent

I'd recommend not doing that as it makes the UX on mobile worse and has a bad influence on SEO. Instead, I usually do something like that:

    h1::first-line {font-size:2rem;}
    h1 {font-size:1.5rem;}
It will show the first line of a heading in a larger and all further lines in a smaller font size. Additionally, you could hyphenate headings.

edit: And fluid typography might be something to look into. Currently, you seem to have a single breakpoint where font size is adapted. That does not work well on larger phones.

comment 5y ago · link · parent

I rarely use any of the popular CSS frameworks. Unless you are making a small(ish) website where the styling is not important, it is actually more work to customize an existing framework than to just use CSS yourself.

But what I do use sometimes is a CSS reset like https://github.com/necolas/normalize.css

And what I also use is this CSS boilerplate: https://github.com/frontaid/natural-selection (Disclaimer: I created it because I wanted to avoid the repetitive work of writing out all the selectors).

123