Рубрики

colors

What blend of colors results in blue?

There’s some evidence that breathing exercises can improve symptoms and reduce the need for reliever medicines in some people, but they should not be used instead of your medicine.


Treatment – Asthma

Inhalers, which are devices that let you breathe in medicine, are the main treatment. Tablets and other treatments may also be needed if your asthma is severe.

You’ll usually create a personal action plan with a doctor or asthma nurse.

This includes information about your medicines, how to monitor your condition and what to do if you have an asthma attack.

Inhalers

Inhalers can help:

  • relieve symptoms when they occur (reliever inhalers)
  • stop symptoms developing (preventer inhalers)

Some people need an inhaler that does both (combination inhalers).

Talk to your doctor or asthma nurse about the right inhaler for you. You can visit Asthma + Lung UK for more information on inhaler choices.

Read on to learn more about the different types of inhaler.

Reliever inhalers

Most people with asthma will be given a reliever inhaler. These are usually blue.

You use a reliever inhaler to treat your symptoms when they occur. They should relieve your symptoms within a few minutes.

Tell a GP or asthma nurse if you have to use your reliever inhaler 3 or more times a week. They may suggest additional treatment, such as a preventer inhaler.

Reliever inhalers have few side effects, but they can sometimes cause shaking or a fast heartbeat for a few minutes after they’re used.

Preventer inhalers

If you need to use a reliever inhaler often, you may also need a preventer inhaler.

You use a preventer inhaler every day to reduce the inflammation and sensitivity of your airways, which stops your symptoms occurring. It’s important to use it even when you do not have symptoms.

Speak to a GP or asthma nurse if you continue to have symptoms while using a preventer inhaler.

Preventer inhalers contain steroid medicine.

They do not usually have side effects, but can sometimes cause:

  • a fungal infection of the mouth or throat (oral thrush)
  • a hoarse voice
  • a sore throat

You can help prevent these side effects by using a spacer, which is a hollow plastic tube you attach to your inhaler, as well as by rinsing your mouth after using your inhaler.

Combination inhalers

If using reliever and preventer inhalers does not control your asthma, you may need an inhaler that combines both.

Combination inhalers are used every day to help stop symptoms occurring and provide long-lasting relief if they do occur.

It’s important to use it regularly, even if you do not have symptoms.

Side effects of combination inhalers are similar to those of reliever and preventer inhalers.

Disposing of your inhalers

Inhalers should not be thrown away in household waste. Take them to a pharmacy to be disposed of.


Tablets

You may also need to take tablets if using an inhaler alone is not helping control your symptoms.

Leukotriene receptor antagonists (LTRAs)

LTRAs are the main tablets used for asthma. They also come in syrup and powder form.

You take them every day to help stop your symptoms occurring.

Possible side effects include tummy aches and headaches.

Theophylline

Theophylline may also be recommended if other treatments are not helping to control your symptoms.

It’s taken every day to stop your symptoms occurring.

Possible side effects include headaches and feeling sick.

Steroid tablets

Steroid tablets may be recommended if other treatments are not helping to control your symptoms.

They can be taken either:

  • as an immediate treatment when you have an asthma attack
  • every day as a long-term treatment to prevent symptoms – this is usually only necessary if you have very severe asthma and inhalers do not control your symptoms

Long-term or frequent use of steroid tablets can occasionally cause side effects such as:

  • increased appetite, leading to weight gain
  • easy bruising
  • mood changes
  • fragile bones (osteoporosis)
  • high blood pressure

You’ll be monitored regularly while taking steroid tablets to check for signs of any problems.


Functions & Directives

A reference for the custom functions and directives Tailwind exposes to your CSS.

Directives are custom Tailwind-specific at-rules you can use in your CSS that offer special functionality for Tailwind CSS projects.

Use the @tailwind directive to insert Tailwind’s base , components , utilities and variants styles into your CSS.

/** * This injects Tailwind's base styles and any base styles registered by * plugins. */ @tailwind base; /** * This injects Tailwind's component classes and any component classes * registered by plugins. */ @tailwind components; /** * This injects Tailwind's utility classes and any utility classes registered * by plugins. */ @tailwind utilities; /** * Use this directive to control where Tailwind injects the hover, focus, * responsive, dark mode, and other variants of each class. * * If omitted, Tailwind will append these classes to the very end of * your stylesheet by default. */ @tailwind variants;

