How to Upgrade Tailwind CSS Projects from v2 to v3

Upgrading to Tailwind CSS v3.0

In this video, I'll walk you through the most important steps when upgrading an existing project to Tailwind CSS v3.0.

We'll update our dependencies, set up the content configuration for the new Just-in-Time engine, migrate to the updated color palette, and more.

Chapters:

00:00 Introduction
00:46 Upgrade packages
01:35 Remove dark mode configuration
02:28 Remove variant configuration
03:05 Configure content sources
05:12 Always use complete class names
07:15 Safelist classes if needed
08:35 Color palette changes
11:40 Outline utility changes
13:05 Class name changes
13:41 Always include the base layer
14:13 Outro


Upgrading your Tailwind CSS projects from v2 to v3.

Tailwind CSS v3.0 is a major update to the framework with a brand new internal engine and as such includes a small number of breaking changes.

We take stability very seriously and have worked hard to make any breaking changes as painless as possible.

Upgrade packages

Update Tailwind, as well as PostCSS and autoprefixer, using npm:

npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

Note that Tailwind CSS v3.0 requires PostCSS 8, and no longer supports PostCSS 7. If you can’t upgrade to PostCSS 8, we recommend using Tailwind CLI instead of installing Tailwind as a PostCSS plugin.

Official plugins

All of our first-party plugins have been updated for compatibility with v3.0.

If you’re using any of our plugins, make sure to update them all to the latest version at the same time to avoid version constraint errors.

npm install -D tailwindcss@latest \
  @tailwindcss/typography@latest \
  @tailwindcss/forms@latest \
  @tailwindcss/aspect-ratio@latest \
  @tailwindcss/line-clamp@latest \
  postcss@latest \
  autoprefixer@latest

Play CDN

For Tailwind CSS v3.0, the CSS-based CDN build we’ve offered in the past has been replaced by the new Play CDN, which gives you the full power of the new engine right in the browser with no build step.

To try it out, throw this <script> tag in your <head>:

<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0" />    <title>Example</title>    <script src="https://cdn.tailwindcss.com"></script>  </head>  <body>    <!-- -->  </body></html>

The Play CDN is designed for development purposes only — compiling your own static CSS build is a much better choice in production.

Migrating to the JIT engine

The new Just-in-Time engine we announced in March has replaced the classic engine in Tailwind CSS v3.0.

The new engine generates the styles you need for your project on-demand, and might necessitate some small changes to your project depending on how you have Tailwind configured.

If you were already opting in to mode: 'jit' in Tailwind CSS v2.x, you can safely remove that from your configuration in v3.0:

tailwind.config.js

module.exports = {  mode: 'jit',  // ...}

Configure content sources

Since Tailwind no longer uses PurgeCSS under the hood, we’ve renamed the purge option to content to better reflect what it’s for:

tailwind.config.js

module.exports = {  purge: [  content: [    // Example content paths...    './public/**/*.html',    './src/**/*.{js,jsx,ts,tsx,vue}',  ],  theme: {    // ...  }  // ...}

If you weren’t already using the purge option in your project, it’s crucial that you configure your template paths now or your compiled CSS will be empty.

Since we’re not using PurgeCSS under the hood anymore, some of the advanced purge options have changed. See the new content configuration documentation for more information on advanced options.

Remove dark mode configuration

The dark mode feature is now enabled using the media strategy by default, so you can remove this key entirely from your tailwind.config.js file, unless you’re using the class strategy.

tailwind.config.js

module.exports = {  darkMode: 'media',  // ...}

You can also safely remove this key if it’s currently set to false:

tailwind.config.js

module.exports = {  darkMode: false,  // ...}

Remove variant configuration

In Tailwind CSS v3.0, every variant is automatically available for every utility by default, so you can remove the variants section from your tailwind.config.js file:

tailwind.config.js

module.exports = {  // ...  variants: {    extend: {      padding: ['hover'],    }  },}

Replace @variants with @layer

Since all variants are now enabled by default, you no longer need to explicity enable these for custom CSS using the @variants or @responsive directives.

Instead, add any custom CSS to appropriate “layer” using the @layer directive:

 @variants hover, focus { @layer utilities {   .content-auto {     content-visibility: auto;   } }

Any custom CSS added to one of Tailwind’s layers will automatically support variants.

See the documentation on adding custom styles using CSS and @layer for more information.

Automatic transforms and filters

In Tailwind CSS v3.0, transform and filter utilities like scale-50 and brightness-75 will automatically take effect without needing to add the transform, filter, or backdrop-filter classes:

<div class="transform scale-50 filter grayscale backdrop-filter backdrop-blur-sm"><div class="scale-50 grayscale backdrop-blur-sm">

While there’s no harm in leaving them in your HTML, they can safely be removed.

Color palette changes

Tailwind CSS v3.0 now includes every color from the extended color palette by default, including previously disabled colors like cyan, rose, fuchsia, and lime, and all five variations of gray.

Removed color aliases

In v2.0, several of the default colors were actually aliases for the extended colors:

v2 Defaultv2 Extended
greenemerald
yellowamber
purpleviolet

In v3.0, these colors use their extended names by default, so what was previously bg-green-500 is now bg-emerald-500, and bg-green-500 now refers to the green from the extended palette.

If you’re using these colors in your project, the simplest way to upgrade is to alias them back to their previous names in your tailwind.config.js file:

tailwind.config.js

const colors = require('tailwindcss/colors')
module.exports = {  theme: {    extend: {      colors: {        green: colors.emerald,        yellow: colors.amber,        purple: colors.violet,      }    },  },  // ...}

If you are already using a custom color palette, this change doesn’t impact you at all.

Renamed gray scales

As part of enabling all of the extended colors by default, we’ve given the different gray shades shorter single-word names to make them more practical to use and make it less awkward for them to co-exist at the same time.

v2 Defaultv2 Extendedv3 Unified
N/AblueGrayslate
graycoolGraygray
N/Agrayzinc
N/AtrueGrayneutral
N/AwarmGraystone

If you were referencing any of the extended grays, you should update your references to the new names, for example:

tailwind.config.js

const colors = require('tailwindcss/colors')
module.exports = {  theme: {    extend: {      colors: {        gray: colors.trueGray,        gray: colors.neutral,      }    },  },  // ...}

If you weren’t referencing any of the grays from the extended color palette, this change doesn’t impact you at all.

Class name changes

Some class names in Tailwind CSS v3.0 have changed to avoid naming collisions, improve the developer experience, or make it possible to support new features.

Wherever possible we have preserved the old name as well so many of these changes are non-breaking, but you’re encouraged to update to the new class names.

overflow-clip/ellipsis

Those damn browser developers added a real overflow: clip property, so using overflow-clip for text-overflow: clip is a really bad idea now.

We’ve renamed overflow-clip to text-clip, and renamed overflow-ellipsis to text-ellipsis to avoid the naming collision:

<div class="overflow-clip overflow-ellipsis"><div class="text-clip text-ellipsis">

This is extremely unlikely to affect anyone, as there are very few use-cases for text-clip and it’s only really included for the sake of completion.

flex-grow/shrink

We’ve added grow-* and shrink-* as aliases for flex-grow-* and flex-shrink-*:

<div class="flex-grow-0 flex-shrink"><div class="grow-0 shrink">

The old class names will always work but you’re encouraged to update to the new ones.

outline-black/white

Since browsers are finally starting to respect border radius when rendering outlines, we’ve added separate utilities for the outline-style, outline-color, outline-width and outline-offset properties.

This means that outline-white and outline-black now only set the outline color, whereas in v2 they set the color, width, style, and offset.

If you are using outline-white or outline-black in your project, you can bring back the old styles by adding the following custom CSS to your project:

@layer utilities {
  .outline-black {
    outline: 2px dotted black;
    outline-offset: 2px;
  }

  .outline-white {
    outline: 2px dotted white;
    outline-offset: 2px;
  }
}

Alternatively, you can update any usage of them in your CSS with the following classes:

<div class="outline-black"><div class="outline-black outline-2 outline-dotted outline-offset-2">
<div class="outline-white"><div class="outline-white outline-2 outline-dotted outline-offset-2">

decoration-clone/slice

We’ve added box-decoration-clone and box-decoration-slice as aliases for decoration-clone and decoration-slice to avoid confusion with all of the new text-decoration utilities that use the decoration- namespace:

<div class="decoration-clone"></div><div class="box-decoration-clone"></div>
<div class="decoration-slice"></div><div class="box-decoration-slice"></div>

The old class names will always work but you’re encouraged to update to the new ones.

Other minor changes

Tailwind CSS v3.0 necessitates a couple of other small breaking changes that are unlikely to affect many people, but have been captured here.

Separator cannot be a dash

The dash (-) character cannot be used as a custom separator in v3.0 because of a parsing ambiguity it introduces in the engine.

You’ll have to switch to another character like _ instead:

tailwind.config.js

module.exports = {  // ...  separator: '-',  separator: '_',}

Prefix cannot be a function

Prior to Tailwind CSS v3.0, it was possible to define your class prefix as a function:

tailwind.config.js

module.exports = {
  // ...
  prefix(selector) {
    // ...
  },
}

This isn’t possible in the new engine and we’ve had to remove support for this feature.

Instead, use a static prefix that is the same for every class Tailwind generates:

tailwind.config.js

module.exports = {
  // ...
  prefix: 'tw-',
}

File modifier order reversed

Super minor change since v3.0.0-alpha.2 where the file modifier was introduced — if you were combining it with other modifiers like hover or focus, you’ll need to flip the modifier order:

<input class="file:hover:bg-blue-600 ..."><input class="hover:file:bg-blue-600 ...">

Learn more in the ordering stacked modifiers documentation.

Fill and stroke use color palette

The fill-{color} and stroke-{color} utilities mirror your theme.colors key by default now. This isn’t a breaking change if you haven’t customized your color palette, but if you have, the fill-current and stroke-current classes may not work if you don’t have current included in your own custom color palette.

Add current to your custom color palette to resolve this:

tailwind.config.js

module.exports = {  // ...  theme: {    colors: {      current: 'currentColor',      // ...    }  }}

Negative values removed

The negative prefix in utilites like -mx-4 is a first class feature in Tailwind now, rather than something driven by your theme, so you can add - in front of any utility that support negative values and it will just work.

The negative values have been removed from the default theme, so if you were referencing them with theme(), you will see an error when trying to compile your CSS.

Use the calc() function to update any affected code:

.my-class {  top: theme('top.-4')  top: calc(theme('top.4') * -1)}

Base layer must be present

In Tailwind CSS v3.0, the @tailwind base directive must be present for utilities like transforms, filters, and shadows to work as expected.

If you were previously disabling Tailwind’s base styles by not including this directive, you should add it back and disable preflight in your corePlugins configuration instead:

main.css

 @tailwind base; @tailwind components; @tailwind utilities;

tailwind.config.js

module.exports = {  // ...  corePlugins: {    preflight: false,  },}

This will disable Tailwind’s global base styles without affecting utilities that rely on adding their own base styles to function correctly.

Screens layer has been renamed

The @tailwind screens layer has been renamed to @tailwind variants:

main.css

 /* ... */ @tailwind screens; @tailwind variants;

I think you are more likely to be attacked by a shark while working at your desk than you are to be affected by this change.

#tailwindcss #taiwlind #css #webdev #programming #developer 

What is GEEK

Buddha Community

How to Upgrade Tailwind CSS Projects from v2 to v3
Autumn  Blick

Autumn Blick

1593867420

Top Android Projects with Source Code

Android Projects with Source Code – Your entry pass into the world of Android

Hello Everyone, welcome to this article, which is going to be really important to all those who’re in dilemma for their projects and the project submissions. This article is also going to help you if you’re an enthusiast looking forward to explore and enhance your Android skills. The reason is that we’re here to provide you the best ideas of Android Project with source code that you can choose as per your choice.

These project ideas are simple suggestions to help you deal with the difficulty of choosing the correct projects. In this article, we’ll see the project ideas from beginners level and later we’ll move on to intermediate to advance.

top android projects with source code

Android Projects with Source Code

Before working on real-time projects, it is recommended to create a sample hello world project in android studio and get a flavor of project creation as well as execution: Create your first android project

Android Projects for beginners

1. Calculator

build a simple calculator app in android studio source code

Android Project: A calculator will be an easy application if you have just learned Android and coding for Java. This Application will simply take the input values and the operation to be performed from the users. After taking the input it’ll return the results to them on the screen. This is a really easy application and doesn’t need use of any particular package.

To make a calculator you’d need Android IDE, Kotlin/Java for coding, and for layout of your application, you’d need XML or JSON. For this, coding would be the same as that in any language, but in the form of an application. Not to forget creating a calculator initially will increase your logical thinking.

Once the user installs the calculator, they’re ready to use it even without the internet. They’ll enter the values, and the application will show them the value after performing the given operations on the entered operands.

Source Code: Simple Calculator Project

2. A Reminder App

Android Project: This is a good project for beginners. A Reminder App can help you set reminders for different events that you have throughout the day. It’ll help you stay updated with all your tasks for the day. It can be useful for all those who are not so good at organizing their plans and forget easily. This would be a simple application just whose task would be just to remind you of something at a particular time.

To make a Reminder App you need to code in Kotlin/Java and design the layout using XML or JSON. For the functionality of the app, you’d need to make use of AlarmManager Class and Notifications in Android.

In this, the user would be able to set reminders and time in the application. Users can schedule reminders that would remind them to drink water again and again throughout the day. Or to remind them of their medications.

3. Quiz Application

Android Project: Another beginner’s level project Idea can be a Quiz Application in android. Here you can provide the users with Quiz on various general knowledge topics. These practices will ensure that you’re able to set the layouts properly and slowly increase your pace of learning the Android application development. In this you’ll learn to use various Layout components at the same time understanding them better.

To make a quiz application you’ll need to code in Java and set layouts using xml or java whichever you prefer. You can also use JSON for the layouts whichever preferable.

In the app, questions would be asked and answers would be shown as multiple choices. The user selects the answer and gets shown on the screen if the answers are correct. In the end the final marks would be shown to the users.

4. Simple Tic-Tac-Toe

android project tic tac toe game app

Android Project: Tic-Tac-Toe is a nice game, I guess most of you all are well aware of it. This will be a game for two players. In this android game, users would be putting X and O in the given 9 parts of a box one by one. The first player to arrange X or O in an adjacent line of three wins.

To build this game, you’d need Java and XML for Android Studio. And simply apply the logic on that. This game will have a set of three matches. So, it’ll also have a scoreboard. This scoreboard will show the final result at the end of one complete set.

Upon entering the game they’ll enter their names. And that’s when the game begins. They’ll touch one of the empty boxes present there and get their turn one by one. At the end of the game, there would be a winner declared.

Source Code: Tic Tac Toe Game Project

5. Stopwatch

Android Project: A stopwatch is another simple android project idea that will work the same as a normal handheld timepiece that measures the time elapsed between its activation and deactivation. This application will have three buttons that are: start, stop, and hold.

This application would need to use Java and XML. For this application, we need to set the timer properly as it is initially set to milliseconds, and that should be converted to minutes and then hours properly. The users can use this application and all they’d need to do is, start the stopwatch and then stop it when they are done. They can also pause the timer and continue it again when they like.

6. To Do App

Android Project: This is another very simple project idea for you as a beginner. This application as the name suggests will be a To-Do list holding app. It’ll store the users schedules and their upcoming meetings or events. In this application, users will be enabled to write their important notes as well. To make it safe, provide a login page before the user can access it.

So, this app will have a login page, sign-up page, logout system, and the area to write their tasks, events, or important notes. You can build it in android studio using Java and XML at ease. Using XML you can build the user interface as user-friendly as you can. And to store the users’ data, you can use SQLite enabling the users to even delete the data permanently.

Now for users, they will sign up and get access to the write section. Here the users can note down the things and store them permanently. Users can also alter the data or delete them. Finally, they can logout and also, login again and again whenever they like.

7. Roman to decimal converter

Android Project: This app is aimed at the conversion of Roman numbers to their significant decimal number. It’ll help to check the meaning of the roman numbers. Moreover, it will be easy to develop and will help you get your hands on coding and Android.

You need to use Android Studio, Java for coding and XML for interface. The application will take input from the users and convert them to decimal. Once it converts the Roman no. into decimal, it will show the results on the screen.

The users are supposed to just enter the Roman Number and they’ll get the decimal values on the screen. This can be a good android project for final year students.

8. Virtual Dice Roller

Android Project: Well, coming to this part that is Virtual Dice or a random no. generator. It is another simple but interesting app for computer science students. The only task that it would need to do would be to generate a number randomly. This can help people who’re often confused between two or more things.

Using a simple random number generator you can actually create something as good as this. All you’d need to do is get you hands-on OnClick listeners. And a good layout would be cherry on the cake.

The user’s task would be to set the range of the numbers and then click on the roll button. And the app will show them a randomly generated number. Isn’t it interesting ? Try soon!

9. A Scientific Calculator App

Android Project: This application is very important for you as a beginner as it will let you use your logical thinking and improve your programming skills. This is a scientific calculator that will help the users to do various calculations at ease.

To make this application you’d need to use Android Studio. Here you’d need to use arithmetic logics for the calculations. The user would need to give input to the application that will be in terms of numbers. After that, the user will give the operator as an input. Then the Application will calculate and generate the result on the user screen.

10. SMS App

Android Project: An SMS app is another easy but effective idea. It will let you send the SMS to various no. just in the same way as you use the default messaging application in your phone. This project will help you with better understanding of SMSManager in Android.

For this application, you would need to implement Java class SMSManager in Android. For the Layout you can use XML or JSON. Implementing SMSManager into the app is an easy task, so you would love this.

The user would be provided with the facility to text to whichever number they wish also, they’d be able to choose the numbers from the contact list. Another thing would be the Textbox, where they’ll enter their message. Once the message is entered they can happily click on the send button.

#android tutorials #android application final year project #android mini projects #android project for beginners #android project ideas #android project ideas for beginners #android projects #android projects for students #android projects with source code #android topics list #intermediate android projects #real-time android projects

Rylan  Becker

Rylan Becker

1618420560

Tailwind CSS v2.1 is now released

Tailwind v2.1 was just released with a new JIT Engine, Filter and Backdrop-filter Utilities, and more. Let’s take a look at some of the new features.

JIT Engine

A few weeks ago, the Tailwind team released a package they were using to expiriment with a just-in-time compiler for Tailwind. With the release of Tailwind v2.1, the JIT compiler is included in Tailwind core. Just add mode: 'jit' to your Tailwind config file and configure the purge property to scan your markup.

#news #tailwind #tailwind css #tailwind css v2.1

Shawn  Durgan

Shawn Durgan

1595547778

10 Writing steps to create a good project brief - Mobile app development

Developing a mobile application can often be more challenging than it seems at first glance. Whether you’re a developer, UI designer, project lead or CEO of a mobile-based startup, writing good project briefs prior to development is pivotal. According to Tech Jury, 87% of smartphone users spend time exclusively on mobile apps, with 18-24-year-olds spending 66% of total digital time on mobile apps. Of that, 89% of the time is spent on just 18 apps depending on individual users’ preferences, making proper app planning crucial for success.

Today’s audiences know what they want and don’t want in their mobile apps, encouraging teams to carefully write their project plans before they approach development. But how do you properly write a mobile app development brief without sacrificing your vision and staying within the initial budget? Why should you do so in the first place? Let’s discuss that and more in greater detail.

Why a Good Mobile App Project Brief Matters?

Why-a-Good-Mobile-App-Project-Brief-Matters

It’s worth discussing the significance of mobile app project briefs before we tackle the writing process itself. In practice, a project brief is used as a reference tool for developers to remain focused on the client’s deliverables. Approaching the development process without written and approved documentation can lead to drastic, last-minute changes, misunderstanding, as well as a loss of resources and brand reputation.

For example, developing a mobile app that filters restaurants based on food type, such as Happy Cow, means that developers should stay focused on it. Knowing that such and such features, UI elements, and API are necessary will help team members collaborate better in order to meet certain expectations. Whether you develop an app under your brand’s banner or outsource coding and design services to would-be clients, briefs can provide you with several benefits:

  • Clarity on what your mobile app project “is” and “isn’t” early in development
  • Point of reference for developers, project leads, and clients throughout the cycle
  • Smart allocation of available time and resources based on objective development criteria
  • Streamlined project data storage for further app updates and iterations

Writing Steps to Create a Good Mobile App Project Brief

Writing-Steps-to-Create-a-Good-Mobile-App-Project-Brief

1. Establish the “You” Behind the App

Depending on how “open” your project is to the public, you will want to write a detailed section about who the developers are. Elements such as company name, address, project lead, project title, as well as contact information, should be included in this introductory segment. Regardless of whether you build an in-house app or outsource developers to a client, this section is used for easy document storage and access.

#android app #ios app #minimum viable product (mvp) #mobile app development #web development #how do you write a project design #how to write a brief #how to write a project summary #how to write project summary #program brief example #project brief #project brief example #project brief template #project proposal brief #simple project brief template

Beth  Nabimanya

Beth Nabimanya

1620211320

Top 10 Fun CSS Project Ideas & Topics For Beginners [2021]

Anyone aspiring to become a Web Designer must know that they cannot do without CSS. CSS allows you to impart creative styles and layouts to your websites, making them unique and attractive. With CSS, you can experiment with page layouts, tweak the colors and fonts, add cool effects to images, and so much more. Another excellent CSS feature is that it helps separate the presentation from the structure (HTML) into various files.

However, it is not easy to master CSS. To learn this tool, you must possess many skills, including design, coding, and creativity. It takes time to acquire these skills and gain a certain level of mastery over them. While the learning process is a steep one, you can boost your skills and knowledge base by building your own CSS projects. As you create and design different projects of varying skill levels, your practical skills improve substantially.

#css project ideas #css project topics #css projects

Beth  Nabimanya

Beth Nabimanya

1619520840

Top 10 Fun CSS Project Ideas & Topics For Beginners [2021]

Anyone aspiring to become a Web Designer must know that they cannot do without CSS. CSS allows you to impart creative styles and layouts to your websites, making them unique and attractive. With CSS, you can experiment with page layouts, tweak the colors and fonts, add cool effects to images, and so much more. Another excellent CSS feature is that it helps separate the presentation from the structure (HTML) into various files.

However, it is not easy to master CSS. To learn this tool, you must possess many skills, including design, coding, and creativity. It takes time to acquire these skills and gain a certain level of mastery over them. While the learning process is a steep one, you can boost your skills and knowledge base by building your own CSS projects. As you create and design different projects of varying skill levels, your practical skills improve substantially.

#full stack development #css project ideas #css project topics #css projects