Git Product home page Git Product logo

language-css's Introduction

Atom

Build status

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

Atom is a hackable text editor for the 21st century, built on Electron, and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.

Atom

Atom Screenshot

Visit atom.io to learn more or visit the Atom forum.

Follow @AtomEditor on Twitter for important announcements.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Documentation

If you want to read about using Atom or developing packages in Atom, the Atom Flight Manual is free and available online. You can find the source to the manual in atom/flight-manual.atom.io.

The API reference for developing packages is also documented on Atom.io.

Installing

Prerequisites

macOS

Download the latest Atom release.

Atom will automatically update when a new release is available.

Windows

Download the latest Atom installer. AtomSetup.exe is 32-bit. For 64-bit systems, download AtomSetup-x64.exe.

Atom will automatically update when a new release is available.

You can also download atom-windows.zip (32-bit) or atom-x64-windows.zip (64-bit) from the releases page. The .zip version will not automatically update.

Using Chocolatey? Run cinst Atom to install the latest version of Atom.

Linux

Atom is only available for 64-bit Linux systems.

Configure your distribution's package manager to install and update Atom by following the Linux installation instructions in the Flight Manual. You will also find instructions on how to install Atom's official Linux packages without using a package repository, though you will not get automatic updates after installing Atom this way.

Archive extraction

An archive is available for people who don't want to install atom as root.

This version enables you to install multiple Atom versions in parallel. It has been built on Ubuntu 64-bit, but should be compatible with other Linux distributions.

  1. Install dependencies (on Ubuntu):
sudo apt install git libasound2 libcurl4 libgbm1 libgcrypt20 libgtk-3-0 libnotify4 libnss3 libglib2.0-bin xdg-utils libx11-xcb1 libxcb-dri3-0 libxss1 libxtst6 libxkbfile1
  1. Download atom-amd64.tar.gz from the Atom releases page.
  2. Run tar xf atom-amd64.tar.gz in the directory where you want to extract the Atom folder.
  3. Launch Atom using the installed atom command from the newly extracted directory.

The Linux version does not currently automatically update so you will need to repeat these steps to upgrade to future releases.

Building

Discussion

License

MIT

When using the Atom or other GitHub logos, be sure to follow the GitHub logo guidelines.

language-css's People

Contributors

50wliu avatar albertorestifo avatar alhadis avatar amilajack avatar andyrichardson avatar asantos3 avatar ben3eee avatar benogle avatar burodepeper avatar damieng avatar darangi avatar eritbh avatar hediyi avatar i-akhmadullin avatar jasonrudolph avatar jpcastberg avatar kevinsawicki avatar lee-dohm avatar leroix avatar lnestor avatar maxbrunsfeld avatar mnquintana avatar mostafaeweda avatar octref avatar pchaigno avatar platy11 avatar sadick254 avatar silvenon avatar weizhenye avatar zoo1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

language-css's Issues

Key binding for comments should insert cursor within comment

Hi,

Apologies for the long title. The bug is actually quite simple: when I prepare to add a comment via Atom's default key binding (cmd+/ for me), the text cursor is not placed within the comment as I would expect (so I can begin typing). Instead, the cursor is placed after the comment, which I find rather unintuitive.

Before:
before

After:
after

What I was expecting:
ideal

Could this be fixed?

Thanks,
Caleb

Add support for media queries level 4

As a syntax theme author I would love support for media queries level 4 which allows the following syntax in CSS:

@custom-media --small-viewport ( min-width: 450px );

It would be great to get the at-rule class for @custom-media and the variable class for --small-viewport so I can style consistently between CSS, Sass and Less.

Updated syntax highlighting causes issue for namespaced CSS selectors

Prerequisites

Description

The commit: b6081eb restricts identifiers that is causing syntax highlighting failures for css selectors that include a forward slash for namespacing.

At Facebook, we use namespacing in our CSS rule definitions to help modularize our stylesheets. Our asset management pipeline then mangles the selectors to valid CSS selectors when delivering to the browser. Nuclide uses language-css for styling css files resulting in the undesired highlighting.

cc @jgebhardt

Steps to Reproduce

