Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loading user-defined CSS stylesheet #321

Open
1 task
agoose77 opened this issue Mar 6, 2024 · 7 comments
Open
1 task

Add support for loading user-defined CSS stylesheet #321

agoose77 opened this issue Mar 6, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@agoose77
Copy link
Collaborator

agoose77 commented Mar 6, 2024

Users often want to define custom styling (CSS, SCSS, or SASS) for their site. This allows them to do lightweight theming without needing to create an entirely new theme. It also allows authors to make page-specific styling for certain UI components etc.

Proposal

We should allow users to:

  • Define custom CSS for their MyST sites.
  • Allow users to write this as SCSS or SASS, including the use of variables.
  • Ideally, allow for this either on a per-page basis (e.g. page metadata), or a project wide basis (e.g. myst.yml)

Inspiration

  1. Point to an (S)CSS file from myst.yml. here's how sphinx does this
  2. Add CSS directly to a page via HTML in the markdown (e.g. <style> tags)
  3. Add CSS via frontmatter on the page or in myst.yml (e.g. a key like site.style: <scss rules to add to the page or the website>)

Related

Tasks and updates

  • Automatically include e.g. myst-theme.scss
@agoose77 agoose77 added the enhancement New feature or request label Mar 6, 2024
Copy link

welcome bot commented Mar 6, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@choldgraf choldgraf changed the title Add support for loading user-defined stylesheet Add support for loading user-defined CSS stylesheet Jul 28, 2024
@choldgraf
Copy link
Contributor

I added a few ideas for how this could look from a user's perspective to the top comment

@AlexEMG
Copy link

AlexEMG commented Aug 12, 2024

That would be a great feature!

@cboettig
Copy link

Looking forward to this! In addition to CSS, it might be nice to be able to support SASS / SCSS transpiling into CSS. SASS supports things like variable definitions and many users may find it easier to write SASS than raw CSS (or modify any of the many scss themes). Other popular static site generators, like Hugo, have supported SCSS transpile on the fly for a while now (https://gohugo.io/hugo-pipes/transpile-sass-to-css/), and quarto supports SASS variables as well https://quarto.org/docs/output-formats/html-themes.html#sass-variables.

@choldgraf
Copy link
Contributor

thanks for this @cboettig - I've included your links into the top comment of the issue and cleaned it up a bit

@sbooeshaghi
Copy link

Hi, I'd like to voice my support for adding the ability to reference raw HTML files in the myst.yml file. This would be valuable for my use case:

I maintain a tool documentation site (https://pachterlab.github.io/seqspec/) and have custom HTML content on a separate site (https://www.sina.bio/seqspec-builder/regions.html). I'd like to embed this custom content at a specific path on the main site (e.g., https://pachterlab.github.io/seqspec/regions.html).

The custom HTML contains an auto-generated table from a database, describing file format features documented on the main site. Colocalizing the docs and examples via MyST would improve user experience.

Ideally, I'd like to reference HTML files in the myst.yml file like this:

  toc:
    # Auto-generated by `myst init --write-toc`
    - file: README.md
    - file: docs/INSTALLATION.md
    - file: docs/UNIFORM.md
    - title: Examples # <-- requested additional feature
      children:
      - file: docs/regions.html
      - file: docs/reads.html
      - file: docs/assays.html
    - title: Documentation
      children:
      - file: docs/SEQSPEC_FILE.md
      - file: docs/SEQSPEC_TOOL.md
      - file: docs/SPECIFICATION.md
    - title: Tutorials
      children:
      - file: docs/TUTORIAL_SIMPLE.md
      - file: docs/TUTORIAL_COMPLEX.md
      - file: docs/USING_SEQSPEC.ipynb
      - file: docs/SEQ_PRIMER.md
    - file: docs/CONTRIBUTING.md
    - file: docs/CHANGELOG.md

This feature would significantly enhance my workflow and improve documentation integration.

@rowanc1
Copy link
Collaborator

rowanc1 commented Sep 9, 2024

This is super cool work @sbooeshaghi, thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants