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

TextBox and PasswordBox Font styles are incorrect #1379

Open
5 tasks done
NVLudwig opened this issue Apr 4, 2024 · 9 comments
Open
5 tasks done

TextBox and PasswordBox Font styles are incorrect #1379

NVLudwig opened this issue Apr 4, 2024 · 9 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@NVLudwig
Copy link

NVLudwig commented Apr 4, 2024

Current behavior

TextBox and PasswordBox currently use BodyMedium ressource. This causes font overrides to fail as the Figma file uses BodyLarge in line with current Material specs
image

Expected behavior

TextBox and PasswordBox should use BodyLarge ressource

How to reproduce it (as minimally and precisely as possible)

Try and apply a font override by selecting and editing the font style for a TextBox or PasswordBox

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • UWP
  • MacOS

Anything else we need to know?

All text input controls probably have this issue AutoSuggest etc

@NVLudwig NVLudwig added the kind/bug Something isn't working label Apr 4, 2024
@kazo0
Copy link
Collaborator

kazo0 commented Apr 5, 2024

@NVLudwig

I believe they are already using BodyLarge typography values:

<StaticResource x:Key="OutlinedTextBoxFontFamily" ResourceKey="BodyLargeFontFamily" />
<StaticResource x:Key="OutlinedTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
<StaticResource x:Key="OutlinedTextBoxFontSize" ResourceKey="BodyLargeFontSize" />
<StaticResource x:Key="OutlinedTextBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />
<StaticResource x:Key="FilledTextBoxFontFamily" ResourceKey="BodyLargeFontFamily" />
<StaticResource x:Key="FilledTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
<StaticResource x:Key="FilledTextBoxFontSize" ResourceKey="BodyLargeFontSize" />

https://platform.uno/docs/articles/external/uno.themes/doc/styles/TextBox.html

<StaticResource x:Key="FilledPasswordBoxFontFamily" ResourceKey="BodyLargeFontFamily" />
<StaticResource x:Key="FilledPasswordBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
<StaticResource x:Key="FilledPasswordBoxFontSize" ResourceKey="BodyLargeFontSize" />
<StaticResource x:Key="FilledPasswordBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />

https://platform.uno/docs/articles/external/uno.themes/doc/styles/PasswordBox.html

@NVLudwig
Copy link
Author

NVLudwig commented Apr 5, 2024

hmmm...something is wrong: in Figma if I override the fontFamily for BodyMedium the render in the plugin of a textbox gets updated with the desired override. But if I override BodyLarge no change is applyed in the plugin preview. this is what led us to assume themes was not off...what else can this be then? CC @carldebilly

@kazo0
Copy link
Collaborator

kazo0 commented Apr 5, 2024

This is the problem I was mentioning before where we have intermediary aliases for the typography resources for some controls so overriding the origin resource won't affect aliases of that resource so we need to be referencing them directly

@carldebilly
Copy link
Member

@kazo0, the override is working correctly... it's just not connect to the right resource.

Right now, in Figma, the FontFamily used for the TextBox is BodyLarge but overriding it doesn't affect the TextBox. But if we change the BodyMedium FontFamily, it will affect the TextBox.

That means the Material TextBox is wrongly connected to the BodyMedium resource when it should be connected to the BodyLarge one.

@kazo0
Copy link
Collaborator

kazo0 commented Apr 8, 2024

@carldebilly / @NVLudwig

Not sure I'm understanding, If I override the BodyLargeFontFamily to Ribeye, it is reflected in the TextBox, no?

image

image

@NVLudwig
Copy link
Author

NVLudwig commented Apr 9, 2024

Not working here in Prod desktop with the following

Uno Figma Plugin v3.0.2
Uno.UI v5.1.56
Uno.Themes v4.1.1
Uno.Toolkit.WinUI v5.1.7
Uno.Extensions v4.0.5

image

And not working in QA desktop either
Uno Figma Plugin v3.1.0-dev.66
Uno.UI v5.2.7
Uno.Themes v5.0.1
Uno.Toolkit.WinUI v6.0.2
Uno.Extensions v4.1.1
image

@carldebilly
Copy link
Member

carldebilly commented Apr 9, 2024

Ooohh @kazo0 is right! We were confusing the Label (Empty placeholder) with the content.

So that's ok, it works :-) But it looks like some variants in Figma are not using the right text style for labels.

image

@kazo0
Copy link
Collaborator

kazo0 commented Apr 9, 2024

Ahh, I see. Yeah because technically the "Label" when the field is empty is the header label just scaled up/down. Once this PR is finally unblocked, we can address this and use the proper font typography resource for the header/placeholder separately.

@carldebilly
Copy link
Member

Temporary solution:

  • Use "Body Large" for the placeholder instead of relying on "Body Medium" as of right now
  • Adjust the scaling factor to mimick the "body small" when used as a the label (while waiting for the PR to fix label vs placeholder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants