ng-tailwindcss | CLI tool for integrating Tailwind CSS | Continuous Deployment library
kandi X-RAY | ng-tailwindcss Summary
kandi X-RAY | ng-tailwindcss Summary
A CLI tool for integrating Tailwind CSS into Angular-CLI projects
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Writes a config file .
ng-tailwindcss Key Features
ng-tailwindcss Examples and Code Snippets
Community Discussions
Trending Discussions on ng-tailwindcss
QUESTION
I'm creating a React PWA for a client using Tailwind CSS and I want to achieve a layout in which there's a header fixed to the top of the screen and a navbar fixed to the bottom of the screen. In between I'll display scrollable content of dynamic size.
I've been struggling with this problem for the most part of the day and I'm following the instructions on this answer as well as the code it provided here.
I though I got it, as I implemented all the recommended classes in the relevant components and I got this result on my browser dev tools:
However, I got curious and decided to open the page on my phone. This is the result there and, as you can see, neither of the desired elements are actually fixed to the screen:
At this point I'm completely lost. I've tried using className={fixed}
in the Navbar, but it ends up clipping part of the content even when adding margin or padding to either the navbar or the content.
How can I fix both header and navbar to the screen while keeping the content scrollable?
These are the relevant parts of my code:
App.js:
...ANSWER
Answered 2022-Jan-20 at 23:18Actually you don't need to set the position to "fixed" or "absolut". The problem can be solved simpler.
You need 4 divs. One as a container (we can call its class "root") which contains the further 3 divs.
For defining how much space each inner div can take from the root div we can use "flex" (with "flex" you can define the proportion to other components).
(You can of course change height and width of root as you like)
QUESTION
I'm currently working on an Angular Project using tailwind.
I'd like to add custom colors, so I modified my tailwind config file :
...ANSWER
Answered 2021-May-05 at 21:45You've duplicated theme
:
You define it here
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ng-tailwindcss
Install globally: npm i ng-tailwindcss -g
If you don't already have an angular project up and running, start your angular project (assumes angular cli is already installed globally): ng new angular-meets-tailwind
Follow Steps 1-3 from the Tailwind Installation Instructions: Install Tailwind (npm i tailwindcss -D) initialize (npx tailwind init) Use tailwind in your source css files. A recommendation for new projects (no changes to global stylesheet yet) is to touch src/tailwind.css and use that file for all global styles and component classes. See Configuration section for existing projects.
Configure your tailwind source/destination/config files by running: ngtw configure --config ./path/to/whatever-you-named-tailwind-config.js --source ./path/to/your-tailwind-source.css --output ./path/to/outputted-global-styles.css This will result in an ng-tailwind.js file at your project's root: module.exports = { // Tailwind Paths configJS: '/Absolute/path/to/whatever-you-named-tailwind-config.js', sourceCSS: '/Absolute/path/to/your-tailwind-source.css', outputCSS: '/Absolute/path/to/outputted-global-styles.css', watchRelatedFiles: [], // Sass sass: false, // PurgeCSS Settings ... } Please note that as of version 1.0.3, these paths will be absolute when created using the cli tool, though they can be manually edited to be relative paths with no adverse consequences. For those curious, under the hood, these properties correspond to the paths used in the tailwind build command like so: ./node_modules/.bin/tailwind build {sourceCSS} -c {configJS} -o {outputCSS} # npx is not assumed by this project, to avoid worrying about it as a dependency See Configuration section for more details and implications for existing Angular projects
Add or adjust these scripts in your package.json: scripts: { "prestart": "ngtw build", "start": "ng serve & ngtw watch", "build": "ngtw build && ng build" } or simply run ngtw scripts to have these adjustments made automatically in your package.json. Now using npm start for your development server will ensure your tailwind files are being watched and built with your project, and you can still rely on the angular-cli for everything else (no ng eject! yay!).
When you're ready to filter out your unused CSS, reference the documentation below for the various ways you can implement and adjust PurgeCSS. (Quick Tip: To include PurgeCSS in your build script, simply adjust the ngtw build command like so: ngtw build --purge.)
Keep calm and angular on.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page