These are chat archives for japgolly/scalacss

16th
Jan 2017
Pterodactylus
@Pterodactylus
Jan 16 2017 10:07
Hello, I am currently trying to print out CSS into console
I used their example but render method is not found.
Otto Chrons
@ochrons
Jan 16 2017 10:13
do you have import scalacss.Defaults._
Pterodactylus
@Pterodactylus
Jan 16 2017 10:13
yep, it is there
Otto Chrons
@ochrons
Jan 16 2017 10:13
and what is the exact error message
Pterodactylus
@Pterodactylus
Jan 16 2017 10:14
[error] C:\Users\Valentas\code\workbench-example-app\src\main\scala\example\ScalaJSExample.scala:16: could not find implicit value for parameter r: scalacss.internal.Renderer[Out]
[error] println( ReportStyles.render )
My object is called ReportStyles and extends inline stylesheets
Otto Chrons
@ochrons
Jan 16 2017 10:14
so you're missing the implicit parameter to render
Pterodactylus
@Pterodactylus
Jan 16 2017 10:15
I'm rather new to Scala, what would that be exactly? I merely called render as in scalacss author's instructions.
I am basically looking at one project and he has the following: ReportStyles.render[TypedTag[String]]
I merely try to run his code.
Ok, so it seems like there is a ScalatagsCss library so needed that to get TypedTag
Otto Chrons
@ochrons
Jan 16 2017 10:23
Pterodactylus
@Pterodactylus
Jan 16 2017 10:23
Yeah, I needed to import a couple more libraries for render to be found.
Pterodactylus
@Pterodactylus
Jan 16 2017 10:31
Are the people who created libraries like scalacss are part of Scala-js team itself?
Otto Chrons
@ochrons
Jan 16 2017 10:38
no, practically all Scala.js libs are authored by independent individuals (or sometimes teams)
Scala.js itself is just a compiler, really
Pterodactylus
@Pterodactylus
Jan 16 2017 10:43
When I launch localhost:12345 where is root directory for it? I use Intellij IDEA to write code.
Otto Chrons
@ochrons
Jan 16 2017 10:44
it's the project root folder
Pterodactylus
@Pterodactylus
Jan 16 2017 10:47
Yay found it. Yes it was indeed root folder.
Just wanted to load an image on the webpage stored in public/images folder
Pterodactylus
@Pterodactylus
Jan 16 2017 11:20
If I want to use jQuery for Scala
Does one need something like that: jsDependencies += "org.webjars" % "jquery" % "2.1.4" / "2.1.4/jquery.js"
Madusudanan.B.N
@Madusudanan
Jan 16 2017 12:50
Hello, I am trying to run a basic example of Scala css as mentioned in the book here - https://japgolly.github.io/scalacss/book/quickstart/inline.html
But I am getting the error - Error:(4, 24) could not find implicit value for parameter r: scalacss.internal.Renderer[Out]
println(ListViewPage.render)
can anybody help me understand what is causing this and how to rectify it?
Pterodactylus
@Pterodactylus
Jan 16 2017 12:52
Hey, just had this problem. You probably cll ListViewPage from some other class or object, so you need to import
Same stuff as in ListViewPage object
Maybe this
import scalacss.Defaults._
Madusudanan.B.N
@Madusudanan
Jan 16 2017 12:52
yeah the code is here
I am calling from Runner object
so I need to call it from same file?
Pterodactylus
@Pterodactylus
Jan 16 2017 12:53
Here is fiddle by another guy in the chat
I'm puzzled though. In that fiddle it can import scalacss and yours not.
Madusudanan.B.N
@Madusudanan
Jan 16 2017 12:56
oh never mind that error..I didnt import the library in scala fiddle..I did it in my local
Pterodactylus
@Pterodactylus
Jan 16 2017 12:56
ok so in libraries to the left select scalacss
Madusudanan.B.N
@Madusudanan
Jan 16 2017 12:57
so how do I run that example...it does extend the App trait nor a main method
Pterodactylus
@Pterodactylus
Jan 16 2017 12:57
Did you try stuff like including jQuery yet
Madusudanan.B.N
@Madusudanan
Jan 16 2017 12:57
might be a noobish question
nope..just trying out basics
  • not extend the App trait
Pterodactylus
@Pterodactylus
Jan 16 2017 12:57
I started today myself so a but clueless as well
Madusudanan.B.N
@Madusudanan
Jan 16 2017 13:02
yeah me too
so the examples do not work in the scala worksheet also..I am confused on how it works in scala fiddle
&.hover(
cursor.zoomIn
),
that above part shows an error in my local machine
saying hover does not take parameters
Madusudanan.B.N
@Madusudanan
Jan 16 2017 13:10
Ok I fixed it
the issue was on scala css library was imported
it should be like "com.github.japgolly.scalacss" %% "core" % "0.5.1"
previously had it like - "com.github.japgolly.scalacss" %%% "core" % "0.5.1"
would be helpful if someone can explain the difference
Madusudanan.B.N
@Madusudanan
Jan 16 2017 13:24
and for the hover issue we need to include ext scala tags - "com.github.japgolly.scalacss" %%% "ext-scalatags" % "0.5.1"
Pterodactylus
@Pterodactylus
Jan 16 2017 13:35
Literally went through same discovery myself.
Madusudanan.B.N
@Madusudanan
Jan 16 2017 13:39
my code runs now..but still my IDE complains that hover does not take parameters
are u facing the same issue
I am using intellij
Pterodactylus
@Pterodactylus
Jan 16 2017 13:54
Any css masters here could help me with how to draw something like this proof tree on the screen? https://i.imgur.com/J3RvoYT.png
Here is what I experimented with: https://jsfiddle.net/vRb3P/