Improve style pt. 1

This commit is contained in:
riggraz
2019-09-19 16:42:43 +02:00
parent 2b1fc213db
commit 409cdeef8a
19 changed files with 157 additions and 62 deletions

View File

@@ -142,8 +142,8 @@ class NewPost extends React.Component<Props, State> {
return (
<div className="newBoardContainer sidebarBox">
<TitleText>{board.name}</TitleText>
<MutedText>{board.description}</MutedText>
<span className="boardTitle">{board.name}</span>
<p><MutedText>{board.description}</MutedText></p>
{
isLoggedIn ?
<Button

View File

@@ -6,7 +6,7 @@ import PostListItem from './PostListItem';
import Spinner from '../shared/Spinner';
import {
DangerText,
MutedText,
CenteredMutedText,
} from '../shared/CustomTexts';
import IPost from '../../interfaces/IPost';
@@ -55,10 +55,7 @@ const PostList = ({
/>
))
:
areLoading ?
<MutedText>Loading...</MutedText>
:
<MutedText>There are no posts.</MutedText>
areLoading ? <p></p> : <CenteredMutedText>There are no posts.</CenteredMutedText>
}
</InfiniteScroll>
</div>

View File

@@ -16,7 +16,7 @@ interface Props {
const PostListItem = ({ id, title, description, postStatus}: Props) => (
<a href={`/posts/${id}`} className="postLink">
<div className="postListItem">
<TitleText>{title}</TitleText>
<span className="postTitle">{title}</span>
<DescriptionText limit={120}>{description}</DescriptionText>
<div className="postDetails">

View File

@@ -1,7 +1,7 @@
import * as React from 'react';
import PostListItem from './PostListItem';
import { MutedText } from '../shared/CustomTexts';
import { CenteredMutedText } from '../shared/CustomTexts';
import IPostJSON from '../../interfaces/json/IPost';
import IBoard from '../../interfaces/IBoard';
@@ -25,7 +25,7 @@ const PostList = ({ posts, boards }: Props) => (
/>
))
:
<MutedText>There are no posts that have this status.</MutedText>
<CenteredMutedText>There are no posts that have this status.</CenteredMutedText>
}
</div>
);

View File

@@ -14,10 +14,9 @@ interface Props {
}
const PostListByPostStatus = ({ postStatus, posts, boards }: Props) => (
<div className="roadmapColumn" style={{borderColor: postStatus.color}}>
<div className="roadmapColumn">
<div className="columnHeader"
style={{borderBottomColor: postStatus.color}}>
<div className="dot" style={{backgroundColor: postStatus.color}}></div>
style={{backgroundColor: postStatus.color}}>
<div className="columnTitle"><TitleText>{postStatus.name}</TitleText></div>
</div>
<div className="scrollContainer">

View File

@@ -11,7 +11,7 @@ interface Props {
const Button = ({ children, onClick, className = '', outline = false}: Props) => (
<button
onClick={onClick}
className={`${className} btn btn-${outline ? 'outline-' : ''}dark my-2`}
className={`${className} btn btn-${outline ? 'outline-' : ''}dark`}
>
{children}
</button>

View File

@@ -5,10 +5,7 @@ interface Props {
}
const CommentsNumber = ({ number }: Props) => (
<div className="d-flex">
<span className="comment icon"></span>
<span>{`${number} comment${number === 1 ? '' : 's'}`}</span>
</div>
<span className="badge badgeLight">{`${number} comment${number === 1 ? '' : 's'}`}</span>
);
export default CommentsNumber;

View File

@@ -17,6 +17,10 @@ export const MutedText = ({ children }: Props) => (
<span className="mutedText">{children}</span>
);
export const CenteredMutedText = ({ children }: Props) => (
<p className="centeredText"><span className="mutedText">{children}</span></p>
);
export const UppercaseText = ({ children }: Props) => (
<span className="uppercaseText">{children}</span>
);

View File

@@ -7,10 +7,7 @@ const PostStatusLabel = ({
name,
color,
}: IPostStatus) => (
<div style={{display: 'flex'}}>
<div className="dot" style={{backgroundColor: color}}></div>
<span className="postStatusName">{name}</span>
</div>
<span className="badge" style={{backgroundColor: color, color: 'white'}}>{name}</span>
);
export default PostStatusLabel;

View File

@@ -8,10 +8,11 @@
.sidebar {
position: sticky;
top: 20px;
top: 60px;
.sidebarBox {
width: 250px;
margin-right: 16px;
}
}
@@ -29,20 +30,27 @@
}
}
.newBoardContainer {
background-color: $astuto-grey;
text-align: center;
.boardTitle {
font-size: 25px;
font-weight: 600;
}
}
.sidebarBox {
@extend
.card,
.d-flex,
.flex-column,
.justify-content-start,
.align-items-center,
.flex-grow-0,
.flex-shrink-0;
border: thin solid black;
border-radius: 4px;
margin: 8px;
padding: 8px;
.flex-shrink-0,
.my-3,
.p-2;
}
.postStatusListItemContainer {
@@ -63,10 +71,12 @@
height: 40px;
&:hover {
filter: brightness(90%);
cursor: pointer;
}
background-color: #f5f5f5;
border-radius: 4px;
span.badge {
display: block; font-size: 15px;
}
}
@@ -74,6 +84,7 @@
@extend
.flex-grow-0,
.flex-shrink-0,
.rounded-circle,
.align-self-center,
.p-0;
@@ -89,33 +100,38 @@
}
.postLink {
@extend .my-3;
display: block;
border-radius: 4px;
margin: 8px 0;
color: black;
&:hover {
text-decoration: none;
background-color: #f5f5f5;
}
&:hover { text-decoration: none; }
}
.postListItem {
@extend
.card3D,
.d-flex,
.flex-column,
.justify-content-between,
.m-0,
.px-2,
.py-1;
.p-3;
height: 114px;
height: 140px;
}
.postTitle {
@extend
.font-weight-bold;
}
.postDetails {
@extend
.d-flex,
.justify-content-between,
.justify-content-start,
.text-uppercase;
.badge {
@extend .mr-2;
}
}
}

