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

Feature request: style the :guilabel: role #277

Closed
wkschwartz opened this issue Oct 29, 2020 · 5 comments · Fixed by #278
Closed

Feature request: style the :guilabel: role #277

wkschwartz opened this issue Oct 29, 2020 · 5 comments · Fixed by #278

Comments

@wkschwartz
Copy link

As is visible on the demo site, the :guilabel: role has no styling different from normal paragraph text, leaving it hard to tell that it's different.

@choldgraf
Copy link
Collaborator

choldgraf commented Oct 29, 2020

could you give an example of how this role is used? E.g. what would be some minimal rST that highlight the use of this role? Is it meant to look like a button or something?

alternatively - could you propose some CSS rules that would make it look as you would expect it to look?

@wkschwartz
Copy link
Author

From the docs:

Labels presented as part of an interactive user interface should be marked using guilabel. This includes labels from text-based interfaces such as those created using curses or other text-based libraries. Any label used in the interface should be marked with this role, including button labels, window titles, field names, menu and menu selection names, and even values in selection lists.

Changed in version 1.0: An accelerator key for the GUI label can be included using an ampersand; this will be stripped and displayed underlined in the output (example: :guilabel:`&Cancel`). To include a literal ampersand, double it.

Here's an excerpt from how I'm using it to explain how to install MSVC:

One way to install it is to `download the Build Tools installer`_,
run it, select :guilabel:`C++ build tools` in the :guilabel:`Workloads` tab,
and click :guilabel:`Install`.

.. _download the Build Tools installer: 
   https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16

The Sphinx Read The Docs theme has the same demo site, rendered here, as pydata-sphinx-theme. The former's rendering of :guilabel: looks good ot me, but I don't know nothin' about colors and stuff. The CSS they use (and I have adopted as a stopgap in the meantime) is something like this

.guilabel {
	border: 1px solid #7fbbe3;
	background: #e7f2fa;
	font-size: 80%;
	font-weight: 700;
	border-radius: 4px;
	padding: 2.4px 6px;
	margin: auto 2px;
}

@choldgraf
Copy link
Collaborator

choldgraf commented Oct 29, 2020

ah very cool! thanks for pointing to the RTD docs, I always forget those exist but they are super helpful 👍

and thanks for the suggestion, it is much appreciated!

@wkschwartz
Copy link
Author

To be clear, there's also a distinct :menuselection: role. For example, I probably could have written

One way to install it is to `download the Build Tools installer`_,
run it, select :menuselection:`Workloads --> C++ build tools`,
and click :guilabel:`Install`.

@choldgraf
Copy link
Collaborator

nice - I've added the CSS you suggested here: #278

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

Successfully merging a pull request may close this issue.

2 participants