From 14fda0a8d8e22e29e7378ae00328721cb3905d19 Mon Sep 17 00:00:00 2001 From: "ben.freshwater" Date: Tue, 3 Dec 2024 14:49:23 +0000 Subject: [PATCH] feat: use private mixins --- .../src/scss/o-colors/_mixins.scss | 16 ++++++++-------- .../src/scss/o-colors/_variables.scss | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/o-private-foundation/src/scss/o-colors/_mixins.scss b/components/o-private-foundation/src/scss/o-colors/_mixins.scss index cefac8c397..9a6e8a5400 100644 --- a/components/o-private-foundation/src/scss/o-colors/_mixins.scss +++ b/components/o-private-foundation/src/scss/o-colors/_mixins.scss @@ -71,7 +71,7 @@ /// Add a custom use case property. /// /// @example Setting a 'stripe' usecase with background, text, and border colour within a component 'o-example'. -/// @include oColorsSetUseCase('o-example/stripe', ( +/// @include oPrivateColorsSetUseCase('o-example/stripe', ( /// 'text': 'white', /// 'background': 'black', /// 'border': 'black-50' @@ -79,19 +79,19 @@ /// /// @example Setting a custom colour to a 'stripe' usecase with background. /// @include oPrivateColorsSetColor('o-example/my-pink', #ff69b4); -/// @include oColorsSetUseCase('o-example/stripe', ( +/// @include oPrivateColorsSetUseCase('o-example/stripe', ( /// 'background': 'o-example/my-pink', /// )); /// /// @example Deprecating all usecase properties (removing a colour usecase is a breaking change). -/// @include oColorsSetUseCase('o-example/stripe', ( +/// @include oPrivateColorsSetUseCase('o-example/stripe', ( /// 'text': 'white', /// 'background': 'black', /// 'border': 'black-50' /// ), (deprecated: 'o-example has no stripes anymore.')); /// /// @example Deprecating particular usecase properties e.g. "border" (removing a usecase property is a breaking change). -/// @include oColorsSetUseCase('o-example/stripe', ( +/// @include oPrivateColorsSetUseCase('o-example/stripe', ( /// 'text': 'white', /// 'background': 'black', /// 'border': 'black-50', @@ -100,7 +100,7 @@ /// @param {String} $usecase - The name of the usecase, e.g. 'page'. /// @param {Map} $colors - A map of properties ('text', 'background', 'border', or 'outline') to a color. /// @param {Map} $opts [()] - A map of options. Accepts a `deprecated` key with a deprecation message for the usecase e.g. `$opts: (deprecated: 'your deprecation message')`, or a map to deprecate a specific property e.g. `(deprecated: (background: 'your deprecation message'))`. -@mixin oColorsSetUseCase($usecase, $colors, $opts: ()) { +@mixin oPrivateColorsSetUseCase($usecase, $colors, $opts: ()) { $namespace: _oPrivateColorsGetNameSpace($usecase); @if not $namespace { @error 'The `$usecase` "#{inspect($usecase)}" has no namespace. ' + @@ -152,7 +152,7 @@ $current-usecase-config: map-get($_o-pf-colors-usecases, $usecase); @if ($namespace != 'o-colors' and $current-usecase-config and $current-usecase-config != $new-usecase-config) { @error 'A usecase "#{$usecase}" has already been set. ' + - 'Only default o-colors usecases may be overridden with `oColorsSetUseCase`. ' + + 'Only default o-colors usecases may be overridden with `oPrivateColorsSetUseCase`. ' + 'If you would like to customise "#{$namespace}" colours, check its README for ' + 'customisation options, or contact the Origami team to propose new customisation features.'; } @@ -184,7 +184,7 @@ // Set the page usecase first, which is needed for mixes. @each $usecase, $colors, $opts in $_o-pf-colors-default-usecases { @if $usecase == 'page' { - @include oColorsSetUseCase('o-colors/#{$usecase}', $colors, $opts); + @include oPrivateColorsSetUseCase('o-colors/#{$usecase}', $colors, $opts); } } // Output colour mixies. @@ -211,6 +211,6 @@ @mixin _oPrivateColorsSetDefaultUsecases { @each $usecase, $colors, $opts in $_o-pf-colors-default-usecases { $opts: if($opts, $opts, ()); - @include oColorsSetUseCase('o-colors/#{$usecase}', $colors, $opts); + @include oPrivateColorsSetUseCase('o-colors/#{$usecase}', $colors, $opts); } } diff --git a/components/o-private-foundation/src/scss/o-colors/_variables.scss b/components/o-private-foundation/src/scss/o-colors/_variables.scss index 36a8633557..2ac08fffc2 100644 --- a/components/o-private-foundation/src/scss/o-colors/_variables.scss +++ b/components/o-private-foundation/src/scss/o-colors/_variables.scss @@ -6,7 +6,7 @@ $_o-pf-colors-is-initialised: false !default; /// A map to define default palette colours: /// A list of arguments for `oPrivateColorsSetColor`, except the project name. /// -/// @see _oColorsSetDefaultPaletteColors +/// @see _oPrivateColorsSetDefaultPaletteColors /// @see oPrivateColorsSetColor /// @type List /// @access private @@ -16,28 +16,28 @@ $_o-pf-colors-default-palette-colors: () !default; /// This is also used to decide which colours are /// allowed to have tones, when users request a /// non-default tone. -/// @see _oColorsSetPaletteTones +/// @see _oPrivateColorsSetPaletteTones /// @type Map /// @access private $_o-pf-colors-default-palette-tones: (); /// A map to define default mixes in the palette. -/// @see _oColorsSetPaletteMixes +/// @see _oPrivateColorsSetPaletteTones /// @type Map /// @access private $_o-pf-colors-default-palette-mixes: (); /// A map to define default colour usecases: -/// A list of arguments for `oColorsSetUseCase`, except the project name. +/// A list of arguments for `oPrivateColorsSetUseCase`, except the project name. /// -/// @see _oColorsSetDefaultUsecases -/// @see oColorsSetUseCase +/// @see _oPrivateColorsSetDefaultPaletteColors +/// @see oPrivateColorsSetUseCase /// @type List /// @access private $_o-pf-colors-default-usecases: () !default; /// A map to store all set colour usecases. -/// @see oColorsSetUseCase +/// @see oPrivateColorsSetUseCase /// @type Map /// @access private $_o-pf-colors-usecases: () !default;