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

fix(RTE): button text overflow #1173

Merged
merged 9 commits into from
Jan 23, 2025
5 changes: 5 additions & 0 deletions .changeset/curvy-steaks-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frontify/guideline-blocks-settings": patch
---

feat(RTE): prevent text overflow from button
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@

import { type CSSProperties } from 'react';

const DefaulButtonStyles: CSSProperties = {
ragi96 marked this conversation as resolved.
Show resolved Hide resolved
peter-tudosa marked this conversation as resolved.
Show resolved Hide resolved
marginTop: '10px',
marginBottom: '10px',
display: 'inline-block',
wordBreak: 'break-word',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%',
whiteSpace: 'nowrap',
ragi96 marked this conversation as resolved.
Show resolved Hide resolved
verticalAlign: 'middle',
boxSizing: 'border-box',
};

export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {
buttonPrimary: {
...DefaulButtonStyles,
peter-tudosa marked this conversation as resolved.
Show resolved Hide resolved
fontFamily: 'var(--f-theme-settings-button-primary-font-family)',
fontSize: 'var(--f-theme-settings-button-primary-font-size)',
fontWeight: 'var(--f-theme-settings-button-primary-font-weight)',
Expand All @@ -19,9 +33,7 @@ export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProp
borderRadius: 'var(--f-theme-settings-button-primary-border-radius)',
borderWidth: 'var(--f-theme-settings-button-primary-border-width)',
color: 'var(--f-theme-settings-button-primary-color)',
marginTop: '10px',
marginBottom: '10px',
display: 'inline-block',

hover: {
backgroundColor: 'var(--f-theme-settings-button-primary-background-color-hover)',
borderColor: 'var(--f-theme-settings-button-primary-border-color-hover)',
Expand All @@ -30,6 +42,7 @@ export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProp
},

buttonSecondary: {
...DefaulButtonStyles,
peter-tudosa marked this conversation as resolved.
Show resolved Hide resolved
fontFamily: 'var(--f-theme-settings-button-secondary-font-family)',
fontSize: 'var(--f-theme-settings-button-secondary-font-size)',
fontWeight: 'var(--f-theme-settings-button-secondary-font-weight)',
Expand All @@ -45,9 +58,6 @@ export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProp
borderRadius: 'var(--f-theme-settings-button-secondary-border-radius)',
borderWidth: 'var(--f-theme-settings-button-secondary-border-width)',
color: 'var(--f-theme-settings-button-secondary-color)',
display: 'inline-block',
marginTop: '10px',
marginBottom: '10px',
hover: {
backgroundColor: 'var(--f-theme-settings-button-secondary-background-color-hover)',
borderColor: 'var(--f-theme-settings-button-secondary-border-color-hover)',
Expand All @@ -56,6 +66,7 @@ export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProp
},

buttonTertiary: {
...DefaulButtonStyles,
peter-tudosa marked this conversation as resolved.
Show resolved Hide resolved
fontFamily: 'var(--f-theme-settings-button-tertiary-font-family)',
fontSize: 'var(--f-theme-settings-button-tertiary-font-size)',
fontWeight: 'var(--f-theme-settings-button-tertiary-font-weight)',
Expand All @@ -71,9 +82,6 @@ export const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProp
borderRadius: 'var(--f-theme-settings-button-tertiary-border-radius)',
borderWidth: 'var(--f-theme-settings-button-tertiary-border-width)',
color: 'var(--f-theme-settings-button-tertiary-color)',
display: 'inline-block',
marginTop: '10px',
marginBottom: '10px',
hover: {
backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color-hover)',
borderColor: 'var(--f-theme-settings-button-tertiary-border-color-hover)',
Expand Down
Loading