Skip to content

Commit 7c9bc86

Browse files
committed
Renamed folder, added container, sample.json
1 parent e18a0f2 commit 7c9bc86

33 files changed

+142
-28
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
2+
{
3+
"name": "SPFx 1.18.0",
4+
"image": "docker.io/m365pnp/spfx:1.18.0",
5+
// Set *default* container specific settings.json values on container create.
6+
"settings": {},
7+
// Add the IDs of extensions you want installed when the container is created.
8+
"extensions": [
9+
"editorconfig.editorconfig",
10+
"dbaeumer.vscode-eslint"
11+
],
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
"forwardPorts": [
14+
4321,
15+
35729
16+
],
17+
"portsAttributes": {
18+
"4321": {
19+
"protocol": "https",
20+
"label": "Manifest",
21+
"onAutoForward": "silent",
22+
"requireLocalPort": true
23+
},
24+
// Not needed for SPFx>= 1.12.1
25+
// "5432": {
26+
// "protocol": "https",
27+
// "label": "Workbench",
28+
// "onAutoForward": "silent"
29+
// },
30+
"35729": {
31+
"protocol": "https",
32+
"label": "LiveReload",
33+
"onAutoForward": "silent",
34+
"requireLocalPort": true
35+
}
36+
},
37+
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
38+
"remoteUser": "node"
39+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
echo
2+
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
3+
npm install
4+
5+
## commands to create dev certificate and copy it to the root folder of the project
6+
echo
7+
echo -e "\e[1;94mGenerating dev certificate\e[0m"
8+
gulp trust-dev-cert
9+
10+
# Convert the generated PEM certificate to a CER certificate
11+
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
12+
13+
# Copy the PEM ecrtificate for non-Windows hosts
14+
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
15+
16+
## add *.cer to .gitignore to prevent certificates from being saved in repo
17+
if ! grep -Fxq '*.cer' ./.gitignore
18+
then
19+
echo "# .CER Certificates" >> .gitignore
20+
echo "*.cer" >> .gitignore
21+
fi
22+
23+
## add *.pem to .gitignore to prevent certificates from being saved in repo
24+
if ! grep -Fxq '*.pem' ./.gitignore
25+
then
26+
echo "# .PEM Certificates" >> .gitignore
27+
echo "*.pem" >> .gitignore
28+
fi
29+
30+
echo
31+
echo -e "\e[1;92mReady!\e[0m"
32+
33+
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"

samples/react-tailwindcss3/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.18.2

samples/tailwindcss3/README.md renamed to samples/react-tailwindcss3/README.md

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ Here is an illustration of the styling outcome achieved with Tailwind, along wit
1010
![Code](assets/code.png)
1111

1212
To setup Tailwind on your existing project, proceed with the following steps:
13+
1314
1. Execute the following commands:
14-
- `npm i -D tailwindcss postcss autoprefixer gulp-postcss`
15-
- `npx tailwindcss init`
15+
- `npm i -D react-tailwindcss postcss autoprefixer gulp-postcss`
16+
- `npx react-tailwindcss init`
1617
2. Add the following files:
1718
- /assets/tailwind.css
1819
- postcss.config.js
19-
- tailwind.config.js
20+
- tailwind.config.js
2021
3. Update the following files:
2122
- gulpfile.js
2223
- Check the changes in this project
@@ -41,14 +42,14 @@ This sample is optimally compatible with the following environment configuration
4142

4243
## Applies to
4344

44-
* [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
45-
* [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
45+
- [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
46+
- [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
4647

47-
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/m365devprogram)
48+
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](https://aka.ms/m365devprogram)
4849
4950
## Contributors
5051

51-
* [Ari Gunawan](https://github.com/AriGunawan)
52+
- [Ari Gunawan](https://github.com/AriGunawan)
5253

5354
## Version history
5455

@@ -58,42 +59,32 @@ Version|Date|Comments
5859

5960
## Minimal path to awesome
6061

61-
* Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/tailwindcss3) then unzip it)
62-
* From your command line, change your current directory to the directory containing this sample (`tailwindcss3`, located under `samples`)
63-
* in the command line run:
64-
* `npm install`
65-
* `gulp serve`
62+
- Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-tailwindcss3) then unzip it)
63+
- From your command line, change your current directory to the directory containing this sample (`react-tailwindcss3`, located under `samples`)
64+
- in the command line run:
65+
- `npm install`
66+
- `gulp serve`
6667

6768
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit <https://aka.ms/spfx-devcontainer> for further instructions.
6869
69-
<!--
70-
RESERVED FOR REPO MAINTAINERS
71-
72-
We'll add the video from the community call recording here
73-
74-
## Video
75-
76-
[![YouTube video title](./assets/video-thumbnail.jpg)](https://www.youtube.com/watch?v=XXXXX "YouTube video title")
77-
-->
78-
7970
## Help
8071

8172
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
8273

8374
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
8475

85-
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20tailwindcss3%22) to see if anybody else is having the same issues.
76+
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20react-tailwindcss3%22) to see if anybody else is having the same issues.
8677

87-
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=tailwindcss3) and see what the community is saying.
78+
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=react-tailwindcss3) and see what the community is saying.
8879

89-
If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20tailwindcss3&template=bug-report.yml&sample=tailwindcss3&authors=@AriGunawan&title=tailwindcss3%20-%20).
80+
If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20react-tailwindcss3&template=bug-report.yml&sample=react-tailwindcss3&authors=@AriGunawan&title=react-tailwindcss3%20-%20).
9081

91-
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20tailwindcss3&template=question.yml&sample=tailwindcss3&authors=@AriGunawan&title=tailwindcss3%20-%20).
82+
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20react-tailwindcss3&template=question.yml&sample=react-tailwindcss3&authors=@AriGunawan&title=react-tailwindcss3%20-%20).
9283

93-
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20tailwindcss3&template=suggestion.yml&sample=tailwindcss3&authors=@AriGunawan&title=tailwindcss3%20-%20).
84+
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20react-tailwindcss3&template=suggestion.yml&sample=react-tailwindcss3&authors=@AriGunawan&title=react-tailwindcss3%20-%20).
9485

9586
## Disclaimer
9687

9788
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
9889

99-
<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/tailwindcss3" />
90+
<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/react-tailwindcss3" />
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"name": "pnp-sp-dev-spfx-web-parts-react-tailwindcss",
4+
"source": "pnp",
5+
"title": "Tailwind 3",
6+
"shortDescription": "This project showcases an integration of Tailwind CSS into an SPFx project.",
7+
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-tailwindcss",
8+
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-tailwindcss",
9+
"longDescription": [
10+
"This project showcases an integration of Tailwind CSS into an SPFx project. It offers a sample implementation, facilitating straightforward setup and utilization of Tailwind CSS for enhanced styling and design in SharePoint Framework projects."
11+
],
12+
"creationDateTime": "2023-10-07",
13+
"updateDateTime": "2023-10-07",
14+
"products": [
15+
"SharePoint"
16+
],
17+
"metadata": [
18+
{
19+
"key": "CLIENT-SIDE-DEV",
20+
"value": "React"
21+
},
22+
{
23+
"key": "SPFX-VERSION",
24+
"value": "1.18.0"
25+
}
26+
],
27+
"thumbnails": [
28+
{
29+
"type": "image",
30+
"order": 100,
31+
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-tailwindcss/assets/example.png",
32+
"alt": "Web Part Preview"
33+
}
34+
],
35+
"authors": [
36+
{
37+
"gitHubAccount": "AriGunawan",
38+
"pictureUrl": "https://github.com/AriGunawan.png",
39+
"name": "Ari Gunawan"
40+
}
41+
],
42+
"references": [
43+
{
44+
"name": "Build your first SharePoint client-side web part",
45+
"description": "Client-side web parts are client-side components that run in the context of a SharePoint page. Client-side web parts can be deployed to SharePoint environments that support the SharePoint Framework. You can also use modern JavaScript web frameworks, tools, and libraries to build them.",
46+
"url": "https://docs.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"
47+
}
48+
]
49+
}
50+
]

0 commit comments

Comments
 (0)