Skip to content

Commit

Permalink
demo for issue 219
Browse files Browse the repository at this point in the history
  • Loading branch information
francoismassart committed Mar 2, 2023
1 parent 564944e commit a5a6fb9
Show file tree
Hide file tree
Showing 20 changed files with 754 additions and 10 deletions.
20 changes: 17 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
module.exports = {
"root": true,
"extends": [
root: true,
extends: [
"plugin:tailwindcss/recommended"
]
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.js'],
parser: '@typescript-eslint/parser',
},
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
},
{
files: ['*.html', '*.blade.php'],
parser: '@angular-eslint/template-parser',
}
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
/dist
.DS_Store
9 changes: 9 additions & 0 deletions apps/app-one/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

module.exports = {
settings: {
tailwindcss: {
config: path.join(__dirname, "tailwind.config-one.js"),
}
}
};
File renamed without changes.
2 changes: 1 addition & 1 deletion src/demo.html → apps/app-one/src/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>tailwindcss/classnames-order</h2>
</section>
<section>
<h2>tailwindcss/no-custom-classname</h2>
<p class="container custom text-yolo">Only tailwind classes please</p>
<p class="container custom text-one text-two">Only tailwind classes please</p>
</section>
<section>
<h2>tailwindcss/no-contradicting-classname</h2>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tailwind.config.js → apps/app-one/tailwind.config-one.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
theme: {
extend: {
colors: {
yolo: '#B4D455'
one: '#B4D455'
}
},
},
Expand Down
9 changes: 9 additions & 0 deletions apps/app-two/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

module.exports = {
settings: {
tailwindcss: {
config: path.join(__dirname, "tailwind.config-two.js"),
}
}
};
9 changes: 9 additions & 0 deletions apps/app-two/src/demo.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@if ($errors->any())
<p class="lg:inline-block mt-2 mt-0 text-sm leading-5 text-red-600 inline">
{{ $errors->first() }}
</p>
@endif @if (session()->has('status'))
<p class="flex flex-shrink mt-2 mb-2 text-sm leading-5 text-gray-900 custom">
{{ session('status') }}
</p>
@endif
22 changes: 22 additions & 0 deletions apps/app-two/src/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>demo.html</title>
</head>
<body>
<h1>Hello eslint-plugin-tailwindcss</h1>
<section>
<h2>tailwindcss/classnames-order</h2>
<p class="m-0 flex p-0">Invalid classnames order</p>
<p class="flex w-12 lg:w-4 sm:w-6">Invalid classnames order in variants</p>
</section>
<section>
<h2>tailwindcss/no-custom-classname</h2>
<p class="container custom text-one text-two">Only tailwind classes please</p>
</section>
<section>
<h2>tailwindcss/no-contradicting-classname</h2>
<p class="p-2 m-0 m-2 m-5">Two different values for margin</p>
</section>
</body>
</html>
7 changes: 7 additions & 0 deletions apps/app-two/src/demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

export const MyComponent = () => {
return <section className={'flex w-12 lg:w-4 sm:w-6 container custom'}>
<h1 className={'p-2 m-0 m-2 m-5'}>Hello tsx</h1>
</section>
}
65 changes: 65 additions & 0 deletions apps/app-two/src/demo.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% extends "_base/layout" %}

{% set media = entry.media.with([['media:image', { withTransforms: ['media'] }]]).all() %}

{% block content %}
<section class="relative pt-100">
<div class="absolute inset-0 bg-gradient-to-b from-gray-100 via-gray-100 to-white">
<div class="custom absolute w-full h-full opacity-40 bg-cover bg-center" style="background-image: url('/dist/assets/img/pattern.svg')"></div>
</div>
</section>

<section class="mb-150">
<div class="relative w-5/6 mx-auto">
<div class="flex flex-wrap">
{% block sidebar %}
{% endblock %}
<div class="w-full lg:w-2/3 xl:w-3/4 max-w-5xl pt-50 pt-0" data-aos="fade-up" data-aos-delay="150">
<h1 class="font-heading font-bold leading-none uppercase text-2xl md:text-3xl lg:text-4xl xl:text-5xl" data-aos="fade-up">
{{ entry.title }}
</h1>

<div class="wysiwyg mt-25">
{{ entry.text|raw }}
</div>

{% if media|length %}
<div data-controller="gallery">
{% for item in media %}
{% set image = item.image[0] ?? null %}
{% set url = item.video ?? image.url %}
<a
href="{{ url }}"
{% if item.video %}
data-src="https://www.youtube-nocookie.com/embed/{{ url|youtubeCode }}"
{% else %}
data-src="{{ url }}"
{% endif %}
class="relative bg-white block pt-9/16 overflow-hidden group mt-50"
data-aos="fade-up"
>
{% if item.video %}
<div class="absolute z-20 bottom-0 left-0 flex items-center pointer-events-none p-30 font-heading text-sm uppercase text-white">
Bekijk video
{{ svg('@webroot/dist/assets/img/arrow.svg')|attr({ class: 'text-gray-200 transition ml-10 group-hover:translate-x-10' }) }}
</div>
<div class="absolute z-10 inset-0 bg-gradient-to-b from-transparent to-black opacity-50 pointer-events-none"></div>
{% endif %}
{% if image %}
<img
src="{{ image.getUrl('media') }}"
class="absolute inset-0 h-full w-full object-cover hover:scale-110 transition duration-500"
alt="">
{% endif %}
</a>
{% endfor %}
</div>
{% endif %}

{% block extra %}
{% endblock %}
</div>
</div>
</div>
</section>
{% endblock %}
22 changes: 22 additions & 0 deletions apps/app-two/src/demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script>
export default {
data() {
return {
count: 0
}
}
}
</script>

<template>
<div class="container sm:w-3 sm:w-4 lg:w-6">
<h1>Vue SFC</h1>
<button @click="count++">Count is: {{ count }}</button>
</div>
</template>

<style scoped>
button {
font-weight: bold;
}
</style>
3 changes: 3 additions & 0 deletions apps/app-two/src/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
12 changes: 12 additions & 0 deletions apps/app-two/tailwind.config-two.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{php,html,tsx,vue}"],
theme: {
extend: {
colors: {
two: '#B4D455'
}
},
},
plugins: [],
}
Loading

0 comments on commit a5a6fb9

Please sign in to comment.