Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-homepage
base: 095641d40515
Choose a base ref
...
head repository: NixOS/nixos-homepage
compare: 40c80051c546
Choose a head ref
  • 16 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 6, 2020

  1. site-styles: Remove intro comment from CSS output

    LESS compiles out // comments, but keeps /**/ comments.
    
    The /**/ comments are mainly used, here, to keep license attributions.
    samueldr committed Oct 6, 2020
    Copy the full SHA
    07752f1 View commit details
    Browse the repository at this point in the history
  2. collapse: prefer using implicit .with-js class

    By prefixing `&` we can make styles in a namespace apply according to
    external selectors.
    
    Here `html.with-js &` makes is so that when the selector is expanded,
    `&` is replaced with the parent selector (`.collapse`), so it ends up
    being `html.with-js .collapse`.
    
    This does have one caveat. The previous implementation would keep the
    "un-enabled" variant for any collapse not already converted if the code
    ended up stopping due to a crash. This is not something that we should
    concern ourselves with, as if it crashes there's more to worry about.
    samueldr committed Oct 6, 2020
    Copy the full SHA
    9cf8576 View commit details
    Browse the repository at this point in the history
  3. js: move page-specific code

    Ideally we'll prefer implementing a generalized behaviour instead of
    page-specific JS. But when it's needed, put it at the end so the file is
    easier to go through.
    
    Maybe we should invest some time into figuring out a palatable "packer"
    for the JavaScript bits? Probably to be looked at later when we choose
    the new tooling for the website.
    samueldr committed Oct 6, 2020
    Copy the full SHA
    2127c53 View commit details
    Browse the repository at this point in the history
  4. js: Collapse should prefer handcrafted IDs

    This is because changing the wording of a section will keep deep links
    working.
    
    Additionally, I find the generated anchors quite unwieldy.
    samueldr committed Oct 6, 2020
    Copy the full SHA
    c21e509 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    d641cbb View commit details
    Browse the repository at this point in the history
  6. js: Prefer attributes accessors to build HTML

    Using `$("<a />")` is perfectly fine. Even `$("<a class='something' />").
    But the moment we want to include variable content, prefer using `.attr`
    rather than hoping the content will not destroy our string's HTML.
    
    Sure, we control the DOM, and *it shouldn't happen*. But as we're making
    this generic enough, we can make it right at the same time.
    
    Furthermore, this, in my opinion, removes the cognitive load of reading
    the escaped and concatenated string. (This is why the double quotes were
    replaced with single quotes).
    samueldr committed Oct 6, 2020
    Copy the full SHA
    ff703e0 View commit details
    Browse the repository at this point in the history
  7. js: collapse $titles -> $articles

    This, coupled with the next change,  reduces confusion when mentally
    mapping the model of the collapse.
    
    We don't *really* care about titles, we care about the articles.
    
    This is basically a useless diversion at this point in time, but when
    we need to refer to the article in the future, we're already using the
    article instead of targeting deeply for its title.
    samueldr committed Oct 6, 2020
    Copy the full SHA
    18ba2f1 View commit details
    Browse the repository at this point in the history
  8. js: collapse $link -> $header

    They are the headers, and not outright links. They will be wrapped in
    links, though.
    
    (See also the previous commit.)
    samueldr committed Oct 6, 2020
    Copy the full SHA
    c249c80 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    b94dba9 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2020

  1. js: Fix bug introduced with careless change

    Since `.wrap()` continues the pipeline returning the original selected
    set, this didn't work as expected.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    5c183c9 View commit details
    Browse the repository at this point in the history
  2. collapse: Changed modifier class name to -selected

    With RSCSS, "modifier" class names are prefixed with a dash.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    384f386 View commit details
    Browse the repository at this point in the history
  3. js: comment a bit more

    I had to re-think about all of it before it made sense before the
    comments. Not that it's badly done, but this sure will help the next one
    who'll read this.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    70e97c4 View commit details
    Browse the repository at this point in the history
  4. collapse: Use different class names for selected vs. expanded

    This is helping a bunch with understanding what is going on. Otherwise
    `-selected` becomes quite overloaded between the "collapsible" behaviour
    and the "selection" behaviour of the tabs-like navigation.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    9e75071 View commit details
    Browse the repository at this point in the history
  5. js: rollback to previous implicit activation behaviour

    This fixes issues with collapse and passing *through* viewport widths.
    
    The reason is that the activation logic, on load, depended entirely on
    which view the site was viewed as!
    
    With this, we instead rely on the behaviour that activating *all* links
    is a safe activity.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    2309a70 View commit details
    Browse the repository at this point in the history
  6. collapse: Split behaviour depending on the view

    This helps with synchronization issues by *completely ignoring* actually
    synchronizing the elements.
    
    So the behaviour now synchronizes its view *and* the other view in
    different manners, depending on what is desired UX-wise.
    
    Read the amended comments in the less file, as it describes the new
    behaviour.
    samueldr committed Oct 7, 2020
    Copy the full SHA
    b5efa3c View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    40c8005 View commit details
    Browse the repository at this point in the history