Skip to content

Commit

Permalink
style: some css was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Aug 2, 2022
1 parent dc63b21 commit 1ddc48a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 11 deletions.
7 changes: 0 additions & 7 deletions packages/theme-default/src/core/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,6 @@ textarea {
overflow: auto;
}

/* Correct the odd appearance of search inputs in Chrome and Safari.
*/

input[type='search'] {
-webkit-appearance: textfield;
}

/* Remove the inner padding and cancel buttons in Chrome on OS X and
* Safari on OS X.
*/
Expand Down
67 changes: 67 additions & 0 deletions packages/theme-default/src/helpers/math.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@use 'sass:math';

$PI: 3.14159265359;

@function pow($number, $exp) {
$value: 1;

@if $exp > 0 {
@for $i from 1 through $exp {
$value: $value * $number;
}
} @else if $exp < 0 {
@for $i from 1 through -$exp {
$value: $value / $number;
}
}

@return $value;
}

@function fact($number) {
$value: 1;

@if $number > 0 {
@for $i from 1 through $number {
$value: $value * $i;
}
}

@return $value;
}

// round to number of decimals
// toFixed(0.12345, 100) -> 0.12
// toFixed(0.12345, 1000) -> 0.123
@function toFixed($number, $power) {
// @return round($number * $power) / $power;
@return math.div(round($number * $power), $power);
}

@function sin($angle) {
$sin: 0;

// angle -> radians
$rad: $angle / 180 * $PI;

// interval determines precision
@for $i from 0 through 25 {
$sin: $sin + pow(-1, $i) * pow($rad, 2 * $i + 1) / fact(2 * $i + 1);
}

@return $sin;
}

@function cos($angle) {
$cos: 0;

// angle -> radians
$rad: $angle / 180 * $PI;

// interval determines precision
@for $i from 0 through 25 {
$cos: $cos + pow(-1, $i) * pow($rad, 2 * $i) / fact(2 * $i);
}

@return $cos;
}
13 changes: 10 additions & 3 deletions packages/theme-default/src/icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

.vc-icon {
line-height: 1;
width: 1em;
height: 1em;
flex-shrink: 0;
letter-spacing: normal;
text-transform: none;
white-space: nowrap;
Expand Down Expand Up @@ -39,11 +42,15 @@
.material-icons,
.material-icons-outlined,
.material-icons-round,
.material-icons-sharp {
// user-select: none;
.material-icons-sharp,
.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp {
user-select: none;
cursor: inherit;
font-size: inherit;
display: block;
// display: block;
display: inline-flex;
align-items: center;
justify-content: center;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/theme-default/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@import './helpers/string.scss';
@import './helpers/math.scss';

@import './core/variables.scss';
@import './core/mixins.scss';
@import './core//normalize.scss';
@import './core/normalize.scss';

@import './ajax-bar.scss';
@import './tooltip.scss';
Expand Down

0 comments on commit 1ddc48a

Please sign in to comment.