-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(colors): refacto largeur de bordures
- Loading branch information
1 parent
1ddd296
commit 887efc7
Showing
18 changed files
with
129 additions
and
175 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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,11 +64,5 @@ $variables: ( | |
through: 32, | ||
breakpoints: first md | ||
) | ||
), | ||
border: ( | ||
width : ( | ||
from: 0, | ||
through: 2 | ||
) | ||
) | ||
); |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
$setting: ( | ||
decisions: ( | ||
background: default alt contrast flat action-high action-low, | ||
text: default title label mention inverted action-high, | ||
border: default plain, | ||
artwork: major minor decorative background motif | ||
color: ( | ||
decisions: ( | ||
background: default alt contrast flat action-high action-low, | ||
text: default title label mention inverted action-high, | ||
border: default plain, | ||
artwork: major minor decorative background motif | ||
) | ||
), | ||
border: ( | ||
width: ( | ||
from: 0, | ||
through: 2 | ||
) | ||
) | ||
); |
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 |
---|---|---|
@@ -1,3 +1,14 @@ | ||
<% | ||
const widths = [0.5, 1, 2]; | ||
const bordersWidth = []; | ||
widths.forEach(width => { | ||
const borderWidthClass = `${prefix}-border-width-${width.toString().replace('.', '-')}v`; | ||
bordersWidth.push({ borderClass: borderWidthClass }); | ||
}); | ||
%> | ||
|
||
<% const sample = getSample(include); %> | ||
|
||
<%- sample(getText('subdir.border', 'colors'), '../sample/default', {context: 'border'}, false); %> | ||
<%- sample(getText('subdir.border', 'colors'), '../sample/default', {context: 'border', borders: bordersWidth}, false); %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
//// | ||
/// Colors Mixin : border | ||
/// @group colors | ||
//// | ||
|
||
@use 'module/spacing'; | ||
@use 'module/string'; | ||
@use 'module/selector'; | ||
|
||
$border-width: () !default; | ||
|
||
@function _border-name($value: 0, $unit: null) { | ||
$start: 'border-width'; | ||
|
||
$middle: ''; | ||
|
||
$end: "#{string.replace($value, '.', '-')}"; | ||
|
||
@if $value != 0 and $unit != null { | ||
$end: '#{$end}#{$unit}'; | ||
} | ||
|
||
$selector: '#{$start}-#{$middle}#{$end}'; | ||
|
||
@return $selector; | ||
} | ||
|
||
@function _border-selectors($value) { | ||
@if type-of($value) != 'number' { | ||
@return '#{selector.ns(_border-name($value, null))}'; | ||
} | ||
|
||
$selectors:'#{selector.ns(_border-name($value, v))}'; | ||
|
||
@return $selectors; | ||
} | ||
|
||
@mixin _border-property-variations($value: 0) { | ||
$v: $value; | ||
|
||
@if type-of($value) == 'number' { | ||
$v: spacing.space('#{$value}v') !important; | ||
} | ||
|
||
#{_border-selectors($value)} { | ||
border-width: $v; | ||
} | ||
} | ||
|
||
@mixin _border-properties($border-width) { | ||
|
||
$from: map-get($border-width, from); | ||
$through: map-get($border-width, through); | ||
|
||
@for $i from $from through $through { | ||
// ajoute 0.5v | ||
@if $i == 0 { | ||
@include _border-property-variations($i + 0.5); | ||
} | ||
|
||
@if $i > 0 { | ||
@include _border-property-variations($i); | ||
} | ||
} | ||
} | ||
|
||
@mixin generate() { | ||
@include _border-properties($border-width); | ||
} |
File renamed without changes.