Skip to content

Commit 4f38a70

Browse files
Merge pull request #1 from Charlytoc/main
Working with tailwind at exercise 1.4
2 parents 4a5b85b + 813d544 commit 4f38a70

File tree

4 files changed

+59
-49
lines changed

4 files changed

+59
-49
lines changed

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3+
{
4+
"name": "Node.js",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-16",
7+
"customizations": {
8+
"vscode": {
9+
"settings": {
10+
"editor.defaultFormatter": "esbenp.prettier-vscode",
11+
"workbench.editorAssociations": {
12+
"*.md": "vscode.markdown.preview.editor"
13+
}
14+
},
15+
"extensions": ["learn-pack.learnpack-vscode"]
16+
}
17+
},
18+
19+
// Features to add to the dev container. More info: https://containers.dev/features.
20+
// "features": {},
21+
22+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
23+
// "forwardPorts": [],
24+
25+
"onCreateCommand": "npm i jest@29.7.0 -g && npm i jest-environment-jsdom@29.7.0 -g && npm i @learnpack/learnpack@5.0.29 -g && learnpack plugins:install @learnpack/react"
26+
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
// "postCreateCommand": "yarn install",
29+
30+
// Configure tool-specific properties.
31+
// "customizations": {},
32+
33+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "root"
35+
}

.learn/resets/01.1-applying-tailwind-in-react-components/app.jsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

.learn/vscode_queue.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
// Advanced Tailwind Techniques in React
2-
//
3-
// In this exercise, you will create a React component that demonstrates the use of advanced Tailwind CSS features.
4-
//
5-
// Instructions:
6-
// 1. Create a React component that includes a button and an icon.
7-
// 2. Apply Tailwind pseudo-classes to change the button's background color on hover and focus.
8-
// 3. Add an animation to the icon using Tailwind's animation utilities.
9-
// 4. Ensure the component is responsive and looks good on both mobile and desktop screens.
10-
//
11-
// Example:
12-
// - Use `hover:bg-green-500` and `focus:bg-green-700` for the button.
13-
// - Apply `animate-bounce` to the icon.
14-
//
15-
// Start coding below:
1+
// index.js
2+
import React from "react";
3+
import ReactDOM from "react-dom";
164

17-
import React from 'react';
5+
const script = document.createElement("script");
6+
script.src = "https://cdn.tailwindcss.com";
7+
script.onload = () => {
8+
ReactDOM.render(<AdvancedTailwindComponent />, document.getElementById("myDiv"));
9+
};
10+
document.head.appendChild(script);
1811

1912
function AdvancedTailwindComponent() {
20-
return (
21-
<div className="flex flex-col items-center justify-center min-h-screen">
22-
{/* Add your button here */}
23-
{/* Add your icon here */}
24-
</div>
25-
);
13+
return (
14+
<div className="flex flex-col items-center justify-center min-h-screen p-4 sm:p-0">
15+
<button className="bg-green-400 hover:bg-green-500 focus:bg-green-700 text-white px-4 py-2 rounded transition-colors">Press me</button>
16+
<svg
17+
width={20}
18+
height={20}
19+
xmlns="http://www.w3.org/2000/svg"
20+
className="mt-6 w-12 h-12 text-green-600 animate-bounce"
21+
fill="none"
22+
viewBox="0 0 24 24"
23+
stroke="currentColor">
24+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
25+
</svg>
26+
</div>
27+
);
2628
}
27-
28-
export default AdvancedTailwindComponent;

0 commit comments

Comments
 (0)