Use the @layer directive to tell Tailwind which “bucket” a set of custom styles belong to. Valid layers are base , components , and utilities .

@tailwind base; @tailwind components; @tailwind utilities; @layer base  h1  @apply text-2xl; > h2  @apply text-xl; > > @layer components  .btn-blue  @apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded; > > @layer utilities  .filter-none  filter: none; > .filter-grayscale  filter: grayscale(100%); > >

Tailwind will automatically move the CSS within any @layer directive to the same place as the corresponding @tailwind rule, so you don’t have to worry about authoring your CSS in a specific order to avoid specificity issues.

Any custom CSS added to a layer will only be included in the final build if that CSS is actually used in your HTML, just like all of the classes built in to Tailwind by default.

Wrapping any custom CSS with @layer also makes it possible to use modifiers with those rules, like hover: and focus: or responsive modifiers like md: and lg: .

Use @apply to inline any existing utility classes into your own custom CSS.

This is useful when you need to write custom CSS (like to override the styles in a third-party library) but still want to work with your design tokens and use the same syntax you’re used to using in your HTML.

.select2-dropdown  @apply rounded-b-lg shadow-md; > .select2-search  @apply border border-gray-300 rounded; > .select2-results__group  @apply text-lg font-bold text-gray-900; >

Any rules inlined with @apply will have !important removed by default to avoid specificity issues:

/* Input */ .foo  color: blue !important; > .bar  @apply foo; > /* Output */ .foo  color: blue !important; > .bar  color: blue; >

If you’d like to @apply an existing class and make it !important , simply add !important to the end of the declaration:

/* Input */ .btn  @apply font-bold py-2 px-4 rounded !important; > /* Output */ .btn  font-weight: 700 !important; padding-top: .5rem !important; padding-bottom: .5rem !important; padding-right: 1rem !important; padding-left: 1rem !important; border-radius: .25rem !important; >

Note that if you’re using Sass/SCSS, you’ll need to use Sass’ interpolation feature to get this to work:

.btn  @apply font-bold py-2 px-4 rounded #!important>; >

Component frameworks like Vue and Svelte support adding per-component styles within a block that lives in each component file.

If you try to @apply a custom class you’ve defined in your global CSS in one of these per-component blocks, you’ll get an error about the class not existing:

main.css

@tailwind base; @tailwind components; @tailwind utilities; @layer components  .card  background-color: theme(colors.white); border-radius: theme(borderRadius.lg); padding: theme(spacing.6); box-shadow: theme(boxShadow.xl); > >

Card.svelte

div> slot>slot> div> style> div  /* Won't work because this file and main.css are processed separately */ @apply card; > style>

This is because under-the-hood, frameworks like Vue and Svelte are processing every single block independently, and running your PostCSS plugin chain against each one in isolation.

That means if you have 10 components that each have a block, Tailwind is being run 10 separate times, and each run has zero knowledge about the other runs. Because of this, when you try to @apply card in Card.svelte it fails, because Tailwind has no idea that the card class exists since Svelte processed Card.svelte and main.css in total isolation from each other.

The solution to this problem is to define any custom styles you want to @apply in your components using the plugin system instead:

tailwind.config.js

const plugin = require('tailwindcss/plugin') module.exports =  // . plugins: [ plugin(function ( addComponents, theme >)  addComponents( '.card':  backgroundColor: theme('colors.white'), borderRadius: theme('borderRadius.lg'), padding: theme('spacing.6'), boxShadow: theme('boxShadow.xl'), > >) >) ] >

This way any file processed by Tailwind that uses this config file will have access to those styles.

Honestly though the best solution is to just not do weird stuff like this at all. Use Tailwind’s utilities directly in your markup the way they are intended to be used, and don’t abuse the @apply feature to do things like this and you will have a much better experience.

Use the @config directive to specify which config file Tailwind should use when compiling that CSS file. This is useful for projects that need to use different configuration files for different CSS entry points.

Colin Wynn
the authorColin Wynn

Leave a Reply