From 409cdeef8abddbe5020f5b05f855d95e21438559 Mon Sep 17 00:00:00 2001 From: riggraz Date: Thu, 19 Sep 2019 16:42:43 +0200 Subject: [PATCH] Improve style pt. 1 --- app/javascript/components/Board/NewPost.tsx | 4 +- app/javascript/components/Board/PostList.tsx | 7 +-- .../components/Board/PostListItem.tsx | 2 +- .../components/Roadmap/PostList.tsx | 4 +- .../Roadmap/PostListByPostStatus.tsx | 5 +- app/javascript/components/shared/Button.tsx | 2 +- .../components/shared/CommentsNumber.tsx | 5 +- .../components/shared/CustomTexts.tsx | 4 ++ .../components/shared/PostStatusLabel.tsx | 5 +- .../stylesheets/components/Board.scss | 58 ++++++++++++------- .../stylesheets/components/Roadmap.scss | 23 +++++--- .../stylesheets/constants/_colors.scss | 2 + .../stylesheets/general/_components.scss | 37 ++++++++++++ .../stylesheets/general/_custom_texts.scss | 13 +++-- app/javascript/stylesheets/general/_form.scss | 7 ++- .../stylesheets/general/_navbar.scss | 33 ++++++++++- app/javascript/stylesheets/main.scss | 3 + app/views/layouts/_header.html.erb | 4 +- app/views/layouts/application.html.erb | 1 + 19 files changed, 157 insertions(+), 62 deletions(-) create mode 100644 app/javascript/stylesheets/constants/_colors.scss create mode 100644 app/javascript/stylesheets/general/_components.scss diff --git a/app/javascript/components/Board/NewPost.tsx b/app/javascript/components/Board/NewPost.tsx index 482eff6c..fb484488 100644 --- a/app/javascript/components/Board/NewPost.tsx +++ b/app/javascript/components/Board/NewPost.tsx @@ -142,8 +142,8 @@ class NewPost extends React.Component { return (
- {board.name} - {board.description} + {board.name} +

{board.description}

{ isLoggedIn ?
diff --git a/app/javascript/components/Board/PostListItem.tsx b/app/javascript/components/Board/PostListItem.tsx index 6c02b4c9..e2a77b38 100644 --- a/app/javascript/components/Board/PostListItem.tsx +++ b/app/javascript/components/Board/PostListItem.tsx @@ -16,7 +16,7 @@ interface Props { const PostListItem = ({ id, title, description, postStatus}: Props) => (
- {title} + {title} {description}
diff --git a/app/javascript/components/Roadmap/PostList.tsx b/app/javascript/components/Roadmap/PostList.tsx index e54fc6e4..b0d40fed 100644 --- a/app/javascript/components/Roadmap/PostList.tsx +++ b/app/javascript/components/Roadmap/PostList.tsx @@ -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) => ( /> )) : - There are no posts that have this status. + There are no posts that have this status. }
); diff --git a/app/javascript/components/Roadmap/PostListByPostStatus.tsx b/app/javascript/components/Roadmap/PostListByPostStatus.tsx index 0504b507..92ab477f 100644 --- a/app/javascript/components/Roadmap/PostListByPostStatus.tsx +++ b/app/javascript/components/Roadmap/PostListByPostStatus.tsx @@ -14,10 +14,9 @@ interface Props { } const PostListByPostStatus = ({ postStatus, posts, boards }: Props) => ( -
+
-
+ style={{backgroundColor: postStatus.color}}>
{postStatus.name}
diff --git a/app/javascript/components/shared/Button.tsx b/app/javascript/components/shared/Button.tsx index 55b3ace9..d4b79522 100644 --- a/app/javascript/components/shared/Button.tsx +++ b/app/javascript/components/shared/Button.tsx @@ -11,7 +11,7 @@ interface Props { const Button = ({ children, onClick, className = '', outline = false}: Props) => ( diff --git a/app/javascript/components/shared/CommentsNumber.tsx b/app/javascript/components/shared/CommentsNumber.tsx index fbf3a497..72fd0cdd 100644 --- a/app/javascript/components/shared/CommentsNumber.tsx +++ b/app/javascript/components/shared/CommentsNumber.tsx @@ -5,10 +5,7 @@ interface Props { } const CommentsNumber = ({ number }: Props) => ( -
- - {`${number} comment${number === 1 ? '' : 's'}`} -
+ {`${number} comment${number === 1 ? '' : 's'}`} ); export default CommentsNumber; \ No newline at end of file diff --git a/app/javascript/components/shared/CustomTexts.tsx b/app/javascript/components/shared/CustomTexts.tsx index acdad1d9..2f3fdf47 100644 --- a/app/javascript/components/shared/CustomTexts.tsx +++ b/app/javascript/components/shared/CustomTexts.tsx @@ -17,6 +17,10 @@ export const MutedText = ({ children }: Props) => ( {children} ); +export const CenteredMutedText = ({ children }: Props) => ( +

{children}

+); + export const UppercaseText = ({ children }: Props) => ( {children} ); diff --git a/app/javascript/components/shared/PostStatusLabel.tsx b/app/javascript/components/shared/PostStatusLabel.tsx index ddbe3f9c..58bc801e 100644 --- a/app/javascript/components/shared/PostStatusLabel.tsx +++ b/app/javascript/components/shared/PostStatusLabel.tsx @@ -7,10 +7,7 @@ const PostStatusLabel = ({ name, color, }: IPostStatus) => ( -
-
- {name} -
+ {name} ); export default PostStatusLabel; \ No newline at end of file diff --git a/app/javascript/stylesheets/components/Board.scss b/app/javascript/stylesheets/components/Board.scss index abb2c717..bae445c5 100644 --- a/app/javascript/stylesheets/components/Board.scss +++ b/app/javascript/stylesheets/components/Board.scss @@ -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; + } } } \ No newline at end of file diff --git a/app/javascript/stylesheets/components/Roadmap.scss b/app/javascript/stylesheets/components/Roadmap.scss index fc14fbc0..6e88103b 100644 --- a/app/javascript/stylesheets/components/Roadmap.scss +++ b/app/javascript/stylesheets/components/Roadmap.scss @@ -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; } } \ No newline at end of file diff --git a/app/javascript/stylesheets/constants/_colors.scss b/app/javascript/stylesheets/constants/_colors.scss new file mode 100644 index 00000000..2893fabb --- /dev/null +++ b/app/javascript/stylesheets/constants/_colors.scss @@ -0,0 +1,2 @@ +$astuto-grey: rgba(178, 178, 178, 0.15); +$muted-text-color: #6c757d; \ No newline at end of file diff --git a/app/javascript/stylesheets/general/_components.scss b/app/javascript/stylesheets/general/_components.scss new file mode 100644 index 00000000..35de4c6d --- /dev/null +++ b/app/javascript/stylesheets/general/_components.scss @@ -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; +} \ No newline at end of file diff --git a/app/javascript/stylesheets/general/_custom_texts.scss b/app/javascript/stylesheets/general/_custom_texts.scss index d81d44f7..52016505 100644 --- a/app/javascript/stylesheets/general/_custom_texts.scss +++ b/app/javascript/stylesheets/general/_custom_texts.scss @@ -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 { diff --git a/app/javascript/stylesheets/general/_form.scss b/app/javascript/stylesheets/general/_form.scss index 94d489ff..363728fc 100644 --- a/app/javascript/stylesheets/general/_form.scss +++ b/app/javascript/stylesheets/general/_form.scss @@ -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); } \ No newline at end of file diff --git a/app/javascript/stylesheets/general/_navbar.scss b/app/javascript/stylesheets/general/_navbar.scss index 7762a990..ce7f3f22 100644 --- a/app/javascript/stylesheets/general/_navbar.scss +++ b/app/javascript/stylesheets/general/_navbar.scss @@ -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; diff --git a/app/javascript/stylesheets/main.scss b/app/javascript/stylesheets/main.scss index 6b60134f..d76f2ed2 100644 --- a/app/javascript/stylesheets/main.scss +++ b/app/javascript/stylesheets/main.scss @@ -1,5 +1,8 @@ @import 'vendors/bootstrap_custom'; +@import 'constants/colors'; + +@import 'general/components'; @import 'general/custom_texts'; @import 'general/form'; @import 'general/icons'; diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 191e7c70..5afae5d8 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -6,12 +6,12 @@