Commit c97e8c8a authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Remove dependency on rounded_corners feature flag

parent 846a18ff
import classnames from 'classnames'; import classnames from 'classnames';
import { useEffect, useLayoutEffect, useMemo } from 'preact/hooks'; import { useEffect, useMemo } from 'preact/hooks';
import { confirm } from '../../shared/prompts'; import { confirm } from '../../shared/prompts';
import type { SidebarSettings } from '../../types/config'; import type { SidebarSettings } from '../../types/config';
...@@ -49,20 +49,6 @@ function HypothesisApp({ ...@@ -49,20 +49,6 @@ function HypothesisApp({
const route = store.route(); const route = store.route();
const isModalRoute = route === 'notebook' || route === 'profile'; const isModalRoute = route === 'notebook' || route === 'profile';
const roundedCornersEnabled = store.isFeatureEnabled('rounded_corners');
useLayoutEffect(() => {
const html = document.querySelector('html');
html?.style.setProperty(
'--h-border-radius',
roundedCornersEnabled ? '0.25rem' : null,
);
html?.style.setProperty(
'--h-border-radius-lg',
roundedCornersEnabled ? '0.5rem' : null,
);
}, [roundedCornersEnabled]);
const backgroundStyle = useMemo( const backgroundStyle = useMemo(
() => applyTheme(['appBackgroundColor'], settings), () => applyTheme(['appBackgroundColor'], settings),
[settings], [settings],
......
...@@ -142,24 +142,6 @@ describe('HypothesisApp', () => { ...@@ -142,24 +142,6 @@ describe('HypothesisApp', () => {
}); });
}); });
[true, false].forEach(roundedCornersEnabled => {
it('defines border-radius CSS vars when the feature flag is enabled', () => {
fakeStore.isFeatureEnabled.returns(roundedCornersEnabled);
createComponent();
const styles = document.querySelector('html')?.style;
assert.equal(
styles.getPropertyValue('--h-border-radius'),
roundedCornersEnabled ? '0.25rem' : '',
);
assert.equal(
styles.getPropertyValue('--h-border-radius-lg'),
roundedCornersEnabled ? '0.5rem' : '',
);
});
});
describe('auto-opening tutorial', () => { describe('auto-opening tutorial', () => {
it('should open tutorial on profile load when criteria are met', () => { it('should open tutorial on profile load when criteria are met', () => {
fakeShouldAutoDisplayTutorial.returns(true); fakeShouldAutoDisplayTutorial.returns(true);
......
...@@ -9,14 +9,4 @@ export default { ...@@ -9,14 +9,4 @@ export default {
// This module references `sidebar-frame` and related classes // This module references `sidebar-frame` and related classes
'./src/annotator/sidebar.{js,ts,tsx}', './src/annotator/sidebar.{js,ts,tsx}',
], ],
theme: {
extend: {
borderRadius: {
// Equivalent to tailwind defaults, but overriding values from frontend-shared preset
// Once the preset stops defining borderRadius, we can remove this
DEFAULT: '0.25rem',
lg: '0.5rem',
},
}
}
}; };
...@@ -24,6 +24,12 @@ export default { ...@@ -24,6 +24,12 @@ export default {
'pulse-fade-out': 'pulse-fade-out 5s ease-in-out forwards', 'pulse-fade-out': 'pulse-fade-out 5s ease-in-out forwards',
'slide-in-from-right': 'slide-in-from-right 0.3s forwards ease-in-out', 'slide-in-from-right': 'slide-in-from-right 0.3s forwards ease-in-out',
}, },
borderRadius: {
// Equivalent to tailwind defaults, but overriding values from frontend-shared preset
// Once the preset stops defining borderRadius, we can remove this
DEFAULT: '0.25rem',
lg: '0.5rem',
},
boxShadow: { boxShadow: {
// A more prominent shadow than the one used by tailwind, intended for // A more prominent shadow than the one used by tailwind, intended for
// popovers and menus // popovers and menus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment