Skip to content

Commit 997fc5d

Browse files
authored
Merge pull request #11 from Craftserve/quo/komponent-textarea-z-figmy
feature: Textarea component
2 parents ec4ec2e + 776bb3f commit 997fc5d

File tree

3 files changed

+58
-17
lines changed

3 files changed

+58
-17
lines changed

src/components/Textarea.astro

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
import type { JSX } from 'astro/jsx-runtime';
3+
4+
type textareaProps = JSX.IntrinsicElements['textarea'];
5+
6+
const props = Astro.props as textareaProps;
7+
---
8+
<div class="textarea-container">
9+
<textarea {...props} />
10+
</div>
11+
<style>
12+
13+
textarea {
14+
outline: 0;
15+
border: 0;
16+
font-size: 16px;
17+
padding: 8px;
18+
font-family: var(--ubuntu);
19+
resize: none;
20+
overflow-wrap: break-word;
21+
white-space: pre-wrap;
22+
}
23+
24+
.textarea-container {
25+
display: flex;
26+
justify-content: center;
27+
align-items: center;
28+
outline: var(--placeholder);
29+
color: var(--placeholder);
30+
border: none;
31+
border-bottom: 2px var(--placeholder) solid;
32+
caret-color: var(--placeholder);
33+
transition: all 0.3s ease-in-out;
34+
}
35+
36+
.textarea-container:focus-within {
37+
outline: var(--primary);
38+
color: black;
39+
border: none;
40+
border-bottom: 2px var(--primary) solid;
41+
caret-color: var(--primary);
42+
}
43+
</style>

src/pages/en/index.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Offers from '../../sections/Offers.astro';
77
import Carousel from '../../sections/Carousel.astro';
88
import Icons from '../../sections/Icons.astro';
99
import Table from '../../sections/Table.astro';
10-
import Input from '../../components/Input.astro';
1110
1211
// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
1312
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
@@ -21,7 +20,6 @@ import Input from '../../components/Input.astro';
2120
<Icons />
2221
<Table />
2322
<Carousel />
24-
<Input type="email" id="test" placeholder="[email protected]"/>
2523
</Layout>
2624

2725
<style>

src/pages/index.astro

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
2-
import Footer from "../sections/Footer.astro";
3-
import Navbar from "../sections/Navbar.astro";
4-
import Layout from "../layouts/Layout.astro";
5-
import Hero from "../sections/Hero.astro";
6-
import Offers from "../sections/Offers.astro";
7-
import Icons from "../sections/Icons.astro";
8-
import Carousel from "../sections/Carousel.astro";
9-
import Table from "../sections/Table.astro";
2+
import Footer from '../sections/Footer.astro';
3+
import Navbar from '../sections/Navbar.astro';
4+
import Layout from '../layouts/Layout.astro';
5+
import Hero from '../sections/Hero.astro';
6+
import Offers from '../sections/Offers.astro';
7+
import Icons from '../sections/Icons.astro';
8+
import Carousel from '../sections/Carousel.astro';
9+
import Table from '../sections/Table.astro';
1010
1111
// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
1212
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
1313
---
1414

1515
<Layout>
16-
<div class="infoContainer">
17-
<Hero />
18-
<Offers />
19-
</div>
20-
<Icons />
21-
<Table />
22-
<Carousel />
16+
<div class="infoContainer">
17+
<Hero />
18+
<Offers />
19+
</div>
20+
<Icons />
21+
<Table />
22+
<Carousel />
2323
</Layout>
2424

2525
<style>

0 commit comments

Comments
 (0)