Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(themes): add theme schemas #3006

Merged
merged 24 commits into from
Nov 14, 2018
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
df6a5a2
refactor(themes): introduce presets as basis for component themes
simeonoff Oct 31, 2018
79129fa
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
c5bbabe
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
3fc2122
refactor(themes): introduce presets as basis for component themes
simeonoff Oct 31, 2018
6be7aaf
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
327ccae
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
6ff304b
Merge branch 'theme-presets' of https://github.com/IgniteUI/igniteui-…
simeonoff Nov 2, 2018
1108c6d
refactor(themes): introduce presets as basis for component themes
simeonoff Oct 31, 2018
128c975
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
fdbd03c
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
63f3482
refactor(themes): introduce presets as basis for component themes
simeonoff Oct 31, 2018
c384c14
refactor(themes): create schemas for more comopnents
simeonoff Nov 1, 2018
30deaea
Merge branch 'theme-presets' of https://github.com/IgniteUI/igniteui-…
simeonoff Nov 9, 2018
43e534b
refactor(themes): add schemas for the remaining component themes
simeonoff Nov 13, 2018
158af9a
Merge branch 'master' into theme-presets
simeonoff Nov 13, 2018
2da7a27
refactor(themes): change presets to schemas
simeonoff Nov 13, 2018
5a072c0
fix(themes): value resolver always returns string
simeonoff Nov 13, 2018
3ec241a
refactor(themes): remove all $default-theme references
simeonoff Nov 13, 2018
5fa2d72
docs(themes): add docs for newly introduced functions
simeonoff Nov 13, 2018
a266fd9
refactor(demos): update demos theme
simeonoff Nov 13, 2018
7fd9f95
build(themes): fix css theme not building
simeonoff Nov 13, 2018
f20580e
refactor(themes): optimize palette generation
simeonoff Nov 14, 2018
ed29db9
Merge branch 'master' into theme-presets
Nov 14, 2018
5c2459e
Merge branch '6.2.x' into theme-presets
kdinev Nov 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(themes): add docs for newly introduced functions
  • Loading branch information
simeonoff committed Nov 13, 2018
commit 5fa2d7295712dccd3efee48188e240bd7e24374a
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@
}

/// Splits a string into a list by a given separator.
/// @access private
/// @param {string} $string - The string to split.
/// @param {string} $separator - The string separator to split the string by.
///
@function str-split($string, $separator) {
$split-arr: ();
$index : str-index($string, $separator);
Expand All @@ -408,7 +408,24 @@
}
}

// @ignore
/// Returns a value for a given instruction map, where the
/// keys of the map are the names of the functions to be called,
/// and the value for a given key is the arguments the function
/// should be called with.
/// The instruction set is executed left-to-right. The output of
/// the first instruction is then passed as input to the next, and so on.
/// @access private
/// @param {Map} $ctx - The instruction map to be used.
/// @param {List | Map} $extra [null] - Additional arguments to be passed during function calls.
/// Will only be applied for `igx-color` and `igx-contrast-color` functions.
/// @example scss Resolve `igx-color` and apply 80% opacity
/// $instructions: (
/// igx-color: ('primary', 500),
/// rgba: .2
/// );
/// // $some-palette is a palette we pass as extra arguments
/// $resolved-color: resolve-value($instructions, $some-palette);
///
@function resolve-value($ctx, $extra: null) {
$result: null;
@each $fn, $args in $ctx {
Expand All @@ -425,7 +442,22 @@
@return $result;
}

// @ignore
/// Applies an `igx-palette` to a given theme schema.
/// @access private
/// @param {Map} $schema - A theme schema.
/// @param {Map} $palette - An igx-palette map.
/// @requires {function} resolve-value
/// @example scss Apply an `igx-palette` to theme schema
/// $custom-palette: igx-palette($primary: red, $secondary: blue);
/// $custom-schema: (
/// my-color: (
/// igx-color: ('primary', 800),
/// rgba: .5
/// ),
/// roundness: 5px
/// );
/// $theme: apply-palette($custom-schema, $custom-palette); // A map with palette values resolved.
/// @returns {Map} - A map with the resolved palette values.
@function apply-palette($schema, $palette) {
$result: ();
@each $key, $value in $schema {
Expand All @@ -442,13 +474,13 @@
/// is the root of the document.
/// @access private
/// @example scss Check if the current scope is root
/// @mixin smart-mixin() {
/// $scope: if(is-root(), ':root', '&');
/// @mixin smart-mixin() {
/// $scope: if(is-root(), ':root', '&');
///
/// #{$scope} {
/// /* style rules here */
/// #{$scope} {
/// /* style rules here */
/// }
/// }
/// }
///
@function is-root {
@each $selector in & {
Expand Down