mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Support requiring stylesheets without an extension
Stylesheets will attempt to be resolved with both css and less extensions if no extension is included in the path specified to requireStylesheet().
This commit is contained in:
@@ -94,7 +94,7 @@ describe "Window", ->
|
||||
|
||||
$('head style[id*="css.css"]').remove()
|
||||
|
||||
it "synchronously loads and parses less files at the given path and installs a style tag for it in the head", ->
|
||||
it "synchronously loads and parses less files at the given path and installs a style tag for it in the head", ->
|
||||
lessPath = project.resolve('sample.less')
|
||||
lengthBefore = $('head style').length
|
||||
requireStylesheet(lessPath)
|
||||
@@ -117,7 +117,16 @@ describe "Window", ->
|
||||
expect($('head style').length).toBe lengthBefore + 1
|
||||
$('head style[id*="sample.less"]').remove()
|
||||
|
||||
describe ".disableStyleSheet(path)", ->
|
||||
it "supports requiring css and less stylesheets without an explicit extension", ->
|
||||
requireStylesheet 'fixtures/css'
|
||||
expect($('head style[id*="css.css"]').attr('id')).toBe project.resolve('css.css')
|
||||
requireStylesheet 'fixtures/sample'
|
||||
expect($('head style[id*="sample.less"]').attr('id')).toBe project.resolve('sample.less')
|
||||
|
||||
$('head style[id*="css.css"]').remove()
|
||||
$('head style[id*="sample.less"]').remove()
|
||||
|
||||
describe ".removeStylesheet(path)", ->
|
||||
it "removes styling applied by given stylesheet path", ->
|
||||
cssPath = require.resolve(fs.join("fixtures", "css.css"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user