Skip to content

Commit

Permalink
Fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceliuice committed May 21, 2024
1 parent 9fcb0b6 commit 110c690
Show file tree
Hide file tree
Showing 32 changed files with 6,146 additions and 5,254 deletions.
10 changes: 6 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ SASSC_OPT="-M -t expanded"
if [[ "$(command -v gnome-shell)" ]]; then
gnome-shell --version
SHELL_VERSION="$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f -1)"
if [[ "${SHELL_VERSION:-}" -ge "44" ]]; then
if [[ "${SHELL_VERSION:-}" -ge "46" ]]; then
GS_VERSION="46-0"
elif [[ "${SHELL_VERSION:-}" -ge "44" ]]; then
GS_VERSION="44-0"
elif [[ "${SHELL_VERSION:-}" -ge "42" ]]; then
GS_VERSION="42-0"
Expand All @@ -37,9 +39,9 @@ if [[ "$(command -v gnome-shell)" ]]; then
else
GS_VERSION="3-32"
fi
else
echo "'gnome-shell' not found, using styles for last gnome-shell version available."
GS_VERSION="44-0"
else
echo "'gnome-shell' not found, using styles for last gnome-shell version available."
GS_VERSION="46-0"
fi

usage() {
Expand Down
2 changes: 2 additions & 0 deletions parse-sass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ for color in "${_COLOR_D_VARIANTS[@]}"; do
echo "==> Generating the gnome-shell-42-0${color}.css..."
sassc $SASSC_OPT src/gnome-shell/theme-44-0/gnome-shell${color}.{scss,css}
echo "==> Generating the gnome-shell-44-0${color}.css..."
sassc $SASSC_OPT src/gnome-shell/theme-46-0/gnome-shell${color}.{scss,css}
echo "==> Generating the gnome-shell-46-0${color}.css..."
sassc $SASSC_OPT src/cinnamon/cinnamon${color}.{scss,css}
echo "==> Generating the cinnamon${color}.css..."
done
Expand Down
25 changes: 25 additions & 0 deletions src/_sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@
@return unquote("alpha(#{$c},#{$a})");
}

// Function to convert px values to em
@function to_em($input, $base: 16px) {
// multiplied and divided by 1000 to make up for round() shortcoming
$em_value: ($input / $base) * 1.091 * 1000;
@return round($em_value) / 1000 * 1em;
}

$asset_suffix: if($variant == 'dark', '-dark', '');
$asset_suffix_dark: if($titlebar == 'dark', '-dark', '');
$asset_suffix_win: if($titlebutton == 'circle', '', '-win');

// sizes
$font-size: 10;

$small_size: 16px;
$medium_size: 28px;
$large_size: 40px;

$base_padding: 6px; // internal padding of elements
$base_margin: 4px; // margin between elements
$cont_padding: 6px;
$menuitem_size: 28px;

Expand All @@ -27,6 +38,20 @@ $corner_radius: if($window == 'round', 8px, 0);
$material_radius: if($window == 'round', 8px, 3px);
$circular_radius: 9999px;

// Fixed icon sizes
$base_icon_size: 16px;
$medium_icon_size: $base_icon_size * 1.5; // 24px
$large_icon_size: $base_icon_size * 2; // 32px

// Scaled values
// Used in elements that follow text scaling factors
$scaled_padding: to_em(6px); // same as $base_padding

// Used for symbolic icons that scale
$scalable_icon_size: to_em(16px);
$medium_scalable_icon_size: $scalable_icon_size * 1.5;
$large_scalable_icon_size: $scalable_icon_size * 2;

// durations
$shorter_duration: 180ms;
$longer_duration: 270ms;
Expand Down
37 changes: 17 additions & 20 deletions src/_sass/gnome-shell/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ $_bubble_fg_color: $osd_fg_color;
$_bubble_borders_color: transparentize($osd_fg_color,0.8);
$_shell_fg_color: white;

// stage {
// // font-family: $font-family;
// @include fontsize($font-size);
// color: $fg_color;
// }
stage {
// font-family: $font-family;
@include fontsize($font-size);
color: $fg_color;
}

%reset_style {
background-color: transparent !important;
background-gradient-direction: none !important;
border: none !important;
border-radius: 0 !important;
background-color: transparent;
background-gradient-direction: none;
border: none;
box-shadow: none;
border-radius: 0;
}

