a11y: Option to always underline links in posts

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2021-07-28 16:03:14 +02:00
parent 38ad49c1e6
commit 193b326d15
7 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,7 @@ export const defaultSettings = ImmutableMap({
skinTone: 1, skinTone: 1,
reduceMotion: false, reduceMotion: false,
underlineLinks: false,
autoPlayGif: true, autoPlayGif: true,
displayMedia: 'default', displayMedia: 'default',
expandSpoilers: false, expandSpoilers: false,

View File

@ -48,6 +48,7 @@ const mapStateToProps = (state) => {
showIntroduction, showIntroduction,
me, me,
reduceMotion: settings.get('reduceMotion'), reduceMotion: settings.get('reduceMotion'),
underlineLinks: settings.get('underlineLinks'),
systemFont: settings.get('systemFont'), systemFont: settings.get('systemFont'),
dyslexicFont: settings.get('dyslexicFont'), dyslexicFont: settings.get('dyslexicFont'),
demetricator: settings.get('demetricator'), demetricator: settings.get('demetricator'),
@ -66,6 +67,7 @@ class SoapboxMount extends React.PureComponent {
showIntroduction: PropTypes.bool, showIntroduction: PropTypes.bool,
me: SoapboxPropTypes.me, me: SoapboxPropTypes.me,
reduceMotion: PropTypes.bool, reduceMotion: PropTypes.bool,
underlineLinks: PropTypes.bool,
systemFont: PropTypes.bool, systemFont: PropTypes.bool,
dyslexicFont: PropTypes.bool, dyslexicFont: PropTypes.bool,
demetricator: PropTypes.bool, demetricator: PropTypes.bool,
@ -117,6 +119,7 @@ class SoapboxMount extends React.PureComponent {
const bodyClass = classNames('app-body', `theme-mode-${this.props.themeMode}`, { const bodyClass = classNames('app-body', `theme-mode-${this.props.themeMode}`, {
'system-font': this.props.systemFont, 'system-font': this.props.systemFont,
'no-reduce-motion': !this.props.reduceMotion, 'no-reduce-motion': !this.props.reduceMotion,
'underline-links': this.props.underlineLinks,
'dyslexic': this.props.dyslexicFont, 'dyslexic': this.props.dyslexicFont,
'demetricator': this.props.demetricator, 'demetricator': this.props.demetricator,
'halloween': this.props.halloween, 'halloween': this.props.halloween,

View File

@ -221,6 +221,10 @@ class Preferences extends ImmutablePureComponent {
label={<FormattedMessage id='preferences.fields.reduce_motion_label' defaultMessage='Reduce motion in animations' />} label={<FormattedMessage id='preferences.fields.reduce_motion_label' defaultMessage='Reduce motion in animations' />}
path={['reduceMotion']} path={['reduceMotion']}
/> />
<SettingsCheckbox
label={<FormattedMessage id='preferences.fields.underline_links_label' defaultMessage='Always underline links in posts' />}
path={['underlineLinks']}
/>
<SettingsCheckbox <SettingsCheckbox
label={<FormattedMessage id='preferences.fields.system_font_label' defaultMessage="Use system's default font" />} label={<FormattedMessage id='preferences.fields.system_font_label' defaultMessage="Use system's default font" />}
path={['systemFont']} path={['systemFont']}

View File

@ -11,6 +11,7 @@ export default function SitePreview({ soapbox }) {
const bodyClass = classNames('site-preview app-body', `theme-mode-${settings.get('themeMode')}`, { const bodyClass = classNames('site-preview app-body', `theme-mode-${settings.get('themeMode')}`, {
'system-font': settings.get('systemFont'), 'system-font': settings.get('systemFont'),
'no-reduce-motion': !settings.get('reduceMotion'), 'no-reduce-motion': !settings.get('reduceMotion'),
'underline-links': settings.get('underlineLinks'),
'dyslexic': settings.get('dyslexicFont'), 'dyslexic': settings.get('dyslexicFont'),
'demetricator': settings.get('demetricator'), 'demetricator': settings.get('demetricator'),
'halloween': settings.get('halloween'), 'halloween': settings.get('halloween'),

View File

@ -544,6 +544,7 @@
"preferences.fields.privacy_label": "Prywatność wpisów", "preferences.fields.privacy_label": "Prywatność wpisów",
"preferences.fields.reduce_motion_label": "Ogranicz ruch w animacjach", "preferences.fields.reduce_motion_label": "Ogranicz ruch w animacjach",
"preferences.fields.system_font_label": "Używaj domyślnej czcionki systemu", "preferences.fields.system_font_label": "Używaj domyślnej czcionki systemu",
"preferences.fields.underline_links_label": "Zawsze podkreślaj odnośniki we wpisach",
"preferences.fields.unfollow_modal_label": "Pokazuj prośbę o potwierdzenie przed cofnięciem obserwacji", "preferences.fields.unfollow_modal_label": "Pokazuj prośbę o potwierdzenie przed cofnięciem obserwacji",
"preferences.hints.content_type_markdown": "Ostrzeżenie: eksperymentalne!", "preferences.hints.content_type_markdown": "Ostrzeżenie: eksperymentalne!",
"preferences.hints.demetricator": "Ogranicz uzależnienie od mediów społecznościowych ukrywając wszystkie liczby ze strony.", "preferences.hints.demetricator": "Ogranicz uzależnienie od mediów społecznościowych ukrywając wszystkie liczby ze strony.",

View File

@ -460,6 +460,15 @@
} }
} }
.underline-links {
.status__content,
.reply-indicator__content {
a {
text-decoration: underline;
}
}
}
.focusable { .focusable {
&:focus { &:focus {
outline: 0; outline: 0;

View File

@ -450,6 +450,7 @@ If it's not documented, it's because I inherited it from Mastodon and I don't kn
} }
], ],
systemFont: false, systemFont: false,
underlineLinks: false,
home: { home: {
regex: { regex: {
body: '' body: ''