Skip to content

Commit 9fa60b1

Browse files
authored
Merge pull request #5 from MathisBurger/dev
merge to v1.0.1
2 parents 697c531 + 898a60e commit 9fa60b1

File tree

9 files changed

+178
-1
lines changed

9 files changed

+178
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ main.css
33
chocolate.min.css
44
chocolate.css
55
index.html
6+
scripts.zip

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ Check out the easy to use documentation and play arround with it.
7070
- <a href="documentation/flex.md">Flex</a>
7171
- <a href="documentation/navbar.md">Navbar</a>
7272
- <a href="documentation/sidebar.md">Sidebar</a>
73+
- <a href="documentation/cards.md">Cards</a>
7374
- <a href="documentation/scripts.md">Scripts</a>

cards/card.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.card {
2+
border-radius: 10px;
3+
overflow: hidden;
4+
}
5+
6+
.card-body {
7+
margin-top: 3%;
8+
width: 100%;
9+
}

cards/responsive.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "sizes.scss";
2+
@import "../screen-sizes.scss";
3+
4+
@media only screen and (max-width: $sm) {
5+
.card-sm {
6+
transform: scale(0.75);
7+
}
8+
.card-md {
9+
transform: scale(0.75);
10+
}
11+
.card-lg {
12+
transform: scale(0.73);
13+
}
14+
}
15+
16+
@media only screen and (max-width: $md) {
17+
.card-sm {
18+
transform: scale(0.90);
19+
}
20+
.card-md {
21+
transform: scale(0.90);
22+
}
23+
.card-lg {
24+
transform: scale(0.90);
25+
}
26+
}

cards/sizes.scss

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@import "card.scss";
2+
3+
.card-sm {
4+
@extend .card;
5+
width: 400px;
6+
height: 200px;
7+
}
8+
9+
.card-sm .card-heading {
10+
font-size: 1.3em;
11+
}
12+
13+
.card-sm .card-body {
14+
font-size: 0.8em;
15+
}
16+
17+
.card-md {
18+
@extend .card;
19+
width: 450px;
20+
height: 550px;
21+
}
22+
23+
.card-md .card-heading {
24+
font-size: 2em;
25+
}
26+
27+
.card-md .card-body {
28+
font-size: 1em;
29+
}
30+
31+
.card-lg {
32+
@extend .card;
33+
width: 600px;
34+
height: 750px;
35+
}
36+
37+
.card-lg .card-heading {
38+
font-size: 3.5em;
39+
}
40+
41+
.card-lg .card-body {
42+
font-size: 1.2em;
43+
}

cards/theme.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@import "card.scss";
2+
3+
@mixin cardTheme($class-name, $bg-color, $shadow-color, $text-color) {
4+
5+
.card.#{$class-name} {
6+
background: $bg-color;
7+
box-shadow: 1px 1px 1px $shadow-color;
8+
transition: .3s;
9+
}
10+
11+
.card.#{$class-name}:hover {
12+
filter: brightness(1.1);
13+
box-shadow: 3px 3px 3px $shadow-color;
14+
}
15+
16+
.card.#{$class-name} .card-heading {
17+
font-family: "Roboto", sans-serif;
18+
color: $text-color;
19+
text-align: center;
20+
word-wrap: normal;
21+
}
22+
23+
.card.#{$class-name} .card-body {
24+
color: $text-color;
25+
text-align: center;
26+
font-family: "Roboto", sans-serif;
27+
word-wrap: normal;
28+
}
29+
}

documentation/cards.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Card documentation
2+
3+
This part of the documentation will show you how to use the cards<br>
4+
of ChocolateCSS.
5+
6+
# Basic usage
7+
8+
Using the cards of ChocolateCSS is as easy as using the other components.
9+
10+
```html
11+
<div class="card-md card-dark">
12+
<div class="card-heading">Heading</div>
13+
<div class="card-body">
14+
Some example text.
15+
</div>
16+
</div>
17+
```
18+
19+
The other `div` tag defines the card. The main class `div-md`
20+
defines the size of the card.
21+
22+
There are three different card-sizes.
23+
24+
- `card-sm`
25+
- `card-md`
26+
- `card-lg`
27+
28+
<strong>NOTE:</strong> The size of the card changes, if you are resizing the window or using another device.
29+
30+
The `card-dark` defines the theme of the card. There are three different themes.
31+
32+
- `card-light`
33+
- `card-grey`
34+
- `card-dark`
35+
36+
37+
# Heading
38+
39+
Every card has its own heading. You can use it by putting following line of code into your main `card` div.
40+
41+
```html
42+
<div class="card-heading">Heading</div>
43+
```
44+
45+
The size of the heading depends on the size of the card.
46+
47+
48+
# Card body
49+
50+
The card body contains the main content of the card.
51+
52+
```html
53+
<div class="card-body">
54+
Card content
55+
</div>
56+
```

main.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
@import "./flex/row.scss";
2222
@import "./flex/constants.scss";
2323

24+
// Card
25+
@import "./cards/sizes.scss";
26+
@import "./cards/theme.scss";
27+
@import "./cards/responsive.scss";
28+
2429

2530

2631
// Buttons
@@ -51,4 +56,9 @@
5156
// Flex row
5257
@include rowShape(row-sm, $sm);
5358
@include rowShape(row-md, $md);
54-
@include rowShape(row-lg, $lg);
59+
@include rowShape(row-lg, $lg);
60+
61+
// Card
62+
@include cardTheme(card-light, #fff, rgba(0,0,0,0.4), #000);
63+
@include cardTheme(card-grey, #303030, rgba(0,0,0,0.6), #fff);
64+
@include cardTheme(card-dark, #161616, rgba(0,0,0,0.6), #fff);

screen-sizes.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$sm: 680px;
2+
$md: 1100px;

0 commit comments

Comments
 (0)