-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lib): add config options for flex basis and other tokens
* Revert default flex-basis value in column mode back to 1e-9px * Add static method on main module to allow for configuration of tokens, including the ability to set the flex-basis value in column mode to auto instead of the above hack * Add flex stylings to parent to prevent excessive breaking change, also configurable by the static method * Add extra check to prevent max-width from being added when `fxFlex` is empty * Change development port to 5000 * Change karma reporter back to dots to get back detailed reporting in case of error BREAKING CHANGE: * Four configuration tokens have been removed: * * `ADD_FLEX_STYLES` * * `ADD_ORIENTATION_BREAKPOINTS` * * `DISABLE_DEFAULT_BREAKPOINTS` * * `DISABLE_VENDOR_PREFIXES` These tokens have been consolidated into a new configuration token: * * `LAYOUT_CONFIG` * The default column flex-basis has been reverted to `1e-9px`. To have that value be `auto` instead, set the config in your top-level module as follows: ``` FlexLayoutModule.withConfig({useColumnBasisZero: false}) ```
- Loading branch information
1 parent
ffb5c79
commit f01e551
Showing
20 changed files
with
294 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Configuring Angular Layout | ||
|
||
### Introduction | ||
|
||
Angular Layout comes built-in with several advanced capabilities that are meant to help developers | ||
seamlessly integrate Flexbox and CSS Grid utilities into their applications. However, there are times | ||
where these behaviors are not desirable, and so this library offers the ability to configure them. | ||
The specific configurable behaviors, and how to turn them off, are detailed below. | ||
|
||
### Configuration | ||
|
||
To configure Angular Layout, initialize the top-level module using the `withConfig` method as follows: | ||
|
||
```ts | ||
import {FlexLayoutModule} from '@angular/flex-layout'; | ||
|
||
FlexLayoutModule.withConfig(configOptions, [breakpoints]); | ||
``` | ||
|
||
The `withConfig` method takes two arguments: a configuration object, and a list of custom breakpoints. | ||
This is the same as providing the breakpoints following the Custom Breakpoints guide. | ||
|
||
### Options | ||
|
||
The Angular Layout module can be configured with the following options: | ||
|
||
* `addFlexToParent`: whether to add `flex-direction` stylings to the parent of an `fxFlex` directive, | ||
if not present | ||
* `addOrientationBps`: whether to add the orientation breakpoints to the module | ||
* `disableDefaultBps`: whether to disable the default breakpoints from use in the module | ||
* `disableVendorPrefixes`: whether to disable the `--webkit` prefix from applied stylings | ||
* `serverLoaded`: whether to simulate the module being in server mode | ||
* `useColumnBasisZero`: whether the default `flex-basis` value should be `1e-9px` (otherwise `auto`) | ||
|
||
The breakpoints provided as the second argument can be either a singular `BreakPoint`, or a `BreakPoint` array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Configuring Angular Layout | ||
|
||
### Introduction | ||
|
||
Angular Layout comes built-in with several advanced capabilities that are meant to help developers | ||
seamlessly integrate Flexbox and CSS Grid utilities into their applications. However, there are times | ||
where these behaviors are not desirable, and so this library offers the ability to configure them. | ||
The specific configurable behaviors, and how to turn them off, are detailed below. | ||
|
||
### Configuration | ||
|
||
To configure Angular Layout, initialize the top-level module using the `withConfig` method as follows: | ||
|
||
```ts | ||
import {FlexLayoutModule} from '@angular/flex-layout'; | ||
|
||
FlexLayoutModule.withConfig(configOptions, [breakpoints]); | ||
``` | ||
|
||
The `withConfig` method takes two arguments: a configuration object, and a list of custom breakpoints. | ||
This is the same as providing the breakpoints following the Custom Breakpoints guide. | ||
|
||
### Options | ||
|
||
The Angular Layout module can be configured with the following options: | ||
|
||
* `addFlexToParent`: whether to add `flex-direction` stylings to the parent of an `fxFlex` directive, | ||
if not present | ||
* `addOrientationBps`: whether to add the orientation breakpoints to the module | ||
* `disableDefaultBps`: whether to disable the default breakpoints from use in the module | ||
* `disableVendorPrefixes`: whether to disable the `--webkit` prefix from applied stylings | ||
* `serverLoaded`: whether to simulate the module being in server mode | ||
* `useColumnBasisZero`: whether the default `flex-basis` value should be `1e-9px` (otherwise `auto`) | ||
|
||
The breakpoints provided as the second argument can be either a singular `BreakPoint`, or a `BreakPoint` array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.