Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(lsg): add styling to property enum and add spacing to property i…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
Tilman Frick committed Dec 15, 2017
1 parent 40e4d31 commit 590e21b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/lsg/patterns/property-items/boolean-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { colors } from '../../colors';
import { fonts } from '../../fonts';
import * as React from 'react';
import styled from 'styled-components';
import { getSpace, Size } from '../../space';

export interface BooleanItemProps {
label: string;
Expand All @@ -22,6 +23,8 @@ const StyledLabelWrapper = styled.label`
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: ${getSpace(Size.XXL)}px;
`;

const indicatorWidth = 18;
Expand Down
24 changes: 22 additions & 2 deletions src/lsg/patterns/property-items/enum-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ export interface EnumItemProps {
const StyledEnumItem = styled.div`
width: 100%;
`;

const StyledSelect = styled.select`
appearance: none;
border: none;
border-radius: 0;
font-size: 1em;
width: 100%;
font-family: ${fonts().NORMAL_FONT};
color: ${colors.grey36.toString()};
font-size: 15px;
border-bottom: 1px solid ${colors.grey70.toString()};
padding-bottom: ${getSpace(Size.M)/2}px;
margin-bottom: ${getSpace(Size.XXL)}px;
&:focus {
outline: none;
border-color: ${colors.blue.toString()};
color: ${colors.black.toString()};
}
`;

const StyledLabel = styled.span`
display: block;
Expand All @@ -32,7 +52,7 @@ export const EnumItem: React.StatelessComponent<EnumItemProps> = props => {
return (
<StyledEnumItem className={className}>
<StyledLabel>{label}</StyledLabel>
<select
<StyledSelect
className={className}
onChange={handleChange}
defaultValue={selectedValue ? selectedValue.getId() : ''}
Expand All @@ -43,7 +63,7 @@ export const EnumItem: React.StatelessComponent<EnumItemProps> = props => {
{value.getName()}
</option>
))};
</select>
</StyledSelect>
</StyledEnumItem>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/lsg/patterns/property-items/string-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const StyledInput = styled.input`
padding-bottom: ${getSpace(Size.M)/2}px;
color: ${colors.grey36.toString()};
margin-bottom: ${getSpace(Size.XXL)}px;
::-webkit-input-placeholder {
color: ${colors.grey70.toString()};
}
Expand Down

0 comments on commit 590e21b

Please sign in to comment.