Skip to content

Commit 7b8ff74

Browse files
committed
Convert styling to Tailwind
1 parent d5ace95 commit 7b8ff74

File tree

4 files changed

+28
-61
lines changed

4 files changed

+28
-61
lines changed

src/sidebar/components/Annotation/AnnotationPublishControl.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Icon, LabeledButton } from '@hypothesis/frontend-shared';
2+
import classnames from 'classnames';
23

34
import { useStoreProxy } from '../../store/use-store';
45
import { isNew, isReply } from '../../helpers/annotation-metadata';
@@ -72,16 +73,19 @@ function AnnotationPublishControl({
7273
);
7374

7475
const menuLabel = (
75-
<div className="annotation-publish-button__menu-label" style={buttonStyle}>
76+
<div className="p-2.5 text-color-text-inverted" style={buttonStyle}>
7677
<Icon name="expand-menu" />
7778
</div>
7879
);
7980

8081
return (
81-
<div className="hyp-u-layout-row hyp-u-horizontal-spacing--4">
82-
<div className="annotation-publish-button">
82+
<div className="flex flex-row gap-x-3">
83+
<div className="flex relative">
8384
<LabeledButton
84-
classes="PublishControlButton"
85+
classes={classnames(
86+
// Turn off right-side border radius to align with menu-open button
87+
'rounded-r-none'
88+
)}
8589
data-testid="publish-control-button"
8690
style={buttonStyle}
8791
onClick={onSave}
@@ -94,13 +98,24 @@ function AnnotationPublishControl({
9498
{/* This wrapper div is necessary because of peculiarities with
9599
Safari: see https://github.com/hypothesis/client/issues/2302 */}
96100
<div
97-
className="annotation-publish-button__menu-wrapper"
101+
className={classnames(
102+
// Round the right side of this menu-open button only
103+
'flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8'
104+
)}
98105
style={buttonStyle}
99106
>
100107
<Menu
101-
arrowClass="annotation-publish-button__menu-arrow"
108+
arrowClass={classnames(
109+
// Position up-pointing menu caret aligned beneath the
110+
// down-pointing menu-open button icon
111+
'right-[10px]'
112+
)}
102113
containerPositioned={false}
103-
contentClass="annotation-publish-button__menu-content"
114+
contentClass={classnames(
115+
// Ensure the menu is wide enough to "reach" the right-aligned
116+
// up-pointing menu arrow
117+
'min-w-full'
118+
)}
104119
label={menuLabel}
105120
menuIndicator={false}
106121
title="Change annotation sharing setting"
@@ -122,7 +137,12 @@ function AnnotationPublishControl({
122137
</div>
123138
</div>
124139
<div>
125-
<LabeledButton icon="cancel" onClick={onCancel} size="large">
140+
<LabeledButton
141+
classes="p-2.5"
142+
icon="cancel"
143+
onClick={onCancel}
144+
size="large"
145+
>
126146
Cancel
127147
</LabeledButton>
128148
</div>

src/styles/frontend-shared.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
text-decoration: underline;
1414
}
1515

16-
// Disable border-radius on right side so it can align with a button next to it
17-
.PublishControlButton {
18-
border-top-right-radius: 0;
19-
border-bottom-right-radius: 0;
20-
}
21-
2216
// This button style has asymmetrical padding. Hold it here to see if
2317
// this kind of padding is useful in other patterns.
2418
.PaginationPageButton {

src/styles/sidebar/components/AnnotationPublishControl.scss

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/styles/sidebar/components/_index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
// UI (Preact) Components
1414
// ----------
15-
@use './AnnotationPublishControl';
1615
@use './AnnotationShareControl';
1716
@use './AutocompleteList';
1817
@use './Excerpt';

0 commit comments

Comments
 (0)