Skip to content

Commit 612d127

Browse files
authored
Merge pull request #8450 from sagemathinc/frontend-update-sass
frontend: update SASS
2 parents 194aa2d + a1b69dc commit 612d127

File tree

15 files changed

+125
-110
lines changed

15 files changed

+125
-110
lines changed

src/packages/frontend/_account-button.sass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
@import colors
6+
@use 'colors'
77

88
.cocalc-account-button
99
&:hover
1010
text-decoration: none
11-
background-color: $COL_GRAY_LL
11+
background-color: colors.$COL_GRAY_LL
1212
outline: none
1313
&:focus
1414
text-decoration: none
15-
background-color: $COL_GRAY_LL
15+
background-color: colors.$COL_GRAY_LL
1616
outline: none

src/packages/frontend/_antd_fix.sass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
// This is mainly meant to be temporary, so that we keep the
99
// overall global bootstrap style.
1010
11-
@import colors
11+
@use 'colors'
1212

1313
// make the color consistent with antd again, since bootstrap sets
1414
// it to something else. We want this to be consistent with our nextjs
1515
// landing pages.
1616
a
17-
color: $COL_ANTD_LINK_BLUE
17+
color: colors.$COL_ANTD_LINK_BLUE
1818

1919
html
2020
overflow: hidden
2121

2222
.ant-popover-content
2323
.ant-popover-arrow
24-
border-color: $COL_GRAY_L !important
24+
border-color: colors.$COL_GRAY_L !important
2525
z-index: -1 !important
2626

2727
.ant-popover-inner-content>.cocalc-account-button-dropdown-links

src/packages/frontend/_bootstrap.sass

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
67

78
// There is a bootstrap css that is setting font-weight for label to 700. This
89
// sets the font-weight back to the normal default:
@@ -46,7 +47,7 @@ pre
4647
div
4748
color : white
4849
position : absolute
49-
background-color : $COL_BLUE_D
50+
background-color : colors.$COL_BLUE_D
5051
min-height : 100px
5152
width : 350px
5253
border-radius : 5px

src/packages/frontend/_examples.sass

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
7+
@use 'mixins'
8+
69
$selector-height: 180px
710
$code-height: 230px
811

912
.webapp-examples
10-
+disable-user-select
13+
+mixins.disable-user-select
1114

1215
.modal-header
1316
white-space : nowrap
@@ -44,11 +47,11 @@ $code-height: 230px
4447
margin: 0
4548

4649
> div > ul.list-group
47-
border : 1px solid $COL_GRAY_DDD
50+
border : 1px solid colors.$COL_GRAY_DDD
4851
border-radius : 5px
4952
> li
5053
border : none
51-
border-bottom : 1px solid $COL_GRAY_LL
54+
border-bottom : 1px solid colors.$COL_GRAY_LL
5255
margin : 0
5356
border-radius : 0
5457

@@ -57,8 +60,8 @@ $code-height: 230px
5760
padding : 0px
5861
height : $code-height
5962
overflow : auto
60-
border-color : $COL_GRAY_DDD
61-
+enable-user-select
63+
border-color : colors.$COL_GRAY_DDD
64+
+mixins.enable-user-select
6265
.attr,
6366
.attr a
6467
font-size : 9px
@@ -70,7 +73,7 @@ $code-height: 230px
7073
padding : 10px
7174
text-align : left
7275
> .contrib-link
73-
color: $COL_GRAY
76+
color: colors.$COL_GRAY
7477

7578
span.badge
7679
background-color : #eee

src/packages/frontend/_idle.sass

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
7+
68
#cocalc-idle-notification
79
z-index : 9999
810
position : fixed
@@ -17,7 +19,7 @@
1719
div
1820
color : white
1921
position : absolute
20-
background-color : $COL_BLUE_D
22+
background-color : colors.$COL_BLUE_D
2123
min-height : 100px
2224
width : 350px
2325
border-radius : 5px

src/packages/frontend/_jupyter.sass

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
7+
68
// I just noticed there is another version of this file in jupyter/_jupyter.sass
79
// They need to be carefully merged into one! But not today.
810
@@ -78,7 +80,7 @@
7880

7981
.cc-jupyter-snippet
8082
> div.ant-collapse-header
81-
color: $COL_GRAY !important
83+
color: colors.$COL_GRAY !important
8284

8385
.cc-jupyter-snippet-collapse
8486
.cc-jupyter-snippet
@@ -90,7 +92,7 @@
9092
background: white
9193
margin: 0 10px 10px 10px
9294
padding: 10px
93-
border: 1px solid $COL_GRAY_L
95+
border: 1px solid colors.$COL_GRAY_L
9496
border-radius: 3px
9597
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.22)
9698
> pre
@@ -102,20 +104,20 @@
102104
display: inline
103105
104106
// katex 0.13.5 somehow causes formulas to be displayed wider than the width of the output
105-
// adding ugly horizontal scrollbars. this eliminates that.
107+
// adding ugly horizontal scrollbar. this eliminates that.
106108
.cocalc-jupyter-rendered
107109
.katex-display>.katex>.katex-html
108-
// display: contents // this did work, but it's some experimenal new display option
110+
// display: contents // this did work, but it's some experimental new display option
109111
margin: 1em .5em // margin works as well, but we also have to set it for mathjax to make it look consistent
110112
.katex
111113
padding: 0 2.5px
112114

113115
// this seems to be missing from jupyter widgets, but is used to implement the according
114116
// https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html#accordion
115-
// I.e., without this css rule, accordian is just broken.
117+
// I.e., without this css rule, accordion is just broken.
116118
.lm-Widget.lm-mod-hidden
117119
display: none !important
118120

119121
.cc-jupyter-buttonbar-dropdown
120122
.ant-dropdown-menu-item
121-
color: $COL_GRAY_D !important
123+
color: colors.$COL_GRAY_D !important

src/packages/frontend/_mixins.sass

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3+
* License: MS-RSL – see LICENSE.md for details
4+
*/
5+
6+
=user-select($val:"none")
7+
-webkit-user-select : #{$val}
8+
-moz-user-select : #{$val}
9+
-ms-user-select : #{$val}
10+
user-select : #{$val}
11+
12+
=disable-user-select
13+
+user-select(none)
14+
15+
=enable-user-select
16+
+user-select(text)

src/packages/frontend/_projects.sass

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
7+
68
// #smc-file-tabs-* used in project_page.cjsx
79
810
// ProjectPage
@@ -23,18 +25,18 @@
2325
2426
.list-group-header
2527
list-style: none
26-
color: $COL_GRAY
28+
color: colors.$COL_GRAY
2729
padding-left: 5px
2830
margin-top: 5px
29-
border-top: 1px solid $COL_GRAY_LL
31+
border-top: 1px solid colors.$COL_GRAY_LL
3032
padding-top: 10px
3133
&:first-child
3234
margin-top: 5px
3335
padding-top: 0px
3436
border-top: none
3537

3638
.smc-file-tab-floating
37-
background-color: $COL_BS_BLUE_BGRND
39+
background-color: colors.$COL_BS_BLUE_BGRND
3840
border-radius: 5px 5px 0px 0px
3941
box-sizing: border-box
4042
color: rgb(51, 51, 51)
@@ -76,7 +78,7 @@
7678
flex: 1 0 auto
7779
> div,
7880
> nav
79-
background-color: $COL_GRAY_LLL
81+
background-color: colors.$COL_GRAY_LLL
8082
border-radius: 3px
8183

8284
// The !important below are because we are directly overriding
@@ -91,7 +93,7 @@
9193

9294
.cc-path-navigator,
9395
.cc-project-flyout-path-navigator
94-
color: $COL_BS_BLUE_TEXT
96+
color: colors.$COL_BS_BLUE_TEXT
9597
span
9698
cursor: pointer
9799

@@ -111,7 +113,7 @@
111113
margin-left: 2px
112114

113115
.cc-path-navigator-history
114-
color: $COL_GRAY
116+
color: colors.$COL_GRAY
115117
.cc-path-navigator-active
116118
font-weight: bold
117119
color: black
@@ -131,14 +133,14 @@
131133
li.cc-project-home-recent-files
132134
cursor: pointer
133135
&:hover
134-
background-color: $COL_GRAY_LLL
136+
background-color: colors.$COL_GRAY_LLL
135137

136138
div.cc-project-flyout-dragbar:hover
137-
background-color: $COL_GRAY_L
139+
background-color: colors.$COL_GRAY_L
138140

139141
.cc-project-log-history-entry:hover
140-
cusor: pointer
141-
background-color: $COL_GRAY_LLL
142+
cursor: pointer
143+
background-color: colors.$COL_GRAY_LLL
142144

143145
.cc-project-flyout-files-panel,
144146
.cc-project-flyout-settings-panel

src/packages/frontend/_projects_nav.sass

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6+
@use 'colors'
7+
@use 'mixins'
8+
69
.navbar-default
7-
background-color: $COL_TOP_BAR_BG
8-
border-color: $COL_TOP_BAR_BG
10+
background-color: colors.$COL_TOP_BAR_BG
11+
border-color: colors.$COL_TOP_BAR_BG
912
border-width: 0 0 0 0
1013

1114
=nav-tab-button-styles
1215
padding : 0px
13-
+disable-user-select
14-
color: $COL_TOP_BAR_TEXT
16+
+mixins.disable-user-select
17+
color: colors.$COL_TOP_BAR_TEXT
1518
&:hover
16-
color: $COL_TOP_BAR_TEXT
19+
color: colors.$COL_TOP_BAR_TEXT
1720

1821

1922
.smc-top-bar
@@ -27,7 +30,7 @@
2730
z-index : 100
2831
border-radius : 0
2932
width : 100%
30-
background-color: $COL_GRAY_L0
33+
background-color: colors.$COL_GRAY_L0
3134
> ul > li > a
3235
+nav-tab-button-styles
3336

@@ -38,12 +41,12 @@
3841
.smc-top-bar.navbar-default .navbar-nav>.active>a:focus,
3942
.smc-top-bar.navbar-default .navbar-nav>li>a:focus,
4043
.smc-top-bar.navbar-default .navbar-nav>.active>a:hover
41-
background-color : $COL_TOP_BAR_ACTIVE
42-
color : $COL_TOP_BAR_TEXT_ACTIVE
44+
background-color : colors.$COL_TOP_BAR_ACTIVE
45+
color : colors.$COL_TOP_BAR_TEXT_ACTIVE
4346

4447
.smc-top-bar.navbar-default .navbar-nav>li>a:hover
45-
background-color : $COL_TOP_BAR_HOVER
46-
color : $COL_TOP_BAR_TEXT
48+
background-color : colors.$COL_TOP_BAR_HOVER
49+
color : colors.$COL_TOP_BAR_TEXT
4750

4851
.smc-project-tab-floating
4952
background-color : rgb(255, 255, 255)
@@ -79,4 +82,4 @@
7982
padding: 2px 10px !important
8083

8184
.cocalc-top-bar-element:hover
82-
background-color: $COL_TOP_BAR_HOVER
85+
background-color: colors.$COL_TOP_BAR_HOVER

src/packages/frontend/admin/_style.sass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
@use '../colors'
2+
13
.cocalc-highlight-saved-token
2-
background-color: $COL_BS_GREEN_LL
4+
background-color: colors.$COL_BS_GREEN_LL
35
> td.ant-table-column-sort
4-
background-color: $COL_BS_GREEN_LL
6+
background-color: colors.$COL_BS_GREEN_LL
57

68
.admin-site-setting-popover-help
79
table

0 commit comments

Comments
 (0)