%bubble-entry {
%bubble_entry {
color: $fg_color;
background-color: darken($bg_color, 2%);
border-color: $borders_color;
Expand All @@ -34,18 +35,14 @@ $_shell_fg_color: white;
$bubble_button_radius: $material_radius - 1px;

%bubble_button {
padding: $cont_padding * 2;
padding: $base_padding * 2;
font-weight: bold !important;
border: none !important;
@extend %flat_button;

&:ltr { margin-right: 0; }
&:rtl { margin-left: 0; }

@include button(normal);
&:insensitive { @include button(insensitive);}
&:focus { @include button(focus);}
&:hover { @include button(hover);}
&:active, &:checked { @include button(active);}

&:first-child:ltr {
border-radius: 0 0 0 $bubble_button_radius;
}
Expand All @@ -71,7 +68,7 @@ $bubble_button_radius: $material_radius - 1px;
}
}

%bubble-dialog {
%bubble_dialog {
color: $fg_color;
background-color: $base_color;
border: if($variant == 'light', 0, 1px) solid $borders_color !important;
Expand All @@ -91,13 +88,13 @@ $bubble_button_radius: $material_radius - 1px;
%icon_tile {
color: $_shell_fg_color;
border-radius: $bt_radius;
padding: 6px;
padding: $base_padding;
border: 1px solid transparent;
transition-duration: 0ms;
text-align: center;
}

%overview-icon {
%overview_icon {
.overview-icon {
@extend %icon_tile;
}
Expand Down
100 changes: 78 additions & 22 deletions src/_sass/gnome-shell/_drawing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,50 @@
@if $t==normal {
color: $text_color;
background-color: $entry_bg;
border: 1px solid $entry_border;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95);
border: 1px solid $entry_border !important;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95) !important;
}

@if $t==hover {
color: $fg_color;
background-color: $entry_bg;
border: 1px solid $entry_border;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95);
border: 1px solid $entry_border !important;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95) !important;
}

@if $t==focus {
color: $fg_color;
background-color: $entry_bg;
border: 1px solid $selected_bg_color;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95);
border: 1px solid $selected_bg_color !important;
box-shadow: inset 0 2px 4px transparentize($entry_bg, 0.95) !important;
}

@if $t==insensitive {
color: $insensitive_fg_color;
background-color: mix($entry_bg, $bg_color, 55%);
border-color: 1px solid mix($entry_border, $bg_color, 55%);
box-shadow: inset 0 2px 4px transparentize(mix($entry_bg, $bg_color, 55%), 0.95);
border-color: 1px solid mix($entry_border, $bg_color, 55%) !important;
box-shadow: inset 0 2px 4px transparentize(mix($entry_bg, $bg_color, 55%), 0.95) !important;
}

@if $t==osd {
color: $osd_fg_color;
background-color: $osd_entry_bg;
border: 1px solid $osd_entry_border;
box-shadow: inset 0 2px 4px transparentize(black, 0.95);
border: 1px solid $osd_entry_border !important;
box-shadow: inset 0 2px 4px transparentize(black, 0.95) !important;
}

@if $t==osd-focus {
color: $selected_fg_color;
background-color: $selected_bg_color;
border: 1px solid $osd_entry_border;
box-shadow: inset 0 2px 4px transparentize(black, 0.95);
border: 1px solid $osd_entry_border !important;
box-shadow: inset 0 2px 4px transparentize(black, 0.95) !important;
}

@if $t==osd-insensitive {
color: transparentize($osd_fg_color, 0.45);
background-color: transparentize($osd_entry_bg, 0.15);
border: 1px solid $osd_entry_border;
box-shadow: inset 0 2px 4px transparentize(black, 0.95);
border: 1px solid $osd_entry_border !important;
box-shadow: inset 0 2px 4px transparentize(black, 0.95) !important;
}
}

Expand All @@ -82,7 +82,7 @@
//
color: $tc;
background-color: $c;
border: 1px solid $button_border;
border: 1px solid if($tc == $fg_color, $button_border, mix($tc, $c, 12%));
box-shadow: none;
}

Expand All @@ -92,29 +92,27 @@
//
color: $tc;
background-color: $c;
border: 1px solid $button_border;
border: 1px solid if($tc == $fg_color, $button_border, rgba($fg_color, 0.12));
box-shadow: none !important;
outline: none !important;
}

@else if $t==focus-hover {
//
// focused button
//
color: $tc;
background-color: if($variant=='light', rgba(black, 0.03), rgba(white, 0.06));
border: 1px solid $selected_bg_color;
background-color: if($variant=='light', mix($tc, $c, 3%), mix($tc, $c, 6%));
border: 1px solid if($tc == $fg_color, $button_border, mix($tc, $c, 12%));
box-shadow: none !important;
outline: none !important;
}

@else if $t==hover {
//
// hovered button
//
color: $tc;
background-color: mix($fg_color, $c, 6%);
border: 1px solid if($variant=='light', darken($button_border, 5%), lighten($button_border, 5%));
background-color: mix($tc, $c, 6%);
border: 1px solid mix($tc, $c, 16%);
box-shadow: none;
}

Expand Down Expand Up @@ -197,4 +195,62 @@
background-color: rgba($osd_bg_color, 0.35);
box-shadow: none;
}

@if $t==flat {
//
// flat button
//
color: $tc;
background-color: transparent;
border: none;
box-shadow: none;
}

@else if $t==flat-focus {
//
// flat focused button
//
color: $tc;
background-color: rgba($tc, 0.05);
}

@else if $t==flat-hover {
//
// flat hovered button
//
color: $tc;
background-color: rgba($tc, 0.1);
border: none;
box-shadow: none;
}

@else if $t==flat-active {
//
// flat pushed button
//
color: $tc;
background-color: rgba($tc, 0.2);
border: none;
box-shadow: none;
}

@else if $t==flat-checked {
//
// flat checked button
//
color: $tc;
background-color: rgba($tc, 0.12);
border: none;
box-shadow: none;
}

@else if $t==flat-insensitive {
//
// flat insensitive button
//
color: $insensitive_fg_color;
background-color: transparent;
border: none;
box-shadow: none;
}
}
Loading

0 comments on commit 110c690

Please sign in to comment.