Use a slash in your css selector (e.g. (.something/another).

screenshot 2017-02-23 15 21 44

Versions

This change occured from Atom 1.14 -> Atom 1.15.

kstone@kstone-mbp ~> atom-beta --version
Atom    : 1.15.0-beta0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0
kstone@kstone-mbp ~> apm-beta --version
apm  1.15.3
npm  3.10.5
node 4.4.5 x64
python 2.7.10
git 2.8.0-rc2

Snippet for comments

Since CSS can have comments, I'd like to propose a snipped for adding comments to a css file, similar to the docblock snippet in language-javascript. Would this be a welcome addition to the language-css package?

CSS Auto Indentation not working

Prerequisites

Description

Indentation with: {}, [], () do not work using the CSS syntax.

Steps to Reproduce

  1. Create a new blank file
  2. Change the langauge to Atom's default 'CSS' syntax.
  3. Create a simple CSS rule

Where '|' is the I-cursor in Atom, and the indentation setting is set to 'Tabs (4 wide)'...

Expected behavior:

.cssrule'{
'''|
}

Actual behavior:

.cssrule'{
|
}

Reproduces how often:

This happens for me 100% of the time, in my normal work environment and in safe mode.

Versions

Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

Additional Information

Auto indentation is enabled in the settings, and works for all other langauges I use.

I for some reason, have two 'CSS' languages when changing, although neither work.

two 'CSS' languages

Add support for display: flow-root

Prerequisites

Description

flow-root is a new CSS value that's available for the display property. It should be part of the package to provide autocompletion.

Add support for custom properties

As a syntax theme author I would love support for CSS custom properties which allows the following syntax in CSS:

:root {
  --bg-color: rgb( 255, 255, 255 );
}

body {
  background-color: var( --bg-color );
}

It would be great to get the variable class for --bg-color so I can style consistently between CSS, Sass and Less.

css no highlights

Prerequisites

Description

[Description of the issue]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Possible to avoid maintaining duplicate feature lists?

CSS properties are listed in:

support.type.property-name.css
AND
.source.css .meta.property-list:not(.meta.property-value)

CSS property values are listed in:

support.constant.property-value.css
AND
.source.css .meta.property-value

HTML elements are listed in:

entity.name.tag.css
AND
.source.css:not(.meta.property-list)

Not to mention any lists of HTML elements and such in the language-html file.

This is going to be a pain to maintain and will easily go out of sync. Is there some way each can be defined once and pulled into both places?

Missing keywords

Some keywords are missing (not syntax highlighted):

screenshot_1

These are:

  • All transform ("translate(XYZ)") functions
  • Display modes "table-cell" and "table"

I'm pretty sure there are others, but for now, I've only noticed these 3.

Incorrect syntax highlighting for keyframes at-rule when using vendor prefixes

Prerequisites

Description

The syntax highlighting for the keyframes at-rule is not applied correctly if there are vendor prefixes. e.g. @keyframes produces the correct syntax highlighting, but @-moz-keyframes, @-o-keyframes, @-webkit-keyframes and @-ms-keyframes do not.

Steps to Reproduce

Two ways to reproduce.

First way:

  1. Create a new file with a .css extension
  2. Paste the following text into this file:
@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Syntax highlighting incorrect for vendor prefixes
/* Firefox < 16 */
@-moz-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Internet Explorer */
@-ms-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Opera < 12.1 */
@-o-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
  1. Open the file in Atom

Second way:

  1. Open a blank file (File > New File)
  2. Paste the above text into this blank file
  3. Switch the syntax to CSS

Expected behavior:
The following behavior for -webkit-keyframes, -o-keyframes, -moz-keyframes, and -ms-keyframes
expected

Actual behavior:

screen shot 2017-04-01 at 5 03 55 pm

Reproduces how often: 100%

Versions

Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
OS : MacOS Sierra 10.12.3

Additional Information

Tested with Seti and Atom Light syntax themes. Seems reproducible on multiple syntax themes.

Spaces included in CSS numerics

Looks like the space is included at the start of numeric values in CSS.

screen shot 2014-05-29 at 19 19 10

Which results in things like:

screen shot 2014-05-29 at 19 20 28

Seems to be handled fine in other places:

screen shot 2014-05-29 at 19 21 33

Media queries over multiple lines

Hi! Media queries don't work over multiple lines, even when separated with a comma. It is then treated as normal text.

    @media (-webkit-min-device-pixel-ratio: 2),
           (min-resolution: 192dpi) {
        width: 200px;
        height: 200px; 
    }

Standalone attribute selector missing

Attribute selectors are not highlighted when are not prefixed with anything.

So these are ok:

span[foo] { font-weight: bold; }
a[href*="bar"] { font-weight: bold; }

And these are not ok:

[foo] { font-weight: bold; }
[class~="bar"] { font-weight: bold; }

The weird thing is that I couldn't find any example of standalone attribute selector in specifications, but they work perfectly. All the examples uses combined selectors like h1[foo]. It seems that [foo] is the same as *[foo].

Word selection broken in LESS grammar

I'm on Atom 176, ran atom --safe then tried to select a word with cmd-d. The word boundaries are crazy. This only seems to repro in LESS grammar though. Here's a gif - after each click I press cmd-d

79kt3v1fgb

Confusion about quoted strings on long lines

I'm not 100% sure what's going on, but as an example, the following gets improperly syntax highlighted:

p::before {
  content: counter(a) "." counter(b) "." counter(c) "." counter(d) "." counter(e) "." counter(f) "." counter(g) "." counter(h) "." counter(i) "." counter(j) "." counter(k) "." counter(l);
}

In particular, counter(l); gets highlighted as if it is part of a quoted string instead of being marked up like the earlier counter invocations. See attached image.

FWIW, I distilled this example from actual CSS code I was working on.

quoted-counter

Cannot comment code that starts with a comment

Selecting all the following code and then trying to comment it out does nothing. I would expect it to comment out the css code.

/* General Overrides */

.codelab code.prettyprint {
  color: white; /* default color in case offline */
}

`@supports not` triggers incorrectly colored CSS

@supports not (-webkit-backdrop-filter: blur(10px)) {
  background: rgba(230, 230, 230, 1);
}

All CSS that comes after the first line loses its color coding. (gets reset later on)

Screenshot:
screenshot 2016-03-08 14 25 24

parens in media queries

While punctuation is well defined, the parens in a media query aren't picked up. In Less and Sass this is done correctly. I have looked into it, but there are parts of the grammar definitions I just can't get my head around yet, and those for Sass and Less are written in a completely way than CSS.

screen shot 2015-03-26 at 23 17 32

similar in less:
screen shot 2015-03-26 at 23 20 11

font-face->src->url() problematic without quotes

The following causes language-css to choke on the lack of quotes:

@font-face {
  src: url(http://example.com/font.woff) format('woff');
}

url() is not a problem outside of @font-face however, as the following works fine:

a {
    background-image: url(http://example.com)
}

Which CSS properties should be added?

I’ve put together a list of CSS properties: http://ref.openweb.io/CSS/ .

There are a lot more than are included in language-css.cson . However, not every property is implemented, and the nature of standards work means some will get renamed or dropped.

Is there a policy (or should there be?) of what gets included? If Atom gets auto-updated regularly like Chrome does, I think we can be more flexible on adding and removing CSS properties that are not set in stone. Or maybe a good policy would be just to include features that are supported by at least one browser?

If we decide what should be added, I can work on making a pull request with the properties that are missing.

Inconsistent syntax highlighting of transition properties

Prerequisites

Description

Using different keywords as transition-property results in different syntax highlighting.

Steps to Reproduce

  1. Use the syntax theme 'One Light'.
  2. Create a CSS file.
  3. Add the following code:
div {
  transition-property: width;
}

div {
  transition-property: color;
}

div {
  transition-property: background;
}

Expected behavior: [What you expect to happen]

The keywords width, color and background should have the same syntax highlighting.

Actual behavior: [What actually happens]

bildschirmfoto 2017-03-22 um 10 54 50
bildschirmfoto 2017-03-22 um 10 55 19
bildschirmfoto 2017-03-22 um 10 55 36

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

Versions

Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

apm 1.15.3
npm 3.10.5
node 4.4.5 x64
python 2.7.10
git 2.10.1

Additional Information

MDN lists background as an animated property, it also works in all browsers I have tested so far. Therefore I think it should not be highlighted as invalid. At least width and color I would suspect to have the same syntax highlighting.

“at-rule” rules treated as text

@media (min-resolution: 192dpi) {
    width: 200px;
    height: 200px; 
}

Whatever comes after { is treated as normal text when prepended by an at-rule, eg., media query. Replacing @media (min-resolution: 192dpi) with .selector “fixes” the highlighting.

Property values should not be matched by \b

See following example:

@keyframes line-scale {
}
#test {
  animation: line-scale;
}

: line-scale; generates:

<span class="meta property-value css">
  <span class="punctuation separator key-value css">:</span>
  <span class="support constant property-value css">line</span>
  -scale
  <span class="punctuation terminator rule css">;</span>
</span>

For line is a constant property-value and \b regrads - as a word boundary, it goes wrong.
Same issue with constant font-name.
ES5 doesn't support lookbehind assertions, I'm not sure how to solve it.
Maybe property-values should match <ident-token> first and then constant property-value?

custom HTML elements

Example:

page-header {
    display: block;
    background: #ff0000;
    height: calc(100% - 100px);
    overflow: auto;
}

The page-header is not colored correctly in atom.

Comments screw with media query declarations

figure-1

figure-2


Source of Examples:

Figure 1.

/** Comment */
@media (max-height: 40em /* 640px */){

}

NOTE: It's worth mentioning this affects comments sitting outside brackets, too. For example, this doesn't get highlighted properly either:

@media /* 640px */ (max-height: 40em){
}

Figure 2.

/** 640px */ @media (max-height: 40em){

}

System specs:

  • Platform: Mac OS/X 10.9.5 (Screw Yosemite)
  • Processor: 2.3 GHz Intel Core i7
  • Memory: 16 GB 1600 MHz DDR3
  • Atom version: 1.0.0

Colon Spacing Setting

I would love to have the option to adjust the spacing around the colon (:) between CSS properties and values. I think the setting is currently hard-coded in:
Example

There is no "proper" way to have this formatted; it's simply preference. Personally I prefer to have no space: background:url(img.jpg);

I'm not the only one:
atom/autocomplete-plus#103

Also in the autocomplete-plus issue above they mention that this should be an option in the "autocomplete-plus providers", so I hope I'm in the right place?

Syntax highlighting broken for import rules

I've noticed that syntax highlighting for @import rules seems to be broken atm.

screen shot 2015-10-27 at 11 55 44 am

The reference url/path doesn't get highlighted at all. (not to mention the semicolon terminator)

screen shot 2015-10-27 at 11 55 23 am

Looks like it all treated as text, it's not being caught by whatever tokenizer is being used.

Single line comments using //

Single Line Comments aren't colored properly, they should be treated the same way as any actual CSS parser handles them (everything after them to be treated as commented out).

atom-singlelinecomment

Support for shorthand numeric values

Shorthand for 0.3 which is often used is simply .3. However, the language grammar doesn't pick this up properly and doesn't mark the leading . as constant.numeric:

image

Offer custom property tokens to autocomplete

Expected behavior: Custom properties (--custom-property-123) should be offered for the autocomplete-plus Symbol Provider

Actual behavior: Custom properties are not listed by autocomplete

Versions

Atom 1.15.0

text-overflow is not syntax highlighted properly

Prerequisites

Description

I was checking out the css file of backgridjs and noticed that text-overflow was not syntax highlighted properly, the file can be found on github: https://github.com/wyuenho/backgrid/blob/master/lib/backgrid.css

As recommended in the Atom slack channel I tested Editor: Log Cursors Scopes on error lines and correct lines and all report the same message.

Scopes at Cursor

source.css
meta.property-list.css
meta.property-value.css
punctuation.terminator.rule.css

There are some additional properties not syntax highlighted in this file. I don't know if any of this is valid css, see images.

text-overflow
webkit trans
table cell

cc @50Wliu

Expected behavior: Syntax highlighting is correct because text-overflow appears to be a valid css property https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow.

Actual behavior: text-overflow is not correctly syntax highlighted.

Versions

Atom 1.7.4
Windows 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.