View File

@@ -8,9 +8,10 @@
@extend
.card,
.my-2,
.px-2;
.p-0;
width: 32%;
background-color: $astuto-grey;
@media (max-width: 800px) {
width: 100%;
@@ -20,27 +21,31 @@
.columnHeader {
@extend
.card-header,
.d-flex,
.bg-transparent;
.d-flex;
.columnTitle {
color: white;
}
}
.scrollContainer {
@extend
.card-body;
overflow-y: auto;
max-height: 350px;
}
.postLink:hover {
text-decoration: none;
.postLink {
@extend
.my-2;
&:hover { text-decoration: none; }
}
.postListItem {
@extend
.card3D,
.d-flex,
.flex-column,
.my-1,
.m-2,
.py-2;
}
}

View File

@@ -0,0 +1,2 @@
$astuto-grey: rgba(178, 178, 178, 0.15);
$muted-text-color: #6c757d;

View File

@@ -0,0 +1,37 @@
.card {
@extend .card;
box-shadow: 0 1px 1px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.15);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
color: #333;
padding: 8px;
}
.card3D {
@extend
.card;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover {
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
}
.badge {
@extend
.badge,
.badge-pill,
.p-2;
font-size: 13px;
}
.badgeLight {
@extend .badge-light;
background-color: $astuto-grey;
}

View File

@@ -5,14 +5,17 @@
.titleText {
@extend
.text-dark,
.font-weight-bolder;
}
.mutedText {
.centeredText {
@extend
.text-muted,
.text-center;
.text-center,
.p-2;
}
.mutedText {
color: $muted-text-color;
}
.uppercaseText {
@@ -20,6 +23,8 @@
.text-secondary,
.text-uppercase,
.font-weight-lighter;
font-size: 13px;
}
.successText {

View File

@@ -1,5 +1,3 @@
@import "node_modules/bootstrap/scss/variables";
.field_with_errors {
label {
color: $danger;
@@ -8,4 +6,9 @@
input {
border-color: $danger;
}
}
.form-control:focus {
border-color: $astuto-grey;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(0, 0, 0, 0.6);
}

View File

@@ -1,15 +1,44 @@
.navbar {
position: sticky;
z-index: 1;
top: 0px;
background-color: white;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: black;
border-bottom-color: rgba(0, 0, 0, 0.25);
margin-bottom: 1.5em;
box-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 1px 8px rgba(0,0,0,0.15);
margin-bottom: 1em;
.navbar-brand {
font-size: 18pt;
font-weight: 700;
}
.boardsNav {
@extend
.navbar-nav,
.nav-pills,
.d-flex,
.flex-row,
.mr-auto;
.nav-item {
@extend
.badge,
.text-uppercase;
a { @extend .text-dark; }
}
.nav-item.active {
@extend .badgeLight;
}
}
.fullname {
vertical-align: middle;

View File

@@ -1,5 +1,8 @@
@import 'vendors/bootstrap_custom';
@import 'constants/colors';
@import 'general/components';
@import 'general/custom_texts';
@import 'general/form';
@import 'general/icons';