Skip to content

Commit

Permalink
Fix toggle height (and thus vertical alignment) in panel section header
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Nov 14, 2023
1 parent e117e19 commit 41b8508
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/controls/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import React from "react";
import styled from 'styled-components';
import { SidebarSubtitle } from "./styles";

const ToggleContainer = styled.div`
// Same as ToggleBackground, necessary for panel toggles.
height: 21px;
`

const ToggleBackground = styled.label`
position: relative;
display: inline-block;
Expand Down Expand Up @@ -72,7 +77,7 @@ const Toggle = ({display, on, callback, label, style={}}) => {
if (!display) return null;

return (
<div style={style}>
<ToggleContainer style={style}>
<ToggleBackground>
<Input type="checkbox" checked={on} onChange={callback}/>
<Slider/>
Expand All @@ -82,7 +87,7 @@ const Toggle = ({display, on, callback, label, style={}}) => {
</ToggleSubtitle>
)}
</ToggleBackground>
</div>
</ToggleContainer>
);
};

Expand Down

0 comments on commit 41b8508

Please sign in to comment.