Giter Club home page Giter Club logo

Comments (6)

dimaMachina avatar dimaMachina commented on June 24, 2024

I remember you already submitted similar issue in v2.
In v3 I

  • moved copy code button in code block title
  • removed blured background
  • added transparent bg instead, similar how to docusaurus does

What’s your proposition to fix?

from docs.

n1ru4l avatar n1ru4l commented on June 24, 2024

Possible options are

  • hide completely
  • collapse both buttons into an expandable context/dropdown menu

from docs.

dimaMachina avatar dimaMachina commented on June 24, 2024

hide completely

disagree, useful feature, especially on mobile

collapse both buttons into an expandable context/dropdown menu

I think it's too overcomplicated for only 2 actions


As an another idea we can do approach similar as GitHub do but we'll lose some 44px for code-block content

image

from docs.

n1ru4l avatar n1ru4l commented on June 24, 2024

I rarely use the copy and line-break toggle on my phone, so I disagree that a context menu would be too complicated.

How often do people copy a code snippet on mobile, for me it makes most sense on a desktop where you want to run the example? It might be an acceptable trade-off to hide that button and only display the line break toggle.

The code area is already quite small due to all the vertical spacings, so the latter seems suboptimal.

Reducing the size of the buttons in the header and placing them next to each other could also be a possibility.

from docs.

dimaMachina avatar dimaMachina commented on June 24, 2024

How often do people copy a code snippet on mobile, for me it makes most sense on a desktop where you want to run the example? It might be an acceptable trade-off to hide that button and only display the line break toggle.

this is true, we already show Word wrap button only on mobile, so we can hide Copy button from mobile and put Word wrap there

Will be more minimalistic too for mobile devices

The code area is already quite small due to all the vertical spacings, so the latter seems suboptimal.

true too

Reducing the size of the buttons in the header and placing them next to each other could also be a possibility.

We can try to see how it looks like, but I would stay with putting word wrap button on copy button place

Accepted to be fixed in Nextra directly!

from docs.

dimaMachina avatar dimaMachina commented on June 24, 2024

@n1ru4l I've just thought that github approach will be perfect since if code block doesn't contain filename, copy code button will be in code block and not in its filename (and covering issue will still persist), so we can leave copy-code for mobile for now (since github has it on mobile too)

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.