Skip to content

Modernize the default theme #849

Closed
@nojaf

Description

@nojaf

Intro

The default CSS theme is getting out of date with today's web standards.
(It for example still contains wonderful things like <!--[if lt IE 9]>).
And I believe it is time for a facelift.

In #844, I started by updating Bootstrap but I have doubts we still really need it as a dependency. The world of CSS is a brighter one these days. Flexbox and grids make positioning convenient, variables and even selector nested are a thing now.
I'm quite confident that we can create a modern stylesheet from scratch that is highly customizable using CSS variables.

Technical

I envision that we revisit _template.html completely:

  • Navigation structure
  • Mobile menu
  • Any Javascript code (for things like the tooltips)

Yet I wouldn't change much of the generated HTML (for the API documentation pages) to start with.

Bet more on:

  • Modern CSS (variables, flex and grid, nesting, media queries)
  • Light and dark mode out of the box (easily achievable with media queries and variables)
  • Modular Javascript (type="module" and ESM import)
  • WebComponents (where it makes sense of course)

I don't want to introduce any Node/Deno/Bun like tooling. These are wonderful things but we should stick to modern standards that don't require (any/many) building steps. We want to keep the entry barrier for contributors as low as possible. Having installed only the dotnet SDK should be enough to make some changes.

The theme itself

I wouldn't overly do anything drastic or reinvent the wheel for the theme itself.
We could look at some other documentation sites for reference but I envision something rather basic with a top menu bar, a side menu bar and the page content. Something close to what existing users would expect.

Search

I do notice that search only really works for the API reference pages and also wish to modernize that part.
It is quite common to see searches being handled by third-party solutions like https://www.algolia.com/. These typically have a generous free tier and work really well.

Approach

We probably want to create a separate branch to develop this and publish alphas for people to try out.
At the very least we should ensure:

  • FSharp.Core
  • FCS
  • FSharp.Data
  • other projects (please shout if you know good ones)

are well tested.

I've already talked about this topic during the F# for Data Science conference in Berlin with @nhirschey, @kMutagene and @Freymaurer. I'm confident we can make something work here.
And I would be happy to hear your thoughts on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions