compiled

授权协议 Apache-2.0 License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 百里鸿祯
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Compiled

A familiar and performant compile time CSS-in-JS library for React.

Get started now ➚

Usage

import { styled, ClassNames } from '@compiled/react';

// Tie styles to an element
<div css={{ color: 'purple' }} />

// Create a component that ties styles to an element
const StyledButton = styled.button`
  color: ${(props) => props.color};
`;

// Use a component where styles are not necessarily tied to an element
<ClassNames>
  {({ css }) => children({ className: css({ fontSize: 12 }) })}
</ClassNames>

Extract styles

Turn on extraction and all components styled in your app and sourced through NPM will have their runtime stripped and styles extracted to an atomic style sheet.

-import { CC, CS } from '@compiled/react/runtime';
-
-const _2 = '._syaz1q9v{color: hotpink}';
-const _ = '._1wybfyhu{font-size: 48px}';
-
export const LargeHotPinkText = () => (
-  <CC>
-   <CS>{[_, _2]}</CS>
    <span className="_syaz1q9v _1wybfyhu">Hello world</span>
-  </CC>
);
._1wybfyhu {
  font-size: 48px;
}
._syaz1q9v {
  color: hotpink;
}

See CSS extraction for more information.

Installation

Install the React package.

npm install @compiled/react

Then configure your bundler of choice or use Babel directly.

Webpack

Install the Webpack loader.

npm install @compiled/webpack-loader --save-dev

See installation for more information.

Parcel

Note
Parcel v2 is currently in pre-release which makes this transformer experimental, it may break when updating Parcel. Use with caution.

Install the Parcel v2 transformer.

npm install @compiled/parcel-transformer --save-dev

See installation for more information.

Babel

Install the Babel plugin.

npm install @compiled/babel-plugin --save-dev

See installation for more information.

Contributions

Contributions are welcomed!Please see CONTRIBUTING.md to get started.

Thanks

Chromatic

Thanks to Chromatic for providing the visual testing platform that helps us review UI changes and catch visual regressions.


Atlassian

  • 从上一篇NHibernate与Entity Framework性能比较中可以看出来LINQ预编译查询可以大大提高性能。本文对预编译查询做简单介绍。  首先了解什么是 匿名方法(anonymous function)和Func<>    1. 命名方法,匿名方法和Lambda表达式 在C#2.0之前,对委托赋值的唯一方式是通过的命名方法。C#2.0引入匿名方法以内联(in-line)方式使之变得直观

  • https://answers.unrealengine.com/questions/565268/could-not-be-compiled-try-rebuilding-from-source-m-3.html 我已经安装了vs2015,怀疑安装的时候少安装了Common Tool,于是重新打开vs2015安装程序,“修改”功能,把Common Tool添加进去就可以了。

  • No compiled kernel found. Compiling kernels : C:\Users\admin.cache\huggingface\modules\transformers_modules\local\quantization_kernels_parallel.c Compiling gcc -O3 -fPIC -pthread -fopenmp -std=c99 C:\

  • ## 目标 解决Torch not compiled with CUDA enabled 版本不兼容问题 ### 原理 Torch not compiled with CUDA enabled,即CUDA、torch的版本兼容问题是造成print(torch.cuda.is_available()) 返回false的一种原因。本文搜集从卸载CUDA、torch,选择兼容版本,再到使用清华源,最后安

  • anaconda里除了有python包之外(我们下载python可不就下载的这个包吗),还集成了很多数据分析用的包,不用我们再一一安装了。 如果在path里配置了anaconda的环境变量,anaconda prompt 和 cmd并无太大差别,只不过anaconda prompt更方便,更好用,有很多快捷键。 anaconda创建环境,激活,就可以在这个环境中下载需要的包的版本,即使与别的环境的

  • 这个错误消息的意思是:运行时错误:没有使用 GPU 支持编译。 它表示你正在尝试使用 GPU 运行代码,但是代码并未使用 GPU 编译。这可能是因为代码的开发者没有为 GPU 编译代码,或者你的计算机中没有安装 GPU 驱动程序。 要解决这个问题,你需要确保代码已经为 GPU 编译,或者在没有 GPU 的情况下运行代码。如果你的计算机中安装了 GPU,请确保 GPU 驱动程序已经安装并且正常工作。

  • 成功解决raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled 目录 解决问题 解决思路 解决方法 T1、尝试修改为GPU

 相关资料
  • 问题内容: 我的程序使用Java Scripting API,并且可以同时评估某些脚本。他们不使用共享脚本对象,绑定或上下文,但可以使用和对象。我看到,在Java的甲骨文8实施犀牛不是多线程的,回报率约该文件说: 引擎实现不是线程安全的,并且不能用于在多个线程上同时执行脚本。 这是否意味着我应该为每个线程创建一个单独的实例?此外,文档没有说明并发使用,而是: 每个CompiledScript与一个

  • 问题内容: 我正在尝试在Linux中使用Windows dll功能。我当前的解决方案是一个单独的wine应用程序的编译,该应用程序使用dll并通过IPC在dll和主应用程序之间传输请求/响应。 这是可行的,但是与简单的dll调用相比,这是一个实际的开销。 我看到用wine编译的程序通常是一个引导脚本和一些.so(根据 文件 实用程序)是普通的linux动态链接库。 有什么方法可以将.so直接链接到

  • 问题内容: 我有一个用于渲染表单元格的指令(请参阅我在这里如何编译它的方法,基本上是在[Angular.js指令模板中使用父/继承作用域中的变量,现在在两个s中使用,一个用于行,一个对于列,所以基本上 包含50行和8列的列,对(渲染)性能产生了很大的影响(无论如何还是很明显的)。 所以我一直在寻找一种改善它的方法。首先,我尝试摆脱对列的内部重复,创建一个在内部对列进行迭代的方法,找到它们的模板,创

  • 我已经更新了 > 构建工具版本26.0.2到构建工具版本27.0.3 to 3.1.0 现在我的项目没有建立 构建失败:

  • 我试图安装Laravel使用Composer,但我一直得到以下错误: 警告:输入: '\' (ASCII=92)状态=1中的意外字符在第46行 /homepages/45/d487622789/htdocs/laravel/artisan 解析错误:语法错误,第46行 /homepages/45/d487622789/htdocs/laravel/artisan意外T_STRING 脚本php a

  • 我将Android Studio和SDK工具更新为最新版本,现在我发现了这个错误。我已经相应地更新了谷歌服务和firebase依赖项。我试图清理和重建项目,但结果是一样的。 这是我的gradle版本: 有人知道为什么会这样吗?它在25.0.3下运行良好。

  • 有人能帮我纠正这个错误吗? 失败:生成失败,出现异常。 错误:任务执行失败:app:compiledBugJavaWithJavaC 无法查询任务': app: compileDebugJavaWitJavac'属性'options.generatedSourceOutputDirectory'的值。不支持查询map(java.io.文件属性(org.gradle.api.file.目录,固定(类

  • 在我尝试运行ionic cordova应用程序后,这个错误随机出现。这不仅发生在我一直在工作的分支上,也发生在我尝试运行的其他分支上,这让我相信这是我的机器的问题。我尝试重新启动并重新安装这些软件包,但问题仍未解决。