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

Make font weights available as names #6740

Open
Enyium opened this issue Nov 8, 2024 · 1 comment
Open

Make font weights available as names #6740

Enyium opened this issue Nov 8, 2024 · 1 comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request

Comments

@Enyium
Copy link
Contributor

Enyium commented Nov 8, 2024

font-weight: 700; for bold etc. is not so intuitive. Would a new global singleton similar to Palette be the right kind of container for a set of constants? Then you could write font-weight: FontWeights.bold;. A table of weight–name mappings is available on MDN.

@FloVanGH FloVanGH added a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request labels Nov 11, 2024
@FloVanGH
Copy link
Member

Hi,
yeah I have also though about it. What I have in mind is to provide a global for text style related stuff check #3687 (similar to Palette for brushes. There I would like to also provide font-weight` as property.

Like

export global Typography {
      out property <TextStyle> body: { ... };
      out property <TextStyle> header: { ... };
      out property <float> font-weight-bold: 700;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants