Comments (3)
Hi @tek-moglykisvergad
Thanks for raising this issue! I'm about to publish a new version of ngx-skeleton-loader
with this new feature. I'll share more details in here as soon as I finish with that task, but thanks heaps for the suggestion!
from ngx-skeleton-loader.
Hi @tek-moglykisvergad , how are you?
AT TIME:
Pull request is now merged and the feature is in place! You can find more details about that on the README's section "Extending theme via NgxSkeletonLoaderModule.forRoot()"
By default when using
NgxSkeletonLoaderModule.forRoot({ theme: /* ...list of CSS atributes */} })
the application is using this value as source of truth, overriding any local theming passed to<ngx-skeleton-loader>
component via[theme]
input. Check these steps in case you need to change this behaviour in your app
This method is also accepting the option of having a global theme and local theme inputs. You can enable it by passing NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* ...list of CSS atributes */} })
in your module. Quite simple, right? 😄
By using that configuration in yuor application, you should also be aware that:
- By default, every
<ngx-skeleton-loader>
component will usetheme
coming fromNgxSkeletonLoaderModule.forRoot()
as the source of truth - If there's any CSS attribute on the component locally which overrides the CSS spec, it combines both themes, but overriding global CSS attributes in favor of local ones.
As an example:
...
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
...
@NgModule({
declarations: [
YourAppComponent
],
imports: [
...
NgxSkeletonLoaderModule.forRoot({
theme: {
// Enabliong theme combination
extendsFromRoot: true,
// ... list of CSS theme attributes
height: '30px',
},
}),,
...
],
providers: [],
bootstrap: [YourAppComponent]
})
export class YourAppComponent {}
<div class="item">
<ngx-skeleton-loader></ngx-skeleton-loader>
<!-- above line will produce a skeleton component using `height: 30px;`" -->
<ngx-skeleton-loader [theme]="{background: 'blue'}"></ngx-skeleton-loader>
<!-- above line will produce a skeleton component using `height: 30px; background: blue;`" -->
<ngx-skeleton-loader [theme]="{height: '50px', background: 'red'}"></ngx-skeleton-loader>
<!-- above line will produce a skeleton component using `height: 50px; background: red;`" -->
</div>
from ngx-skeleton-loader.
Sharing some great news @tek-moglykisvergad !
this feature is now available on the latest version of ngx-skeleton-loader
. Please upgrade your project to use [email protected]
and enjoy!
Closing this issue since it's solved. Thank you very much! 🎉
from ngx-skeleton-loader.
Related Issues (20)
- Skeleton loader animation scrolls outside of mat-card container HOT 1
- Suggestion: adjust peerDependencies to match ng 12 and above HOT 3
- How to change the pulse color ? HOT 2
- Support angular 14 HOT 5
- Add oblique animation option
- "Starting dev server" for a long time HOT 1
- Problem with using Appearance="line" in Mat-Table HOT 1
- Error in component.d.ts after Importing the ngx-skeleton-loader to app.module.ts in Angular 14.2.7 HOT 7
- Possible Angular Universal memory leak HOT 6
- Module parse failed: Unexpected token (56:32) HOT 5
- Unable run in Angular 11 HOT 2
- Version 8 is not published in Releases HOT 2
- Error Angular 10 HOT 1
- Make ngx-skeleton-loader standalone compliant HOT 3
- Possibility to use own svg HOT 1
- demo no workey? HOT 1
- Can't bind to 'theme' since it isn't a known property of 'ngx-skeleton-loader' HOT 1
- Ivy Distribution Error HOT 6
- v13 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-skeleton-loader.